Spaces:
Sleeping
Sleeping
🔀 [Merge] branch 'DEPLOY' into TEST
Browse files- yolo/tools/solver.py +3 -5
yolo/tools/solver.py
CHANGED
|
@@ -119,10 +119,9 @@ class ModelTester:
|
|
| 119 |
def __init__(self, cfg: Config, model: YOLO, vec2box: Vec2Box, progress: ProgressLogger, device):
|
| 120 |
self.model = model
|
| 121 |
self.device = device
|
| 122 |
-
self.vec2box = vec2box
|
| 123 |
self.progress = progress
|
| 124 |
|
| 125 |
-
self.
|
| 126 |
self.save_path = os.path.join(progress.save_path, "images")
|
| 127 |
os.makedirs(self.save_path, exist_ok=True)
|
| 128 |
self.save_predict = getattr(cfg.task, "save_predict", None)
|
|
@@ -144,9 +143,8 @@ class ModelTester:
|
|
| 144 |
rev_tensor = rev_tensor.to(self.device)
|
| 145 |
with torch.no_grad():
|
| 146 |
predicts = self.model(images)
|
| 147 |
-
predicts = self.
|
| 148 |
-
|
| 149 |
-
img = draw_bboxes(images, nms_out, idx2label=self.idx2label)
|
| 150 |
|
| 151 |
if dataloader.is_stream:
|
| 152 |
img = cv2.cvtColor(np.array(img), cv2.COLOR_RGB2BGR)
|
|
|
|
| 119 |
def __init__(self, cfg: Config, model: YOLO, vec2box: Vec2Box, progress: ProgressLogger, device):
|
| 120 |
self.model = model
|
| 121 |
self.device = device
|
|
|
|
| 122 |
self.progress = progress
|
| 123 |
|
| 124 |
+
self.post_proccess = PostProccess(vec2box, cfg.task.nms)
|
| 125 |
self.save_path = os.path.join(progress.save_path, "images")
|
| 126 |
os.makedirs(self.save_path, exist_ok=True)
|
| 127 |
self.save_predict = getattr(cfg.task, "save_predict", None)
|
|
|
|
| 143 |
rev_tensor = rev_tensor.to(self.device)
|
| 144 |
with torch.no_grad():
|
| 145 |
predicts = self.model(images)
|
| 146 |
+
predicts = self.post_proccess(predicts, rev_tensor)
|
| 147 |
+
img = draw_bboxes(origin_frame, predicts, idx2label=self.idx2label)
|
|
|
|
| 148 |
|
| 149 |
if dataloader.is_stream:
|
| 150 |
img = cv2.cvtColor(np.array(img), cv2.COLOR_RGB2BGR)
|