wangchen1801 / FPD

Official code of the paper "Fine-Grained Prototypes Distillation for Few-Shot Object Detection (AAAI 2024)"
https://arxiv.org/pdf/2401.07629.pdf
27 stars 4 forks source link

code question #4

Closed wml666666 closed 4 months ago

wml666666 commented 4 months ago

Hello, may I ask you a question? I am currently in the fpd_r101_c4_2xb4_voc-split_10shot fine tuning phase, with numynover_shots=10 and num_base_shots=10. I am printing ("supports img. shape:", supports img) in the forward train method of the query_spport. py file, and the output is [20,4,224,224]. I am a bit confused, shouldn't it be [20 * 10,4,224,224]? Could you please guide me? Thank you

wangchen1801 commented 4 months ago

Hello, there are 10 support imgs each category, and we chose one support img each category in a forward training process. At inference time, all of the imgs will be used to generate prototypes.

wml666666 commented 4 months ago

Thank you for your prompt reply. Is num_novel_shots=10 and num_base_shots=10 only used during testing? In the tuning phase, num_novel_shots=1 and num_base_shots=1 were used. Is my understanding correct?

wangchen1801 commented 4 months ago

I'm afraid not, num_novel_shots=10 means that there are 10 images each category. But we only sample one img each category in a single model forward process.

wml666666 commented 4 months ago

Is only one sample taken during the fine_tuning phase? Where is the code for conducting individual sampling? Sorry, I couldn't find the relevant code,

wangchen1801 commented 4 months ago

"num_support_shots=1", this parameter controls how many imgs that we sample in a single model forward process. It is set to 1 in all of our experiments. At test time, first we need to compute prototypes(model init) and then do the inference. So it is a bit different.

I think the code is in mmfewshot/mmfewshot/detection/datasets/dataset_wrappers.py

wml666666 commented 4 months ago

I understand. Thank you for your patient answer. Thank you!