cvlab-stonybrook / LearningToCountEverything

MIT License
361 stars 75 forks source link

Hi, I really like your work.I want to use it for my customized dataset, could you please tell me how can I train it for my customized dataset?plus which format u r using for training? like coco format? #27

Closed noreenanwar closed 2 years ago

Viresh-R commented 2 years ago

Hi, To use FamNet on your data, you need two types of annotations for each image: few bounding box exemplars (only 1-3 examples per image) in the x_topleft,y_topleft, x_bottomright, y_bottomright format. You also need dot annotations for all the objects of interest (same class as the exemplar) in the x_center, y_center format. You'll also need to convert the dot annotations into Gaussian density map (you could use this: https://github.com/CommissarMa/MCNN-pytorch/blob/master/data_preparation/k_nearest_gaussian_kernel.py)

noreenanwar commented 2 years ago

What if we don't have dot annotations?

Viresh-R commented 2 years ago

if you don't have dot annotations but bounding boxes are available for all the objects of interest, you could use the center of the bounding box as the corresponding dot. In case both dots are bounding boxes are unavailable, it wouldn't be possible to train FamNet.

noreenanwar commented 2 years ago

I have bounding box as I am using yolov5 but I don't have dot annotation.So I can still use it?

Viresh-R commented 2 years ago

Looks like you don't have human annotations to train FamNet, and you want to use Yolo predictions as the groundtruth. FamNet isn't probably going to give you better results than Yolo if you use Yolo predictions to train FamNet. you can still use it by converting the bounding boxes to dots.