CasiaFan / tensorflow_retinanet

RetinaNet with Focal Loss implemented by Tensorflow
121 stars 45 forks source link

How can I detect head from Hollywoodheads dataset? #4

Open apollo-time opened 6 years ago

apollo-time commented 6 years ago

I see create_tf_record_pascal_fmt.py can process Hollywoodheads dataset. I converted the dataset into tf record. How can I train net to detecting head? I try run train.py but got error

anchor_generator.py line 318, in anchor_assign ValueError: Shape must be at least rank 1 but is rank 0 for 'Gather_1' (op: 'Gather') with input shapes: [], [?].

CasiaFan commented 6 years ago

@apollo-time Sorry, this project is not finished yet. Now the backbone of this project is modified from Tensorflow object detection project using slim. I think its too heavy so I give up in midway and turn to Keras. Maybe complete project will be released in the end this month but now I have little personal time due to work. When the project is ready, I will inform you, but now I am sorry to recommend you to look at keras_retinanet or pytorch_retinanet first.

apollo-time commented 6 years ago

Oh, thanks. I tested object detection project in tensorflow with mobile ssd model to detect head from hollywoodheads, but got poor result. I try keras_retinanet but I don't know keras as well as tensorflow. What is the best method to detect head?

CasiaFan commented 6 years ago

@apollo-time I think algorithm and data influences the result much more, not the frameworks. But trust me, try Keras first, you will find the sky is bluer and the life is happier :smirk: As for your question, It depends. If your detect target in image has various size from several pixels to hundreds pixels, I think second stage detection methods is a good choice (like faster RCNN or FPN); SSD sacrifices accuracy to pursue speed which is not good at detect small object due to the grid design.

apollo-time commented 6 years ago

Are you planning detect head from Hollywoodheads dataset?

CasiaFan commented 6 years ago

@apollo-time Yes, I have tested using Hollywoodheads dataset with SSD in tensorflow object detect API. It woks very well under most normal situations and perspective angles except for overhead view. I find only tiny portion of samples are taken from overhead view, so I think you may need to add extra images if you have to work with such situation.

mgoundge11 commented 6 years ago

Hi @CasiaFan is this project finished? I try to use this with my own dataset but getting the same error as @apollo-time
anchor_generator.py line 318, in anchor_assign ValueError: Shape must be at least rank 1 but is rank 0 for 'Gather_1' (op: 'Gather') with input shapes: [], [?].