@@ -20,7 +20,7 @@ def __init__(self):
2020 # https://coral.ai/models/object-detection/
2121 # https://github.com/MikeLud/CodeProject.AI-Custom-IPcam-Models/
2222 self .MODEL_SETTINGS = {
23- "yolov5l " : Settings (448 , 'yolov5l-int8.tflite' , # 49Mb # CPU model
23+ "yolov5_large " : Settings (448 , 'yolov5l-int8.tflite' , # 49Mb # CPU model
2424 'yolov5l-int8_edgetpu.tflite' , # TPU model
2525 'coco80_labels.txt' , # labels
2626 ['yolov5l-int8_segment_0_of_7_edgetpu.tflite' , # TPU model segments
@@ -31,20 +31,20 @@ def __init__(self):
3131 'yolov5l-int8_segment_5_of_7_edgetpu.tflite' ,
3232 'yolov5l-int8_segment_6_of_7_edgetpu.tflite' ]),
3333
34- "yolov5m " : Settings (448 , 'yolov5m-int8.tflite' , # 22.7Mb
34+ "yolov5_medium " : Settings (448 , 'yolov5m-int8.tflite' , # 22.7Mb
3535 'yolov5m-int8_edgetpu.tflite' ,
3636 'coco80_labels.txt' ,
3737 ['yolov5m-int8_segment_0_of_4_edgetpu.tflite' ,
3838 'yolov5m-int8_segment_1_of_4_edgetpu.tflite' ,
3939 'yolov5m-int8_segment_2_of_4_edgetpu.tflite' ,
4040 'yolov5m-int8_segment_3_of_4_edgetpu.tflite' ]),
4141
42- "yolov5s " : Settings (448 , 'yolov5s-int8.tflite' , # 7.9Mb
42+ "yolov5_small " : Settings (448 , 'yolov5s-int8.tflite' , # 7.9Mb
4343 'yolov5s-int8_edgetpu.tflite' ,
4444 'coco80_labels.txt' ,
4545 []),
4646
47- "yolov5n " : Settings (448 , 'yolov5n-int8.tflite' , # 2.3Mb
47+ "yolov5_tiny " : Settings (448 , 'yolov5n-int8.tflite' , # 2.3Mb
4848 'yolov5n-int8_edgetpu.tflite' ,
4949 'coco80_labels.txt' ,
5050 []),
@@ -136,16 +136,31 @@ def __init__(self):
136136
137137 # Check input
138138 self .model_size = self .model_size .lower ()
139+
140+ """
141+ Let's simplify things here. The *_lo models are probably redundant, and
142+ so we can stick to tiny, small, medium, large if we split between YOLO
143+ and non-YOLO
144+
139145 if self.use_multi_tpu:
140146 model_valid = self.model_size in [ "yolov5l", "yolov5m", "yolov5s", "yolov5n", \
141147 "tiny", "small", "medium", "large", \
142148 "small_lo", "tiny_lo" ]
143149 else:
144150 model_valid = self.model_size in [ "tiny", "small", "medium", "large" ]
145-
151+ """
152+ model_valid = self .model_size in [ "tiny" , "small" , "medium" , "large" ]
146153 if not model_valid :
147154 self .model_size = "small"
148155
156+ self .use_YOLO = ModuleOptions .getEnvVariable ("CPAI_CORAL_USE_YOLO" , "false" ).lower () == "true"
157+ # if not self.use_multi_tpu: # Doesn't seem to work on non-multi-TPU code
158+ # self.use_YOLO = False
159+ self .use_YOLO = False # Doesn't seem to work at all for me :(
160+
161+ if self .use_YOLO :
162+ self .model_size = "yolov5_" + self .model_size
163+
149164 # Get settings
150165 settings = self .MODEL_SETTINGS [self .model_size ]
151166 self .cpu_model_name = settings .cpu_model_name
0 commit comments