Skip to content

Commit

Permalink
TESTING: Testing with 80% iou threshold for NMS
Browse files Browse the repository at this point in the history
  • Loading branch information
Spritan committed Feb 27, 2024
1 parent 7426132 commit 7437226
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions YOLOv8_Explainer/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def post_process(self, result):
numpy.ndarray: The filtered detections.
"""
result = non_max_suppression(
result, conf_thres=self.conf_threshold, iou_thres=0.65)[0]
result, conf_thres=self.conf_threshold, iou_thres=0.80)[0]
return result

def draw_detections(self, box, color, name, img):
Expand Down Expand Up @@ -298,16 +298,17 @@ def process(self, img_path):
print(e)
return
grayscale_cam = grayscale_cam[0, :]
cam_image = show_cam_on_image(
img, grayscale_cam, use_rgb=True) # type: ignore

pred = self.model(tensor)[0]
pred = self.post_process(pred)
pred1 = self.model(tensor)[0]
pred = self.post_process(pred1)
if self.renormalize:
cam_image = self.renormalize_cam(
pred[:, :4].cpu().detach().numpy().astype(
np.int32), img, grayscale_cam
)
else:
cam_image = show_cam_on_image(
img, grayscale_cam, use_rgb=True) # type: ignore
if self.show_box:
for data in pred:
data = data.cpu().detach().numpy()
Expand Down

0 comments on commit 7437226

Please sign in to comment.