Skip to content

Return batch with cls and bbox for custom semi-supervised training #1159

Answered by Laughing-q
Bruno-Messias asked this question in Q&A
Discussion options

You must be logged in to vote

@Bruno-Messias @AyushExel well that's because this sorted_idx is empty when there're no segment labels.

masks, sorted_idx = polygons2masks_overlap((h, w), segments, downsample_ratio=self.mask_ratio)

update the following code

instances = instances[sorted_idx]
cls = cls[sorted_idx]

to:

if len(sorted_idx):
    instances = instances[sorted_idx]
    cls = cls[sorted_idx]

should get what you want.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Bruno-Messias
Comment options

Answer selected by Bruno-Messias
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants