Skip to content

Commit

Permalink
limit bbox size (#166)
Browse files Browse the repository at this point in the history
* limit bbox size

* style
  • Loading branch information
MateoLostanlen committed Aug 12, 2023
1 parent 63e30f6 commit 8ddfc14
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pyroengine/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,10 @@ def _update_states(self, frame: Image.Image, preds: np.array, cam_key: str) -> b
else:
output_predictions = combine_predictions

# Limit bbox size in api
output_predictions = np.round(output_predictions, 3) # max 3 digit
output_predictions = output_predictions[:5, :] # max 5 bbox

self._states[cam_key]["last_predictions"].append(
(frame, preds, str(json.dumps(output_predictions.tolist())), datetime.utcnow().isoformat(), False)
)
Expand Down

0 comments on commit 8ddfc14

Please sign in to comment.