zhiyuanyou/SAFECount

Inference on custom dataset

Closed this issue · 2 comments

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?

If you want to infer, you could mainly utilize the eval() function in ./tools/train_val.py by the following steps:
(1) Remove the codes about "density" in ./datasets/custom_dataset.py.
(2) Remove the codes about "density", "MAE", and "RMSE" in eval() function of ./tools/train_val.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.

Thank you for your suggestion