anatolix / keras_Realtime_Multi-Person_Pose_Estimation

Keras version of Realtime Multi-Person Pose Estimation project
Other
118 stars 47 forks source link

About the gorundtruth PAF #14

Closed hellojialee closed 6 years ago

hellojialee commented 6 years ago

Hi @anatolix
In https://github.com/anatolix/keras_Realtime_Multi-Person_Pose_Estimation/blob/master/py_rmpe_server/py_rmpe_heatmapper.py#L124 The code does not do add and average which is different from the paper. Dose this effect the training and performance? Looking forward to you help! Thax!

anatolix commented 6 years ago

This is implemented as current C++ code which doesn't adds average either. Paper differs a bit from the reality.

see: https://github.com/ZheC/Realtime_Multi-Person_Pose_Estimation/issues/118

hellojialee commented 6 years ago

Thank you so much! Btw, I can't find the file py_rmpe_config . And how to run the test? https://github.com/anatolix/keras_Realtime_Multi-Person_Pose_Estimation/blob/new-generation/testing/rmpe_server_tester.py#L13

Ai-is-light commented 6 years ago

@USTClj @anatolix I also meet the problem how to get the final mAP score by the model trained by myself. Any help is appreciated Thanks

Ai-is-light commented 6 years ago

@ @anatolix @dremovd In the author's code—— ax3x = axarr3.flat[m].imshow(paf[:,:,16], alpha=.5) # right elbow , where can I found the relationship between the paf[:,:,number] and the joint part, for example paf[:,:, 16] with the right elbow

anatolix commented 6 years ago

This is config (in another branch) https://github.com/anatolix/keras_Realtime_Multi-Person_Pose_Estimation/blob/new-generation/config.py If you run it as python program it will print layer map. I've posted it here https://github.com/anatolix/keras_Realtime_Multi-Person_Pose_Estimation/issues/7

hellojialee commented 6 years ago

@anatolix HI, I'm sorry to bother you again. Where can I find the code of resizing the area of the main persons to the extent size of 368*368 and the code of resizing the area of non main persons? It seems that they are in the transform.py, which I'm not very sure. All instances including the main persons are all centered and resized to 368368. So, what' the different precessing between main persons and other kind of persons? I'm very confused.

Ai-is-light commented 6 years ago

Thanks your kindness, your code is more clearly than the original code @anatolix

anatolix commented 6 years ago

Where can I find the code of resizing the area of the main persons to the extent size of 368**368 and the code of resizing the area of non main persons?

Then we make hdf5 file we select several "main persons" on each image. grep for "main_persons" here https://github.com/anatolix/keras_Realtime_Multi-Person_Pose_Estimation/blob/new-generation/training/coco_masks_hdf5.py

principle of selection: 5 or more keypoints visible, size is comparable to 32x32 or more, and not too close to another main person.

The idea of main person: each picture is feeded for each main person every epoch centered around this main person( btw it is not working in michalfaber code, thats why quality of model is bit lower). Secondary persons will not get such privilege, if they close to one of main persons they will be visible on crop, and heatmap/paf will be calculated, if they too far then ... bad luck, they never be machine learning star :)

During hdf5 generation phase phase each main person gets "scale_size" parameter which used in transformer https://github.com/anatolix/keras_Realtime_Multi-Person_Pose_Estimation/blob/new-generation/py_rmpe_server/py_rmpe_transformer.py to get correct scale

Picture transformation in my code is a bit tricky, there is very good mathematical conception which called affine transformation: each shift, rotate and resize could be described as affine matrix. Matrices could be multiplied to get combined transformation. Se affine() function for that.

So instead of processing 368x368 image 4 times we just multiply 4 3x3 matrices, and process picture only once. Actually this is main reason why this python code 5 times faster than original C++ (there are some tricks in heatmap calculation but they are not so important becuase heatmaps 38x38 size, it's not too much calculations)