This repository provides a feature extraction tool for DINOv2. The implementation is inspired by discussions and suggestions from this GitHub issue.
To set up the environment, you can use the requirements.txt
file provided in this repository. It contains all the necessary Python packages.
-
Clone the repository:
git clone https://github.com/HappyFern666/DINOv2_features.git cd DINOv2_features
-
Install the required packages:
conda create -n dinov2 python=3.9 conda activate dinov2 pip install -r requirements.txt
To extract features, run the extract_feature.py
script:
python dinov2_feature/extract_feature.py
And I refer to advice in Github issue, and get another code.
python dinov2_feature/2extract_feature.py