cvlab-stonybrook / LearningToCountEverything

MIT License
357 stars 72 forks source link

Need some help to count the number of fruits in the garden #4

Closed leminhbk closed 2 years ago

leminhbk commented 3 years ago

Dear Doctor,

I used this model to count the number of fruit in the garden but the result is not good. Please help me to improve the model in order to make it more accuracy.

The input images 01s 02 03 04 05 06

The output images 01s_box.txt 01s_out 02_box.txt 02_out 03_box.txt 03_out 04_box.txt 04_out 05_box.txt 05_out 06_box.txt 06_out debug.log

Viresh-R commented 3 years ago

Hey, Before testing, you should resize the images so that the height of the test image is 384, and the width should be adjusted so as to preserve the aspect ratio of the image. FamNet was trained on images with height resized to 384, so it may perform poorly on larger images.

leminhbk commented 3 years ago

Thanks for your promptly response. I tried to reduce the size of input images as your mentions. The results are slightly improved, but far from satisfactory. It seems that the input images has high depth so the side of those fruits are so difference. Do I need to change the image to be more homogeneous or make change to other things?

04s_out 03s_out 02s_out 01s_out 06s_out 05s_out

Viresh-R commented 3 years ago

If the distribution of images on which you're testing our model are very different from the ones in our dataset, performance of FamNet is expected to get worse. That being said, here are few things you can try to improve the performance:

  1. in case of large scale variation, try selecting exemplars from different scales (i.e. pick a large object, medium object and small object).
  2. like you suggested, placing the camera so as to reduce the scale variation of the object should help.
  3. if there's a specific category of objects on which you want to get accurate predictions, it would help if you can label some images from those categories and finetune our model on those labeled images.
iamfaith commented 2 years ago

Hello, thanks for your great work. I try to fine-tune your model on my own dataset. How could I generate the density map? It seems that it is not open source yet. Thanks for your work. Any response will be appreciated a lot.

Viresh-R commented 2 years ago

Hey, If your dataset has dot annotations, you can use any of the publicly available crowd counting density map generation code. For ex, https://github.com/leeyeehoo/CSRNet-pytorch/blob/master/make_dataset.ipynb.