zhiyuanyou / SAFECount

[WACV 2023] Few-shot Object Counting with Similarity-Aware Feature Enhancement
Other
124 stars 22 forks source link

Inference on custom dataset #9

Closed shamilnabiyev closed 1 year ago

shamilnabiyev commented 1 year ago

Hi @zhiyuanyou Thanks for publishing such an amazing tool. I'm wondering, if it's possible to use pre-trained models (without fine-tuning) for object counting on custom dataset. May I ask you to give some hints for creating a simple demo script for such use cases?

zhiyuanyou commented 1 year ago

If you want to infer, you could mainly utilize the eval() function in ./tools/trainval.py by the following steps: (1) Remove the codes about "density" in ./datasets/customdataset.py. (2) Remove the codes about "density", "MAE", and "RMSE" in eval() function of _./tools/trainval.py. (3) Create your own dataset about inference, i.e., create a json file like example (but with no need of "density"). (4) Revise config.yaml to use your own dataset, and run python ./tools/train_val.py -e.

shamilnabiyev commented 1 year ago

Thank you for your suggestion