zhiyuanyou / SAFECount

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

Detailed Inference Guideline? #34

Closed jwahnn closed 3 days ago

jwahnn commented 6 months ago

Hi @zhiyuanyou, I am following #9 for testing if the SAFECount model can accurately count the number of objects in my own small dataset of ~10 images. While following the previously existing thread, I came into some problems/questions:

Remove the codes about "density" in ./datasets/custom_dataset.py.

  1. I am simply removing everything that contains "density", "MAE", and "RMSE", is this the intended behavior? Remove the codes about "density", "MAE", and "RMSE" in eval() function of ./tools/train_val.py.
  2. If so, the eval function in train_val.py returns only val_mae, val_rmse. Do I leave it so that there is no return value? Create your own dataset about inference, i.e., create a json file like example (but with no need of "density").
  3. Do the numbers in the brackets represent the bounding boxes? Revise config.yaml to use your own dataset, and run python ./tools/train_val.py -e.
  4. There are a lot of config.yaml files in the repository. Which one do you want us to revise?

Thanks in advance!

zhiyuanyou commented 6 months ago

I'd like to verify that:

  1. whether your images have GT (density map) ?
  2. how your exemplars are annotated ? Each image has exemplars annotated by boxes, OR, all images share the same exemplars ?
jwahnn commented 6 months ago
  1. My images don't have a density map. They are just images of screws and bolts in a box from Google that I wish to test if the model can count overlapping properly.
  2. Which method would work best for your model? Since I only have ~10 images, I can just draw a bounding box on one element or create a separate sample image.
zhiyuanyou commented 6 months ago
  1. If no GT (density map), you should remove the codes about "density" in ./datasets/custom_dataset.py.
  2. It is better for each image to have exemplars annotated by boxes. In this case, you should follow FSC-147 to create your own json file for inference.
  3. Since you have no GT (density map), you should revise the function eval() in ./tools/train_val.py by removing all codes for evaluation, and just leaving codes for inference.
  4. You can return val_mae=None, val_rmse=None, OR, just delete them, since you have no GT (density map) to calculate metrics.
jwahnn commented 6 months ago

I see. I assume then the output will be my input image but with the detected object segmented and the count?

junjun1023 commented 6 months ago

I'd like to verify that:

  1. whether your images have GT (density map) ?
  2. how your exemplars are annotated ? Each image has exemplars annotated by boxes, OR, all images share the same exemplars ?

Hi, if all images share the same exemplars, how should I modified to evaluate at my own data? The dataset is composed of, for example, a series of images (video) and some reference images.

zhiyuanyou commented 6 months ago

I see. I assume then the output will be my input image but with the detected object segmented and the count?

Yes, you are right.