File tree 5 files changed +18
-8
lines changed
5 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,8 @@ RUN wget -qO cpu_model.tflite https://github.com/google-coral/test_data/raw/rele
91
91
COPY labelmap.txt .
92
92
# Copy OpenVino model
93
93
COPY --from=ov-converter /models/public/ssdlite_mobilenet_v2/FP16 openvino-model
94
- RUN wget -q https://github.com/openvinotoolkit/open_model_zoo/raw/master/data/dataset_classes/coco_91cl_bkgr.txt -O openvino-model/coco_91cl_bkgr.txt
94
+ RUN wget -q https://github.com/openvinotoolkit/open_model_zoo/raw/master/data/dataset_classes/coco_91cl_bkgr.txt -O openvino-model/coco_91cl_bkgr.txt && \
95
+ sed -i 's/truck/car/g' openvino-model/coco_91cl_bkgr.txt
95
96
96
97
97
98
Original file line number Diff line number Diff line change 32
32
python3 onnx_to_tensorrt.py -m ${model}
33
33
cp /tensorrt_demos/yolo/${model} .trt ${OUTPUT_FOLDER} /${model} .trt;
34
34
done
35
-
36
- # Download Labelmap
37
- wget -q https://github.com/openvinotoolkit/open_model_zoo/raw/master/data/dataset_classes/coco_91cl.txt -O ${OUTPUT_FOLDER} /coco_91cl.txt
Original file line number Diff line number Diff line change @@ -228,7 +228,6 @@ detectors:
228
228
229
229
model :
230
230
path : /trt-models/yolov7-tiny-416.trt
231
- labelmap_path : /trt-models/coco_91cl.txt
232
231
input_tensor : nchw
233
232
input_pixel_format : rgb
234
233
width : 416
Original file line number Diff line number Diff line change @@ -706,15 +706,17 @@ def load_labels(path, encoding="utf-8"):
706
706
Dictionary mapping indices to labels.
707
707
"""
708
708
with open (path , "r" , encoding = encoding ) as f :
709
+ labels = {index : "unknown" for index in range (91 )}
709
710
lines = f .readlines ()
710
711
if not lines :
711
712
return {}
712
713
713
714
if lines [0 ].split (" " , maxsplit = 1 )[0 ].isdigit ():
714
715
pairs = [line .split (" " , maxsplit = 1 ) for line in lines ]
715
- return {int (index ): label .strip () for index , label in pairs }
716
+ labels . update ( {int (index ): label .strip () for index , label in pairs })
716
717
else :
717
- return {index : line .strip () for index , line in enumerate (lines )}
718
+ labels .update ({index : line .strip () for index , line in enumerate (lines )})
719
+ return labels
718
720
719
721
720
722
def clean_camera_user_pass (line : str ) -> str :
Original file line number Diff line number Diff line change 9
9
8 boat
10
10
9 traffic light
11
11
10 fire hydrant
12
+ 11 street sign
12
13
12 stop sign
13
14
13 parking meter
14
15
14 bench
22
23
22 bear
23
24
23 zebra
24
25
24 giraffe
26
+ 25 hat
25
27
26 backpack
26
28
27 umbrella
29
+ 28 shoe
30
+ 29 eye glasses
27
31
30 handbag
28
32
31 tie
29
33
32 suitcase
38
42
41 surfboard
39
43
42 tennis racket
40
44
43 bottle
45
+ 44 plate
41
46
45 wine glass
42
47
46 cup
43
48
47 fork
58
63
62 couch
59
64
63 potted plant
60
65
64 bed
66
+ 65 mirror
61
67
66 dining table
68
+ 67 window
69
+ 68 desk
62
70
69 toilet
71
+ 70 door
63
72
71 tv
64
73
72 laptop
65
74
73 mouse
71
80
79 toaster
72
81
80 sink
73
82
81 refrigerator
83
+ 82 blender
74
84
83 book
75
85
84 clock
76
86
85 vase
77
87
86 scissors
78
88
87 teddy bear
79
89
88 hair drier
80
- 89 toothbrush
90
+ 89 toothbrush
91
+ 90 hair brush
You can’t perform that action at this time.
0 commit comments