Rafael commited on
Commit
f6022b8
1 Parent(s): 8c18dea
Files changed (1) hide show
  1. coco_metrics.py +3 -3
coco_metrics.py CHANGED
@@ -131,10 +131,10 @@ class EvaluateObjectDetection(evaluate.Metric):
131
  processed_predictions = []
132
  for pred in predictions:
133
  processed_pred: _TYPING_PREDICTION = {}
134
- for key, val in pred.items():
135
  if isinstance(val, torch.Tensor):
136
- val = pred[key].detach().cpu().tolist()
137
- processed_pred[key] = val
138
  processed_predictions.append(processed_pred)
139
  return processed_predictions
140
 
 
131
  processed_predictions = []
132
  for pred in predictions:
133
  processed_pred: _TYPING_PREDICTION = {}
134
+ for k, val in pred.items():
135
  if isinstance(val, torch.Tensor):
136
+ val = val.detach().cpu().tolist()
137
+ processed_pred[k] = val
138
  processed_predictions.append(processed_pred)
139
  return processed_predictions
140