Skip to content

Commit 2782e89

Browse files
committed
removed loop for mask calculation
1 parent e8fedec commit 2782e89

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

references/detection/transforms.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,8 +471,7 @@ def forward(self, batch: torch.Tensor, target: torch.Tensor) -> Tuple[torch.Tens
471471
paste_masks.append(paste_alpha_mask)
472472

473473
# update original masks
474-
for i, mask in enumerate(source_data["masks"]):
475-
source_data["masks"][i] = mask ^ paste_alpha_mask & mask
474+
source_data["masks"] = source_data["masks"] ^ paste_alpha_mask & source_data["masks"]
476475

477476
# remove masks where no annotations are present (all values are 0)
478477
mask_filter = source_data["masks"].sum((2, 1)).not_equal(0)

0 commit comments

Comments
 (0)