From 2f3d3da32c53e926ee6143a85689d17c1f913e89 Mon Sep 17 00:00:00 2001 From: Tobias Eidelpes Date: Thu, 19 Jan 2023 10:56:02 +0100 Subject: [PATCH] Add clarifying comments --- yolo-second-run/model.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/yolo-second-run/model.py b/yolo-second-run/model.py index 5a53f59..804d633 100644 --- a/yolo-second-run/model.py +++ b/yolo-second-run/model.py @@ -33,10 +33,12 @@ def detect(img_path: str, yolo_path: str, resnet_path: str): img = cv2.imread(img_path) original = img.copy() (first_stage, second_stage) = load_models(yolo_path, resnet_path) + + # Get bounding boxes from object detection model box_coords = get_boxes(first_stage, img) box_coords.sort_values(by=['xmin'], ignore_index=True, inplace=True) - predictions = {} + predictions = {} for idx, row in box_coords.iterrows(): xmin, xmax = int(row['xmin']), int(row['xmax']) ymin, ymax = int(row['ymin']), int(row['ymax'])