|
|
@ -6,7 +6,7 @@ import cv2 |
|
|
|
import numpy as np |
|
|
|
import numpy as np |
|
|
|
import torch |
|
|
|
import torch |
|
|
|
|
|
|
|
|
|
|
|
from config import ALPHA, CLASSES, COLORS, MASK_COLORS |
|
|
|
from config import ALPHA, CLASSES_SEG, COLORS, MASK_COLORS |
|
|
|
from models.torch_utils import seg_postprocess |
|
|
|
from models.torch_utils import seg_postprocess |
|
|
|
from models.utils import blob, letterbox, path_to_list |
|
|
|
from models.utils import blob, letterbox, path_to_list |
|
|
|
|
|
|
|
|
|
|
@ -63,7 +63,7 @@ def main(args: argparse.Namespace) -> None: |
|
|
|
for (bbox, score, label) in zip(bboxes, scores, labels): |
|
|
|
for (bbox, score, label) in zip(bboxes, scores, labels): |
|
|
|
bbox = bbox.round().int().tolist() |
|
|
|
bbox = bbox.round().int().tolist() |
|
|
|
cls_id = int(label) |
|
|
|
cls_id = int(label) |
|
|
|
cls = CLASSES[cls_id] |
|
|
|
cls = CLASSES_SEG[cls_id] |
|
|
|
color = COLORS[cls] |
|
|
|
color = COLORS[cls] |
|
|
|
cv2.rectangle(draw, bbox[:2], bbox[2:], color, 2) |
|
|
|
cv2.rectangle(draw, bbox[:2], bbox[2:], color, 2) |
|
|
|
cv2.putText(draw, |
|
|
|
cv2.putText(draw, |
|
|
|