jhgan00 / image-retrieval-transformers

(Unofficial) PyTorch implementation of Training Vision Transformers for Image Retrieval(El-Nouby, Alaaeldin, et al. 2021).
44 stars 6 forks source link

Can I apply Custom Dataset? #7

Open LJKwang opened 1 year ago

LJKwang commented 1 year ago

Hello, I'm trying to learn by applying a custom dataset with unsupervised learning without labeling, is it possible? If It's possible, could you tell me how?

jhgan00 commented 1 year ago

Hello, IRT basically requires a labeled dataset. It would be more appropriate to refer to MAE or SimCLR(MAE trains ViT in a self-supervised manner). These methods may require a relatively large scale of data and large batch sizes.

image

image

LJKwang commented 1 year ago

I have an additional question!

  1. I'd like to see multiple renking lists like the test code here, can I apply the same for MAE or simCLR?

  2. SOP DATASET doesn't have a label but only has a class id, so isn't this a non-supervised learning?

Thank you for reading and responding!

jhgan00 commented 1 year ago
  1. Yes, you can extract compressed representations of images using trained models and retrieve similar images in the embedding space based on similarity measures like cosine similarity.

  2. Could you please clarify the term 'label'? The class IDs of the SoP dataset are a type of labels. https://paperswithcode.com/dataset/stanford-online-products.

LJKwang commented 1 year ago

I'm sorry to keep asking you. It's hard because it's my first time applying artificial intelligence.

args = torch.load("./outputs/cub200/args.pth") state_dict = torch.load("./outputs/sop/encoder.pth", map_location="cpu")

Of the two codes above, I found that "encoder.pth" is the result of learning. But, I used "args.pth" that the author posted. When customizing, won't it have a big impact?

jhgan00 commented 1 year ago

The settings defined in args are primarily parameters that only affect the training phase. If you are only running inference using a trained model, there should be no issues.

However, if you intend to continue training the model, you might need to adjust the hyperparameters that are defined in args to achieve better performance.

LJKwang commented 1 year ago

Thank you very much!

jhgan00 commented 1 year ago

Please feel free to leave a comment if you need more support