Skip to content

Commit

Permalink
fix bug for dump json
Browse files Browse the repository at this point in the history
  • Loading branch information
mmitti committed Feb 11, 2025
1 parent 1f159af commit e49e494
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions object_detection/detic/detic.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,10 @@ def write_predictions(file_name, predictions, file_type='txt'):
for i in range(num_instances):
x0, y0, x1, y1 = boxes[i]
label = labels[i]
score = scores[i]
score = float(scores[i])
results.append({
'category': label, 'score': score,
'x': x0, 'y': y0, 'w': x1 - x0, 'h': y1 - y0
'x': int(x0), 'y': int(y0), 'w': int(x1 - x0), 'h': int(y1 - y0)
})
with open(file_name, 'w') as f:
json.dump(results, f, indent=2)
Expand Down

0 comments on commit e49e494

Please sign in to comment.