SAFECount icon indicating copy to clipboard operation
SAFECount copied to clipboard

Detailed Inference Guideline?

Open jwahnn opened this issue 1 year ago • 6 comments

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.

  1. 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").

  1. 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.

  1. There are a lot of config.yaml files in the repository. Which one do you want us to revise?

Thanks in advance!

jwahnn avatar Feb 20 '24 04:02 jwahnn

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 ?

zhiyuanyou avatar Feb 20 '24 13:02 zhiyuanyou

  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.

jwahnn avatar Feb 20 '24 13:02 jwahnn

  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.

zhiyuanyou avatar Feb 20 '24 14:02 zhiyuanyou

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

jwahnn avatar Feb 21 '24 00:02 jwahnn

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.

junjun1023 avatar Feb 21 '24 02:02 junjun1023

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.

zhiyuanyou avatar Feb 22 '24 07:02 zhiyuanyou