Beispiel #1
0
 def get_stats(self):
     """Collects the statistics from the models"""
     for model in self.models:
         with mir.ModelInfoRetriever(os.path.join(self.models_root, model),
                                     model) as model_data:
             try:
                 model_properties = model_data.get_model_properties()
                 if str(model_properties['image_size']
                        ) in self.image_size or self.image_size[0] == 'all':
                     if model_properties[
                             'model'] in self.model_name or self.model_name[
                                 0] == 'all':
                         accuracy = model_data.get_model_topN_accuracies()
                         speed = model_data.get_model_seconds_per_frame(
                             self.plot_targets)
                         self.model_stats.append({
                             "model":
                             model_properties['model'],
                             "accuracy":
                             accuracy,
                             "secs_per_frame":
                             speed
                         })
             except:
                 print("Could not collect stats for model '{}', skipping".
                       format(model))
Beispiel #2
0
 def get_model_info(self):
     """Gathers information about the model"""
     with mir.ModelInfoRetriever(self.modeldir, self.model) as model_data:
         self.model_data = {
             "accuracy" : model_data.get_model_topN_accuracies(),
             "architecture" : model_data.get_model_architecture(self.printexe),
             "properties" : model_data.get_model_properties(),
             "timings" : model_data.get_model_seconds_per_frame(self.platforms.keys())
         }
Beispiel #3
0
 def get_stats(self):
     """Collects the statistics from the models"""
     for model in self.models:
         with mir.ModelInfoRetriever(os.path.join(self.models_root, model),
                                     model) as model_data:
             try:
                 accuracy = model_data.get_model_topN_accuracies()
                 speed = model_data.get_model_seconds_per_frame(
                     self.platforms_symbols.keys())
                 self.model_stats.append({
                     "model": model,
                     "accuracy": accuracy,
                     "secs_per_frame": speed
                 })
             except:
                 print("Could not collect stats for model '{}', skipping".
                       format(model))
Beispiel #4
0
 def get_stats(self):
     """Collects the statistics from the models"""
     for model_path in self.model_paths:
         model = os.path.basename(model_path)
         model_dir = os.path.join(self.models_root, os.path.dirname(model_path))
         with mir.ModelInfoRetriever(model_dir, model) as model_data:
             try:
                 model_properties = model_data.get_model_properties()
                 if str(model_properties['image_size']) in self.image_size or self.image_size[0] == 'all':
                     if model_properties['model'] in self.model_name or self.model_name[0] == 'all':
                         accuracy = model_data.get_model_topN_accuracies()
                         speed = model_data.get_model_seconds_per_frame(self.plot_targets)                 
                         self.model_stats.append({"name": model_properties['name'], "model": model_properties['model'], \
                          "image_size": model_properties['image_size'], "accuracy" : accuracy, "secs_per_frame" : speed, \
                          "filter_size": model_properties['filter_size'], "increase_factor": model_properties['increase_factor'], \
                          "directory": model_path})
             except:
                 self.logger.warning("Could not collect stats for model '{}', skipping".format(model))