VlSomers / bpbreid

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

Added labels generation #18

Closed samihormi closed 1 year ago

samihormi commented 1 year ago
VlSomers commented 1 year ago

Hi @samihormi, thanks for sharing this, I will have a look asap! Have you tried to reproduce the results on one of the public datasets, such as Occluded-Duke? Do you have some visualization of the resulting masks to share?

samihormi commented 1 year ago

Hey @VlSomers, I did reproduce the labels for Occluded-ReID, which I used as "ground-truth", to generate masks as visually close as possible to yours. I obviously don't get the exact same masks but overall, they seem to get the job down — at least visually. I put down some examples for your reference with my masks above and your masks below for comparison. Also, since I guessed my way into "reverse-engineering" your approach to get the masks — using the bpbreid and PifPaf papers — there are certainly filtering steps I have omitted, please check out the code and rectify where deemed necessary.

VlSomers commented 1 year ago

Hi @samihormi , thank you for sharing these visualizations, can you update the README file and revert all the small changes you made, to only keep the added section "### Generate human parsing labels"? I will merge your PR after that

VlSomers commented 1 year ago

Can you also provide more information on how you choose the segmentation mask to apply? If I'm not wrong, you just pick the first one returned by maskRCNN: how do you know it is a person and not another class?

VlSomers commented 1 year ago

Hi @samihormi , any update about previous questions?

samihormi commented 1 year ago

Hey @VlSomers, yes I have changed the logic of the segmentation mask generation following your comment.

Initially, I was assuming that all input is "human" and I just took the first identity generated (corresponding to the highest score). Now, the code filters masks to keep only humans and takes the centre-most human(x,y) as the mask — it's still different from the paper but close enough.

Also, I tweaked the mask. extension of PifPaf for the _OccludedreID dataset from ".jpg.confidence_fields.npy" to ".tif.confidence_fields.npy". which is the correct extension

ellzeycunha0 commented 1 year ago
        In get_labels.py:  The value of "filtered_masks" could be None because  'cls!=0'
samihormi commented 1 year ago

@ellzeycunha0 Could you give me the whole error log and the dataset configuration on which you tried the code.

ellzeycunha0 commented 1 year ago

@samihormi Processing: 0%|▍ | 225/79927 [00:14<1:09:42, 19.06batch/s] File "new_get_label.py", line 521, in main() File "new_get_label.py", line 517, in main mask_model(imagery=img_paths, dataset_dir=args.source, is_overwrite=False) File "new_get_label.py", line 392, in call pifpaf_filtered: List[np.ndarray] = self.__filter_pifpaf_with_mask(batch, pifpaf_file_paths) File "new_get_label.py", line 475, in __filter_pifpaf_with_mask masks = filter_masks(self.model(batch)) File "new_get_label.py", line 444, in filter_masks filtered_boxes, filtered_masks = zip( ValueError: not enough values to unpack (expected 2, got 0)

"zip(...)" could be None.