ml-jku / MIM-Refiner

A Contrastive Learning Boost from Intermediate Pre-Trained Representations
MIT License
36 stars 3 forks source link

How to evaluate the performance of clustering based on feature extracted by pretrained model on my own dataset? #1

Closed gongjizhang closed 8 months ago

BenediktAlkin commented 8 months ago

mim-refiner-clustering.zip Hi, the code for the clustering evaluations will be included within the next month into the codebase. If you are interested into it already, I attached it to this message (the main file is the clustering.py). Keep in mind that it is not cleaned up yet.

The clustering evaluations are based on features that are generated via a yaml like this. So you can download the pretrained models, change the "weights_file" name to the pre-trained model that you want to use.

To use a custom dataset, you'd either have to implement your custom dataset on your own (and adapt the yaml file to initialize your dataset instead of ImageNet) or you can simply make sure that your custom dataset is the same format as ImageNet. If that is the case, you only need to change the "template.vars.version: imagenet1k" from the yaml linked above to something like "template.vars.version: custom" and put the path to your custom dataset into the "static_config.yaml"

gongjizhang commented 8 months ago

thank you very much