bascobasculino commited on
Commit
0fc63e3
1 Parent(s): 51908c1
Files changed (1) hide show
  1. my_metricv2.py +8 -4
my_metricv2.py CHANGED
@@ -117,13 +117,17 @@ def calculate(predictions, references):
117
  """Returns the scores"""
118
  try:
119
  np_predictions = np.array(predictions)
 
 
 
 
120
  np_references = np.array(references)
121
  except:
122
- raise ValueError("The predictions and references should be lists of floats in the correct format [frame number, object id, bb_left, bb_top, bb_width, bb_height, confidence]")
123
 
124
- print(predictions)
125
- print(references)
126
-
127
  return {
128
 
129
  "predictions": predictions,
 
117
  """Returns the scores"""
118
  try:
119
  np_predictions = np.array(predictions)
120
+ except:
121
+ raise ValueError("The predictions should be a list of np.arrays in the format [frame number, object id, bb_left, bb_top, bb_width, bb_height, confidence]")
122
+
123
+ try:
124
  np_references = np.array(references)
125
  except:
126
+ raise ValueError("The references should be a list of np.arrays in the format [frame number, object id, bb_left, bb_top, bb_width, bb_height, confidence]")
127
 
128
+ num_frames = max(np_references[:, 0].max(), np_predictions[:, 0].max())+1
129
+ # acc = mm.MOTAccumulator(auto_id=True)
130
+ print(num_frames)
131
  return {
132
 
133
  "predictions": predictions,