kevinconka commited on
Commit
ff19c2d
1 Parent(s): 9528b50

added patch for compatibility with payload object

Browse files
Files changed (1) hide show
  1. mot-metrics.py +7 -0
mot-metrics.py CHANGED
@@ -130,6 +130,13 @@ def calculate(predictions, references, max_iou: float = 0.5):
130
  return summary
131
 
132
  def calculate_from_payload(payload: dict, max_iou: float = 0.5, debug: bool = False):
 
 
 
 
 
 
 
133
  gt_field_name = payload['gt_field_name']
134
  models = payload['models']
135
  sequence_list = payload['sequence_list']
 
130
  return summary
131
 
132
  def calculate_from_payload(payload: dict, max_iou: float = 0.5, debug: bool = False):
133
+ if not isinstance(payload, dict):
134
+ try:
135
+ payload = payload.to_dict()
136
+ except Exception as e:
137
+ raise ValueError(
138
+ "The payload should be a dictionary or a compatible object"
139
+ ) from e
140
  gt_field_name = payload['gt_field_name']
141
  models = payload['models']
142
  sequence_list = payload['sequence_list']