henry000 commited on
Commit
814608f
Β·
2 Parent(s): 42b6e3a ce70a60

πŸ”€ [Merge] branch 'DEPLOY' into TEST

Browse files
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/tools/solver.py CHANGED
@@ -224,7 +224,7 @@ class ModelValidator:
224
 
225
  with contextlib.redirect_stdout(io.StringIO()):
226
  # TODO: load with config file
227
- json_path, _ = locate_label_paths(Path(dataset_cfg.path), dataset_cfg.get("val", "val"))
228
  if json_path:
229
  self.coco_gt = COCO(json_path)
230
 
 
224
 
225
  with contextlib.redirect_stdout(io.StringIO()):
226
  # TODO: load with config file
227
+ json_path, _ = locate_label_paths(Path(dataset_cfg.path), dataset_cfg.get("validation", "val"))
228
  if json_path:
229
  self.coco_gt = COCO(json_path)
230
 
yolo/utils/bounding_box_utils.py CHANGED
@@ -1,5 +1,5 @@
1
  import math
2
- from typing import Dict, List, Optional, Tuple
3
 
4
  import torch
5
  import torch.nn.functional as F
@@ -368,7 +368,7 @@ class Anc2Box:
368
  return preds_cls, None, preds_box, preds_cnf.sigmoid()
369
 
370
 
371
- def create_converter(model_version: str = "v9-c", *args, **kwargs):
372
  if "v7" in model_version: # check model if v7
373
  converter = Anc2Box(*args, **kwargs)
374
  else:
 
1
  import math
2
+ from typing import Dict, List, Optional, Tuple, Union
3
 
4
  import torch
5
  import torch.nn.functional as F
 
368
  return preds_cls, None, preds_box, preds_cnf.sigmoid()
369
 
370
 
371
+ def create_converter(model_version: str = "v9-c", *args, **kwargs) -> Union[Anc2Box, Vec2Box]:
372
  if "v7" in model_version: # check model if v7
373
  converter = Anc2Box(*args, **kwargs)
374
  else:
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