|
@@ -130,11 +130,14 @@ def detect_via_api(request: Request,
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
img_batch_rgb = [cv2.cvtColor(img, cv2.COLOR_BGR2RGB) for img in img_batch]
|
|
|
-
|
|
|
+
|
|
|
results = model_dict[model_name](img_batch_rgb, size=img_size)
|
|
|
+
|
|
|
json_results = results_to_json(results, model_dict[model_name])
|
|
|
|
|
|
+
|
|
|
if download_image:
|
|
|
for idx, (img, bbox_list) in enumerate(zip(img_batch, json_results)):
|
|
|
for bbox in bbox_list:
|
|
@@ -168,7 +171,7 @@ def results_to_json(results, model):
|
|
|
for result in results.xyxy
|
|
|
]
|
|
|
|
|
|
-
|
|
|
+
|
|
|
def plot_one_box(x, im, color=(128, 128, 128), label=None, line_thickness=3):
|
|
|
|
|
|
|