Skip to content

Commit 3a28d82

Browse files
committed
Update readme
1 parent 3d53e52 commit 3a28d82

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* [Available Models](#available-models)
2020
* [Object Detection](#object-detection)
2121
* [Plate Detection](#plate-detection)
22+
* [Installation](#installation)
2223
* [Contributing](#contributing)
2324
<!-- TOC -->
2425

@@ -58,6 +59,48 @@ deployment.
5859
_<sup>[1]</sup> Inference on Mac M1 chip using CPUExecutionProvider. Utilizing CoreMLExecutionProvider accelerates speed
5960
by 5x._
6061

62+
<details>
63+
<summary>Usage</summary>
64+
65+
```python
66+
import cv2
67+
from rich import print
68+
69+
from open_image_models import LicensePlateDetector
70+
71+
# Initialize the License Plate Detector with the pre-trained YOLOv9 model
72+
lp_detector = LicensePlateDetector(detection_model="yolo-v9-t-384-license-plate-end2end")
73+
74+
# Load an image
75+
image_path = "path/to/license_plate_image.jpg"
76+
image = cv2.imread(image_path)
77+
78+
# Perform license plate detection
79+
detections = lp_detector.predict(image)
80+
print(detections)
81+
82+
# Benchmark the model performance
83+
lp_detector.show_benchmark(num_runs=1000)
84+
85+
# Display predictions on the image
86+
annotated_image = lp_detector.display_predictions(image)
87+
88+
# Show the annotated image
89+
cv2.imshow("Annotated Image", annotated_image)
90+
cv2.waitKey(0)
91+
cv2.destroyAllWindows()
92+
```
93+
94+
</details>
95+
96+
### Installation
97+
98+
To install open-image-models via pip, use the following command:
99+
100+
```shell
101+
pip install open-image-models
102+
```
103+
61104
### Contributing
62105

63106
Contributions to the repo are greatly appreciated. Whether it's bug fixes, feature enhancements, or new models,

0 commit comments

Comments
 (0)