Victoria Oberascher commited on
Commit
e8f1fff
·
1 Parent(s): 9dd3e2b

try to fix error

Browse files
Files changed (1) hide show
  1. horizon-metrics.py +6 -3
horizon-metrics.py CHANGED
@@ -179,11 +179,14 @@ class HorizonMetrics(evaluate.Metric):
179
  # this means that the metric was called using the input field on huggingface website
180
 
181
  try:
182
- print(np.asarray(predictions).shape)
183
- print(np.asarray(references).shape)
 
 
 
184
  except:
185
  # no nothing
186
- print("error")
187
  pass
188
 
189
  # calculate erros and store values in slope_error_list and midpoint_error_list
 
179
  # this means that the metric was called using the input field on huggingface website
180
 
181
  try:
182
+ if len(np.asarray(predictions).shape) == 4 and len(
183
+ np.asarray(references).shape) == 4:
184
+ self.ground_truth_det = references[0]
185
+ self.predictions = predictions[0]
186
+ print("transformed")
187
  except:
188
  # no nothing
189
+ print("do nothing")
190
  pass
191
 
192
  # calculate erros and store values in slope_error_list and midpoint_error_list