facebookresearch / dinov2

PyTorch code and models for the DINOv2 self-supervised learning method.
Apache License 2.0
8.79k stars 763 forks source link

Is it possible to use my own dataset for image classification? #199

Open test16553 opened 1 year ago

test16553 commented 1 year ago

Hello, is it possible to use a custom dataset for image classification? Approximate process: call the extract_features function of dinov2 to extract the feature vector of the target picture, and then call the knn algorithm of dinov2 to classify based on the obtained feature vector of the target picture and its own data set, and determine the label of the target picture. If this pipeline doesn't work, do you have an example of image classification using a new dataset?

patricklabatut commented 1 year ago

Yes, you should even be able to re-use the provided k-NN evaluation, see the [code] and the associated [instructions]. You would simply need to provide your dataset to replace ImageNet-1k.

shersoni610 commented 1 year ago

Hello,

I am running the code on a Mac mini with 16gb ram. Does any one have an idea on how many images and classes we can use to classify images? Is there an out of core implementation of the “fit” method.