Commit
·
7d74d1a
1
Parent(s):
5478d4e
Update YOLOv5 model result as returning single object and not iterable list
Browse files
app.py
CHANGED
@@ -371,9 +371,9 @@ def _pipeline(uid,img_path):
|
|
371 |
# Detect garbage object by within travelable zones
|
372 |
for r in model_self(bgr): # YOLOv11 (self-trained)
|
373 |
detections += [b.xyxy[0].tolist() for b in r.boxes]
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
inp=processor_detr(images=pil,return_tensors="pt")
|
378 |
with torch.no_grad(): out=model_detr(**inp) # DETR
|
379 |
post = processor_detr.post_process_object_detection(
|
|
|
371 |
# Detect garbage object by within travelable zones
|
372 |
for r in model_self(bgr): # YOLOv11 (self-trained)
|
373 |
detections += [b.xyxy[0].tolist() for b in r.boxes]
|
374 |
+
r = model_yolo5(bgr) # YOLOv5
|
375 |
+
if hasattr(r, 'pred') and len(r.pred) > 0:
|
376 |
+
detections += [p[:4].tolist() for p in r.pred[0]]
|
377 |
inp=processor_detr(images=pil,return_tensors="pt")
|
378 |
with torch.no_grad(): out=model_detr(**inp) # DETR
|
379 |
post = processor_detr.post_process_object_detection(
|