@@ -27,8 +27,8 @@ def __init__(self):
27
27
super ().__init__ ()
28
28
self ._config = self .__read_config__ (config_path )
29
29
self .temp_path = self ._config .get ('temp' )
30
- self .min_width = int (self ._config .get ('min_width' )) if self . _config . get ( 'min_width' ) else 0
31
- self .min_height = int (self ._config .get ('min_height' )) if self . _config . get ( 'min_height' ) else 0
30
+ self .min_width = int (self ._config .get ('min_width' , '0' ))
31
+ self .min_height = int (self ._config .get ('min_height' , '0' ))
32
32
self .models , self .models_allowed_classes = self .connect_models ()
33
33
self .mapping = self .class_mapping (self .models )
34
34
self .create_proj_save_dir ()
@@ -83,7 +83,7 @@ def class_mapping(self, models):
83
83
result = []
84
84
85
85
# Iterate through each class index in model_classes[0]
86
- for i , class_index in enumerate ( model_classes [0 ]) :
86
+ for class_index in model_classes [0 ]:
87
87
class_name = model_names [0 ][class_index ] # Get the class name from the first model
88
88
89
89
# Create a list to store the mapping for this class
@@ -140,6 +140,6 @@ def connect_models(self):
140
140
if not models :
141
141
raise ModuleNotFoundError ('Model not found!' )
142
142
143
- print (f'2 . Using device: { self .device } ' )
144
- print (f"3 . Using { len (models )} models: { [model_name for model_name in self ._config .get ('models' )]} " )
143
+ print (f'1 . Using device: { self .device } ' )
144
+ print (f"2 . Using { len (models )} models: { [model_name for model_name in self ._config .get ('models' )]} " )
145
145
return models , models_allowed_classes
0 commit comments