Update app.py
Browse files
app.py
CHANGED
@@ -81,7 +81,7 @@ def detect(img,thr=0.2,trained_dataset='aitod'):
|
|
81 |
#print(t_img.shape)
|
82 |
if trained_dataset == 'aitod':
|
83 |
labels, boxes, scores=model(t_img,size)
|
84 |
-
elif trained_dataset == '
|
85 |
labels, boxes, scores=model2(t_img,size)
|
86 |
else:
|
87 |
labels, boxes, scores=model3(t_img,size)
|
@@ -110,7 +110,7 @@ def detect(img,thr=0.2,trained_dataset='aitod'):
|
|
110 |
90: 'toothbrush'} #coco
|
111 |
|
112 |
label_color_dict = {8:'burlyWood',7:'red',6:'blue',5:'green',4:'yellow',3:'cyan',2:'magenta',1:'orange'}
|
113 |
-
if trained_dataset
|
114 |
for idx,b in enumerate(box):
|
115 |
label_i = lab[idx].item()
|
116 |
draw.rectangle(list(b), outline=label_color_dict[label_i], )
|
|
|
81 |
#print(t_img.shape)
|
82 |
if trained_dataset == 'aitod':
|
83 |
labels, boxes, scores=model(t_img,size)
|
84 |
+
elif trained_dataset == 'ten_classes':
|
85 |
labels, boxes, scores=model2(t_img,size)
|
86 |
else:
|
87 |
labels, boxes, scores=model3(t_img,size)
|
|
|
110 |
90: 'toothbrush'} #coco
|
111 |
|
112 |
label_color_dict = {8:'burlyWood',7:'red',6:'blue',5:'green',4:'yellow',3:'cyan',2:'magenta',1:'orange'}
|
113 |
+
if trained_dataset != 'COCO':
|
114 |
for idx,b in enumerate(box):
|
115 |
label_i = lab[idx].item()
|
116 |
draw.rectangle(list(b), outline=label_color_dict[label_i], )
|