VlSomers / bpbreid

[WACV23] A strong baseline for body part-based person re-identification
Other
153 stars 16 forks source link

Mask generator #8

Closed bmquynhlinh closed 1 year ago

bmquynhlinh commented 1 year ago

Hello, I'm asking about how to generate a mask which shape: .npy contains a 36xHxW array (H and W).

  1. What is H,W in this case?
  2. I tried to extract data from OpenPifPaf but it's only return keypoint, how did you get value for joints? Alternative, I use this script to calculate it: keypoints = predictions[0].data for x, y in predictions[0].skeleton: joint_array = (keypoints[x-1]+ keypoints[y-1])/2
VlSomers commented 1 year ago

Hi, HxW in this case is the height and width of the human parsing labels array, it can be anything depending on how you generate them (and generally it depends on the output tensor size of the model you used to extract them): all labels will be resized within the BPBreID code so you shouldn't care too much about it. Regarding the generation of these labels using OpenPifPaf, you need to modify their code in order to output on the disk the pif and paf confidence fields generated by PifPaf encoder. I will try to make my OpenPifPaf fork open source next week so that you can have a look at how I did that, feel free to send me a reminder if you don't receive any news within 10 days.

Let me know if I can do something else to help!

bmquynhlinh commented 1 year ago

Thank you :D

VlSomers commented 1 year ago

The Python script from @samihormi to generate human parsing labels based on PifPaf and MaskRCNN has been released, please have a look at the "Generate human parsing labels" section in the README.