Skip to content

Commit

Permalink
rm comments
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoLisin committed Aug 4, 2023
1 parent eba7044 commit 5b92c40
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions serve/serve/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,11 @@ def predict(
) -> PredictionBBox:
class_name = target_bbox.class_name
x, y, w, h = self.model.track(rgb_image)
# tlbr = [int(y), int(x), int(y + h), int(x + w)]
max_h, max_w, _ = rgb_image.shape
tlbr = self._build_bbox_params(x, y, w, h, max_w, max_h)
return PredictionBBox(class_name, tlbr, None)

def _build_bbox_params(self, x: float, y: float, w: float, h: float, max_w: int, max_h: int):
sly.logger.debug(f"Image height={max_h}, width={max_w}")
top = min(max(0, int(y)), max_h - 1)
left = min(max(0, int(x)), max_w - 1)
bottom = min(max(0, int(y + h)), max_h - 1)
Expand Down

0 comments on commit 5b92c40

Please sign in to comment.