Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,16 +37,14 @@ def draw_coco_bboxes(img, bboxes, color=(255,255,0), width=5, show=False, export
|
|
| 37 |
return img
|
| 38 |
|
| 39 |
|
| 40 |
-
def traffic_sign_inference(
|
| 41 |
# Build the model from a config file and a checkpoint file
|
| 42 |
model = init_detector(config_file, checkpoint_file, device='cpu')
|
| 43 |
|
| 44 |
result = inference_detector(model, img)
|
| 45 |
|
| 46 |
-
#
|
| 47 |
-
img = mmcv.
|
| 48 |
-
img = mmcv.imconvert(img, 'bgr', 'rgb')
|
| 49 |
-
|
| 50 |
|
| 51 |
bboxes = result.pred_instances.bboxes
|
| 52 |
labels = [SIGNS_CLASSES[l] for l in result.pred_instances.labels]
|
|
|
|
| 37 |
return img
|
| 38 |
|
| 39 |
|
| 40 |
+
def traffic_sign_inference(img):
|
| 41 |
# Build the model from a config file and a checkpoint file
|
| 42 |
model = init_detector(config_file, checkpoint_file, device='cpu')
|
| 43 |
|
| 44 |
result = inference_detector(model, img)
|
| 45 |
|
| 46 |
+
# img = mmcv.imread(img) # numpy -> torch here!
|
| 47 |
+
# img = mmcv.imconvert(img, 'bgr', 'rgb')
|
|
|
|
|
|
|
| 48 |
|
| 49 |
bboxes = result.pred_instances.bboxes
|
| 50 |
labels = [SIGNS_CLASSES[l] for l in result.pred_instances.labels]
|