Skip to content

Commit

Permalink
Merge pull request #2 from Superb-AI-Suite/dev
Browse files Browse the repository at this point in the history
fix error when there is a removal small object
  • Loading branch information
SangbumChoi authored Mar 21, 2024
2 parents 225274d + 5416ac4 commit fbe27f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/transformers/models/detr/image_processing_detr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1897,8 +1897,8 @@ def post_process_instance_segmentation(

instance_maps, segments = [], []
current_segment_id = 0
for j in range(num_queries):
score = pred_scores[j].item()
for j, score in enumerate(pred_scores):
score = score.item()

if not torch.all(pred_masks[j] == 0) and score >= threshold:
segmentation[pred_masks[j] == 1] = current_segment_id
Expand Down

0 comments on commit fbe27f4

Please sign in to comment.