varunagrawal / tiny-faces-pytorch

Finding Tiny Faces in PyTorch
MIT License
164 stars 44 forks source link

Generating own template #17

Closed Sentient07 closed 1 month ago

Sentient07 commented 4 years ago

Hi,

Thank you for open-sourcing your code, I am thankful for your time and efforts. I am trying your codebase on a Custom dataset and I have created the JBL and template using the cluster.py. My JSON file looks like this: http://dpaste.com/26T5AC9

1) I am attempting to evaluate the Re-trained model and I observe that your prediction on a new unseen data depends on the precomputed JSON, which was generated based on training set. Is that correct?

2) Given that it depends on the JSON, I observe a discrepancy between the JSON file you have provided on the repository and the JSON file I created using your code. (Length of the list seems to be 4 in the generated case and 5 in the uploaded Case). This causes issues with at during test time, especially this line

Could you please elaborate more on what JSON file is supposed to be and how I should test on unseen images?

Thank you for your time and effort, I really appreciate it!

Regards,

zzzmoney commented 4 years ago

It seems that our own template will lack the scale column. I added the scale according to the scale allocation proportion in Pei Yun's template, that is, 4x0.5, 8x1.0, 13x2.0,Program can run successfully. The final accuracy I get on my own dataset is 0.83, it seems to be a little low.

But I'm not sure if this ratio applies to datasets other than widerface, and how to remove redundant templates is confusing. I hope the author can help explain it, thanks!

Sentient07 commented 4 years ago

Hi, @zzzmoney thank you very much for your answer, your answer makes sense to me. However, according to this codebase, testing on external unseen images would require scale and template, right? Did you manage to mitigate that as well? Again, thanks for your response!

llStringll commented 3 years ago

Hi @Sentient07 , can you please elaborate on how to test the model on our own custom dataset. I am new to this and need help to evaluate this model on a custom dataset.

varunagrawal commented 1 month ago

Answers to @Sentient07

  1. Yes the templates are your anchor boxes in object detection which are updated. These are computed from the train set as the statistically most likely anchor boxes.
  2. That's likely a bug in my clustering code. It's been a while since I've read the paper, but you will have to add a scale column as @zzzmoney mentioned in his comment (thanks for that!). My answer would be to assign scale values using the same logic/intuition as from the Tiny Faces paper.
varunagrawal commented 1 month ago

Closing since I believe the original issue has been answered. Please reopen if you still have a problem. :)