Skip to content

Latest commit

 

History

History
57 lines (36 loc) · 1.65 KB

README.md

File metadata and controls

57 lines (36 loc) · 1.65 KB

DINOv2 ONNX Inference

This repository contains a Python script (onnx_inference.py) for extracting and comparing image features using the DINOv2 model in ONNX format. The script uses the onnxruntime library to load and run the model.

Dependencies

Models

Models can be obtained by exporting PyTorch models to ONNX models. To export models to ONNX, you can utilize the onnx_export_merge branch.

In addition, you can download pre-exported models from:

Google Drive

Hugging Face

Usage

  1. Clone the repository:

    git clone [email protected]:sefaburakokcu/dinov2_onnx.git
    cd dinov2_onnx
  2. Install the required Python dependencies:

    pip install -r requirements.txt

    Make sure you have Python and pip installed.

  3. Place your input images in the inputs directory.

  4. Run the inference script:

    python onnx_inference.py

    Optional arguments:

    • --onnx_model: Path to the ONNX model file (default: ./dinov2_vits14.onnx).
    • --image_folder: Path to the folder containing input images (default: ./inputs/).

License

This project is licensed under the MIT License.