kerzel commited on
Commit
dd24afe
·
1 Parent(s): 3b63b33

move debug messages to logging.debug instead of info

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -79,15 +79,15 @@ def damage_classification(SEM_image,image_threshold, model1_threshold, model2_th
79
  # inclusions = np.where(inclusions > model1_threshold)
80
 
81
  batch_model1 = np.array(images_model1, dtype=np.float32)
82
- logging.info(f"Model 1 input shape: {batch_model1.shape}")
83
  # Get predictions from model 1
84
  y1_pred_raw = model1(batch_model1)
85
- logging.info(f"Model 1 raw output type: {type(y1_pred_raw)}")
86
 
87
  # Extract actual predictions from the model output
88
  y1_pred = utils.extract_predictions_from_tfsm(y1_pred_raw)
89
- logging.info(f"Model 1 predictions shape: {y1_pred.shape}")
90
- logging.info(f"Model 1 predictions sample: {y1_pred[:3] if len(y1_pred) > 0 else 'Empty'}")
91
 
92
  logging.info('---------------: model1 threshold :=====================')
93
  # Handle predictions based on their shape
@@ -137,15 +137,15 @@ def damage_classification(SEM_image,image_threshold, model1_threshold, model2_th
137
  #y2_pred = model2.predict(np.asarray(images_model2, float))
138
  #y2_pred = model2(np.asarray(images_model2, float))
139
  batch_model2 = np.array(images_model2, dtype=np.float32)
140
- logging.info(f"Model 2 input shape: {batch_model2.shape}")
141
  # Get predictions from model 2
142
  y2_pred_raw = model2(batch_model2)
143
- logging.info(f"Model 2 raw output type: {type(y2_pred_raw)}")
144
  # Extract actual predictions from the model output
145
  y2_pred = utils.extract_predictions_from_tfsm(y2_pred_raw)
146
- logging.info(f"Model 2 predictions shape: {y2_pred.shape}")
147
- logging.info(f"Model 2 predictions sample: {y2_pred[:3] if len(y2_pred) > 0 else 'Empty'}")
148
- logging.info(y2_pred)
149
 
150
  logging.debug('---------------: model2 threshold :=====================')
151
 
 
79
  # inclusions = np.where(inclusions > model1_threshold)
80
 
81
  batch_model1 = np.array(images_model1, dtype=np.float32)
82
+ logging.debug(f"Model 1 input shape: {batch_model1.shape}")
83
  # Get predictions from model 1
84
  y1_pred_raw = model1(batch_model1)
85
+ logging.debug(f"Model 1 raw output type: {type(y1_pred_raw)}")
86
 
87
  # Extract actual predictions from the model output
88
  y1_pred = utils.extract_predictions_from_tfsm(y1_pred_raw)
89
+ logging.debug(f"Model 1 predictions shape: {y1_pred.shape}")
90
+ logging.debug(f"Model 1 predictions sample: {y1_pred[:3] if len(y1_pred) > 0 else 'Empty'}")
91
 
92
  logging.info('---------------: model1 threshold :=====================')
93
  # Handle predictions based on their shape
 
137
  #y2_pred = model2.predict(np.asarray(images_model2, float))
138
  #y2_pred = model2(np.asarray(images_model2, float))
139
  batch_model2 = np.array(images_model2, dtype=np.float32)
140
+ logging.debug(f"Model 2 input shape: {batch_model2.shape}")
141
  # Get predictions from model 2
142
  y2_pred_raw = model2(batch_model2)
143
+ logging.debug(f"Model 2 raw output type: {type(y2_pred_raw)}")
144
  # Extract actual predictions from the model output
145
  y2_pred = utils.extract_predictions_from_tfsm(y2_pred_raw)
146
+ logging.debug(f"Model 2 predictions shape: {y2_pred.shape}")
147
+ logging.debug(f"Model 2 predictions sample: {y2_pred[:3] if len(y2_pred) > 0 else 'Empty'}")
148
+ logging.debug(y2_pred)
149
 
150
  logging.debug('---------------: model2 threshold :=====================')
151