Skip to content

Commit

Permalink
Do not cut affinity if there is no semantic label (0)
Browse files Browse the repository at this point in the history
  • Loading branch information
ranlu committed May 23, 2024
1 parent d590234 commit 518f120
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/augment_affinity.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ def mask_affinity_with_semantic_labels(aff_cutout, sem, bbox, boundary_flags, pa
(1-offsets[i][1]):sem_shape[1]-offsets[i][1],
(1-offsets[i][2]):sem_shape[2]-offsets[i][2]]
#aff_i[numpy.logical_and(sem_aligned > 0, sem_offset == sem_aligned)] = 1.0
aff_i[sem_offset != sem_aligned] = 0
mask = numpy.logical_and(numpy.logical_and(sem_offset != 0, sem_aligned != 0), sem_offset != sem_aligned)
aff_i[mask] = 0

return aff_cutout

0 comments on commit 518f120

Please sign in to comment.