# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

import json

from yolox.exp import get_exp

from yolox import inference

inference.get_exp

get_exp

f = json.load(open('./annotations/instances_val2017.json'))

for i in range(len(f['images'])):
    
    f['images'][i]['file_name'] = f['images'][i]['file_name'].replace('player_crops/', '')

with open('./annotations/instances_val2017.json', 'w') as ff:
    json.dump(f, ff)

f.keys()

f['categories']

f['annotations'][0]

# +
w, h =[],[] 

for x in f['annotations']:
    w.append(x['bbox'][2])
    h.append(x['bbox'][3])
    
print(sum(w)/len(w), sum(h)/len(h))
# -



StarcoderdataJupyterScriptsDedupFiltered