Skip to content

Commit

Permalink
clip values
Browse files Browse the repository at this point in the history
  • Loading branch information
MateoLostanlen committed Jul 31, 2023
1 parent 42a2acc commit a4619dd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pyroengine/vision.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ def __call__(self, pil_img: Image.Image, occlusion_mask: np.array = None) -> np.
for p in y.copy():
p[:4:2] *= wm
p[1:4:2] *= hm
p[:4:2] = np.clip(p[:4:2], 0, wm)
p[:4:2] = np.clip(p[:4:2], 0, hm)
x0, y0, x1, y1 = p.astype("int")[:4]
if np.sum(occlusion_mask[y0:y1, x0:x1]) > 0:
keep.append(True)
Expand Down

0 comments on commit a4619dd

Please sign in to comment.