Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added labels generation #18

Merged
merged 3 commits into from
Jul 26, 2023
Merged

Added labels generation #18

merged 3 commits into from
Jul 26, 2023

Conversation

samihormi

This comment was marked as duplicate.

@VlSomers
Copy link
Owner

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
Copy link
Contributor Author

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.

  • occluded_body_images/001/001_01.tif
    output
    output1

  • whole_body_images/034/034_03.tif
    output2
    output3

  • occluded_body_images/131/131_01.tif
    output5
    output6

@VlSomers
Copy link
Owner

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
Copy link
Owner

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
Copy link
Owner

VlSomers commented Jul 6, 2023

Hi @samihormi , any update about previous questions?

@samihormi
Copy link
Contributor Author

samihormi commented Jul 13, 2023

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 Occluded_reID dataset from ".jpg.confidence_fields.npy" to ".tif.confidence_fields.npy". which is the correct extension

@ellzeycunha0
Copy link

ellzeycunha0 commented Jul 19, 2023

        In get_labels.py:  The value of "filtered_masks" could be None because  'cls!=0'

@samihormi
Copy link
Contributor Author

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

@ellzeycunha0
Copy link

@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.

@VlSomers VlSomers merged commit 8170825 into VlSomers:main Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants