Code Monkey home page Code Monkey logo

dinov2_onnx's Introduction

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.

dinov2_onnx's People

Contributors

sefaburakokcu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dinov2_onnx's Issues

use in cpp

I had attemped to using onnxruntime in c++ to run the model, but I got results that were not as same as the python did, and indistinguishable, so I'll be preciate if you can provide a c++ version or help me find the problem.Here is my code:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.