🚘 DriveID Filter
DriveID Filter is a modular OpenFilter-based component that detects license plates in video frames using a custom-trained Faster R-CNN model.
It supports per-frame bounding box predictions, polygon ROI forwarding, and configurable JSON logging — making it easy to plug into OpenFilter pipelines and downstream processing systems.
✨ Features
- 🚘 Detects license plates in RGB video frames using Faster R-CNN
- 🔍 Configurable confidence threshold and debug logging
- 📤 Forwards detection ROIs as polygons to other filters
- 🧾 Optional logging of per-frame detections to JSON
- 🧩 Fully compatible with OpenFilter pipelines
📦 Installation
Install from PyPI:
pip install filter-license-plate-detection
Or install from source:
# Clone the repo
git clone https://github.com/PlainsightAI/filter-license-plate-detection.git
cd filter-license-plate-detection
# (Optional but recommended) create a virtual environemnt:
python -m venv venv && source venv/bin/activate
# Install the filter and download the model
make install
🚀 Quick Start (CLI)
Run the DriveID Filter as part of a pipeline:
openfilter run \
- VideoIn --sources file://example_video.mp4!loop \
- filter_license_plate_detection.filter.FilterLicensePlateDetection \
--model_path ./model.pth \
--forward_detection_rois true \
--write_detections_to_json true \
--output_json_path ./detections.json \
- Webvis
Or simply:
make run
Then open http://localhost:8000 to view results.
🧰 Using from PyPI
After installation:
pip install filter-license-plate-detection
You can run the filter directly:
Standalone usage
from filter_license_plate_detection.filter import FilterLicensePlateDetection
if __name__ == "__main__":
FilterLicensePlateDetection.run()
In an OpenFilter pipeline
from openfilter.filter_runtime.filter import Filter
from openfilter.filter_runtime.filters.video_in import VideoIn
from openfilter.filter_runtime.filters.webvis import Webvis
from filter_license_plate_detection.filter import FilterLicensePlateDetection
if __name__ == "__main__":
Filter.run_multi([
(VideoIn, dict(sources='file://example.mp4!loop')),
(FilterLicensePlateDetection, dict(
model_path="./model.pth",
confidence_threshold=0.75,
forward_detection_rois=True
)),
(Webvis, {}),
])
🧪 Testing
Run unit tests:
make test
Or a specific test:
pytest -v tests/test_filter_license_plate_detection.py
Tests include:
- Model inference
- Confidence filtering
- Polygon forwarding
- JSON logging
- Frame skipping logic
⚙️ Configuration
| Config Key | Description | Type | Default |
|---|---|---|---|
model_path |
Path to the model .pth file |
str |
./model.pth |
confidence_threshold |
Minimum confidence to keep detections | float |
0.7 |
debug |
Enable debug logging | bool |
False |
write_detections_to_json |
Write detection results to a JSON file | bool |
False |
output_json_path |
Path to the output JSON log file | str |
./output/license_plate_results.json |
forward_detection_rois |
Forward detected bounding boxes as polygon ROIs | bool |
False |
roi_output_label |
Metadata key under which to store ROIs | str |
license_plate_roi |
All fields can also be configured via environment variables using the prefix FILTER_ (e.g., FILTER_MODEL_PATH).
📤 Detection Output Format
Each frame’s detection output is stored in:
frame.data['license_plate_detection']
Example output:
{
"frame_id": "frame_001",
"plates": [
{
"label": "license_plate",
"score": 0.92,
"box": [320, 180, 460, 240]
}
]
}
If forward_detection_rois is enabled, the filter also adds polygon metadata:
frame.data["meta"]["license_plate_roi"] = [
[(320, 180), (460, 180), (460, 240), (320, 240)]
]
📄 License
Licensed under the Apache 2.0 License.
🙌 Acknowledgements
Thanks for using and improving the DriveID Filter! To report bugs or suggest improvements, open a GitHub issue.
Metadata
Release files for filter-license-plate-detection 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| filter_license_plate_detection-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for filter_license_plate_detection-0.2.0-py3-none-any.whl |
Release files / filter_license_plate_detection-0.2.0-py3-none-any.whl
| Download URL | filter_license_plate_detection-0.2.0-py3-none-any.whl |
|---|---|
| Size | 10.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8be41cbde194b161d4eeb8edb3764a553720449561c15926336507a9c18fbeb4
|
|
BLAKE2b-256 checksum How to use checksums |
d3611fccf0b83bddc7651bace8db4305b2f4dd4e6502daf665d96253c6333795
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.18
|
Security for filter-license-plate-detection 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.