Skip to main content

Pre-trained image models using ONNX for fast, out-of-the-box inference.

Project description

Open Image Models

Actions status Actions status GitHub version image Ruff Documentation Status Pylint Checked with mypy ONNX Model Hugging Face Spaces License


Introduction

Ready-to-use models for a range of computer vision tasks like detection, classification, and more. With ONNX support, you get fast and accurate results right out of the box.

Easily integrate these models into your apps for real-time processing—ideal for edge devices, cloud setups, or production environments. In one line of code, you can have powerful model inference running!

from open_image_models import LicensePlateDetector

lp_detector = LicensePlateDetector(detection_model="yolo-v9-t-256-license-plate-end2end")
lp_detector.predict("path/to/license_plate_image.jpg")

✨ That's it! Powerful license plate detection with just a few lines of code.

Features

  • 🚀 Pre-trained: Models are ready for immediate use, no additional training required.
  • 🌟 ONNX: Cross-platform support for fast inference on both CPU and GPU environments.
  • ⚡ Performance: Optimized for both speed and accuracy, ensuring efficient real-time applications.
  • 💻 Simple API: Power up your applications with robust model inference in just one line of code.

Installation

To install open-image-models via pip, use the following command:

pip install open-image-models[onnx]

[!NOTE] For hardware acceleration, you can use one of the following extras instead: onnx-gpu, onnx-openvino, onnx-directml, or onnx-qnn. Example: pip install open-image-models[onnx-gpu]

Available Models

Object Detection

Plate Detection

Model Image Size Precision (P) Recall (R) mAP50 mAP50-95
yolo-v9-s-608-license-plate-end2end 608 0.957 0.917 0.966 0.772
yolo-v9-t-640-license-plate-end2end 640 0.966 0.896 0.958 0.758
yolo-v9-t-512-license-plate-end2end 512 0.955 0.901 0.948 0.724
yolo-v9-t-416-license-plate-end2end 416 0.94 0.894 0.94 0.702
yolo-v9-t-384-license-plate-end2end 384 0.942 0.863 0.92 0.687
yolo-v9-t-256-license-plate-end2end 256 0.937 0.797 0.858 0.606
Usage
import cv2
from rich import print

from open_image_models import LicensePlateDetector

# Initialize the License Plate Detector with the pre-trained YOLOv9 model
lp_detector = LicensePlateDetector(detection_model="yolo-v9-t-384-license-plate-end2end")

# Load an image
image_path = "path/to/license_plate_image.jpg"
image = cv2.imread(image_path)

# Perform license plate detection
detections = lp_detector.predict(image)
print(detections)

# Benchmark the model performance
lp_detector.show_benchmark(num_runs=1000)

# Display predictions on the image
annotated_image = lp_detector.display_predictions(image)

# Show the annotated image
cv2.imshow("Annotated Image", annotated_image)
cv2.waitKey(0)
cv2.destroyAllWindows()

[!TIP] Checkout the docs!

Contributing

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

To start contributing or to begin development, you can follow these steps:

  1. Clone repo
    git clone https://github.com/ankandrew/open-image-models.git
    
  2. Install all dependencies using Poetry:
    make install
    
  3. To ensure your changes pass linting and tests before submitting a PR:
    make checks
    

Citation

@article{wang2024yolov9,
  title={{YOLOv9}: Learning What You Want to Learn Using Programmable Gradient Information},
  author={Wang, Chien-Yao  and Liao, Hong-Yuan Mark},
  booktitle={arXiv preprint arXiv:2402.13616},
  year={2024}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

open_image_models-0.5.1.tar.gz (119.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

open_image_models-0.5.1-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file open_image_models-0.5.1.tar.gz.

File metadata

  • Download URL: open_image_models-0.5.1.tar.gz
  • Upload date:
  • Size: 119.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for open_image_models-0.5.1.tar.gz
Algorithm Hash digest
SHA256 2a2315c9e30c691271e186008c760cd51a94e87bbe8d8afaa4dddad83440747e
MD5 4e1d7a5591bf359fec4e9ea866786956
BLAKE2b-256 749f46a8b1f0e9d7affa47f8295e436a8a66b3a920921da8dc153c0f27f59edf

See more details on using hashes here.

Provenance

The following attestation bundles were made for open_image_models-0.5.1.tar.gz:

Publisher: release.yaml on ankandrew/open-image-models

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file open_image_models-0.5.1-py3-none-any.whl.

File metadata

File hashes

Hashes for open_image_models-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 050f55b68c55d7743a20cca43f593a53c08d44234e1e536c61fb82da2d60f981
MD5 86fb36be69f2105f0240724d62397154
BLAKE2b-256 2697dde7229af43b7bb60bc371f9d38d252de61ee23a240e59dbf39ae6dfb3bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for open_image_models-0.5.1-py3-none-any.whl:

Publisher: release.yaml on ankandrew/open-image-models

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page