erikalu / class-agnostic-counting

63 stars 14 forks source link

Error when trying to adapt CARPK dataset #9

Closed weicheng113 closed 2 years ago

weicheng113 commented 2 years ago

Hi,

I was trying to adapt CARPK dataset with following command. But there are a couple of issues.

python src/main.py --mode adapt --dataset car --data_path /path/to/CARPK --gmn_path /path/to/pretrained_gmn.h5

Firstly, CARPK dataset only has annotated boundingbox. The adaptation asks for dot annotation. I wonder how the dot annotation labels were done in paper experiments? Do you use any tool or generate dot annotation images from boundingbox files and is there any requirement when generating these images(for example, how large should the dots be?)?

Secondly, trn_lst loaded from car.npz contains '.jpg' extension files. The original CARPK dataset is in png format. I assume I can manually change it to accept png images?

Thanks, Cheng

erikalu commented 2 years ago

Hi, you can place a dot at the center pixel of the bounding box.

Yes, you can change the filenames from png to jpg.

On Wed, Jun 29, 2022 at 10:35 AM Cheng Wei @.***> wrote:

Hi,

I was trying to adapt CARPK dataset with following command. But there are a couple of issues.

python src/main.py --mode adapt --dataset car --data_path /path/to/CARPK --gmn_path /path/to/pretrained_gmn.h5

Firstly, CARPK dataset only has annotated boundingbox. The adaptation asks for dot annotation. I wonder how the dot annotation labels were done in paper experiments? Do you use any tool or generate dot annotation images from boundingbox files and is there any requirement when generating these images(for example, how large should the dots be?)?

Secondly, trn_lst loaded from car.npz contains '.jpg' extension files. The original CARPK dataset is in png format. I assume I can manually change it to accept png images?

Thanks, Cheng

— Reply to this email directly, view it on GitHub https://github.com/erikalu/class-agnostic-counting/issues/9, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABR4O2P3ZBK5KWXBP4NAPQTVROR67ANCNFSM52EBQZMA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

weicheng113 commented 2 years ago

Thanks a lot for the reply, @erikalu . I did the same thing as you suggested. I experimented with modified pytorch version(as keras and tensorflow is not easy for debugging) - https://github.com/weicheng113/class-agnostic-counting-pytorch . I did pretraining with ILSVRC15 dataset and then adaptation with CARPK dataset. The result for CARPK is not far away from the result given in the paper. One thing I noticed was the average number of cars of an image from CARPK is about 40. When there is 7.48 MAE, it is about 19% error rate and it is significant. I was trying to unfreeze all the weights while training with CARPK, but I did not get much decrease in MAE. Thanks for the paper and shared code.

I saw a more recent paper - https://arxiv.org/pdf/2201.08959.pdf , which is based on the idea of GMN and looks interesting. It does not come with source code.