Skip to content

Commit

Permalink
check if agnostic_nms in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxTeselkin committed Apr 26, 2023
1 parent a76b283 commit 9e56dfb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion supervisely/serve/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,12 @@ def predict(self, image_path: str, settings: Dict[str, Any]) -> List[sly.nn.Pred
inf_out = self.model(img, augment=augment)[0]

# Apply NMS
if "agnostic_nms" in settings:
is_agnostic = settings["agnostic_nms"]
else:
is_agnostic = False
output = non_max_suppression(
inf_out, conf_thres=conf_thres, iou_thres=iou_thres, agnostic=settings["agnostic_nms"]
inf_out, conf_thres=conf_thres, iou_thres=iou_thres, agnostic=is_agnostic
)

predictions = []
Expand Down

0 comments on commit 9e56dfb

Please sign in to comment.