Skip to content

Commit

Permalink
vqdang#90 UPD: add more shape check
Browse files Browse the repository at this point in the history
  • Loading branch information
vqdang committed Jan 19, 2021
1 parent 0845678 commit d801137
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions models/hovernet/post_proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ def process(pred_map, nr_types=None, return_centroids=False):
# as the contours obtained via approximation => too small or sthg
if inst_contour.shape[0] < 3:
continue
if len(inst_contour.shape) != 2:
continue # ! check for trickery shape
inst_centroid = [
(inst_moment["m10"] / inst_moment["m00"]),
(inst_moment["m01"] / inst_moment["m00"]),
Expand Down

0 comments on commit d801137

Please sign in to comment.