π [Fix] bugs in onnx's output and video source
Browse files- yolo/tools/data_loader.py +1 -1
- yolo/utils/deploy_utils.py +2 -0
yolo/tools/data_loader.py
CHANGED
|
@@ -255,7 +255,7 @@ class StreamDataLoader:
|
|
| 255 |
def load_video_file(self, video_path):
|
| 256 |
import cv2
|
| 257 |
|
| 258 |
-
cap = cv2.VideoCapture(video_path)
|
| 259 |
while self.running:
|
| 260 |
ret, frame = cap.read()
|
| 261 |
if not ret:
|
|
|
|
| 255 |
def load_video_file(self, video_path):
|
| 256 |
import cv2
|
| 257 |
|
| 258 |
+
cap = cv2.VideoCapture(str(video_path))
|
| 259 |
while self.running:
|
| 260 |
ret, frame = cap.read()
|
| 261 |
if not ret:
|
yolo/utils/deploy_utils.py
CHANGED
|
@@ -45,6 +45,8 @@ class FastModelLoader:
|
|
| 45 |
if idx % 3 == 2:
|
| 46 |
model_outputs.append(layer_output)
|
| 47 |
layer_output = []
|
|
|
|
|
|
|
| 48 |
return {"Main": model_outputs}
|
| 49 |
|
| 50 |
InferenceSession.__call__ = onnx_forward
|
|
|
|
| 45 |
if idx % 3 == 2:
|
| 46 |
model_outputs.append(layer_output)
|
| 47 |
layer_output = []
|
| 48 |
+
if len(model_outputs) == 6:
|
| 49 |
+
model_outputs = model_outputs[:3]
|
| 50 |
return {"Main": model_outputs}
|
| 51 |
|
| 52 |
InferenceSession.__call__ = onnx_forward
|