Tsingularity / FRN

(CVPR 2021) Few-Shot Classification with Feature Map Reconstruction Networks
MIT License
110 stars 18 forks source link

How to predict new images with pre-trained model. #11

Closed trlnoe closed 2 years ago

trlnoe commented 2 years ago

Assuming I have a new image without labeling it into any class id, what should I modify the given code to gain the right class id with your suggested model? Your solution seems very appropriate to my problems, and I truly hope that I could apply it precisely to mine, so I really look forward to your answer! Thank you in advance!

Tsingularity commented 2 years ago

Hi, thanks for ur interest in our work!

Since this codebase is mainly intend for reproducing the training and evaluation of our proposed method, it might be a bit hard to adapt it to a single demo showcase.

I think you can refer to the meta_test() function we used during evaluation. If you replaced the dataloader with yours (or replace the per-episode inp tensor with your post-processed data tensors), it should be fine. But it should be noted that, in addition to the query images, you also need to give the few-shot support images as part of the input (more details could be found in our dataloader sampler and model meta_test functions.)

Feel free to let us know if u have more questions.

Tsingularity commented 2 years ago

Closing for now. Feel free to reopen if u have more questions.

trlnoe commented 2 years ago

Thank you so much! It's really helpful for my cases.

0-Maxwei-0 commented 1 year ago

Thank you so much! It's really helpful for my cases.

hello! I have the same question as you. Can you share some details about how you solved this?