def coco(df):
    annotion_id = 0
    images = []
    annotations = []
    categories = [{'id': 0, 'name': 'cots'}]
    for (i, row) in df.iterrows():
        images.append({'id': i, 'file_name': f"video_{row['video_id']}_{row['video_frame']}.jpg", 'height': 720, 'width': 1280})
        for bbox in row['annotations']:
            annotations.append({'id': annotion_id, 'image_id': i, 'category_id': 0, 'bbox': list(bbox.values()), 'area': (bbox['width'] * bbox['height']), 'segmentation': [], 'iscrowd': 0})
            annotion_id += 1
    json_file = {'categories': categories, 'images': images, 'annotations': annotations}
    return json_file
def coco(df):
    annotion_id = 0
    images = []
    annotations = []
    categories = [{'id': 0, 'name': 'cots'}]
    for (i, row) in df.iterrows():
        images.append({'id': i, 'file_name': f"video_{row['video_id']}_{row['video_frame']}.jpg", 'height': 720, 'width': 1280})
        for bbox in row['annotations']:
            annotations.append({'id': annotion_id, 'image_id': i, 'category_id': 0, 'bbox': list(bbox.values()), 'area': (bbox['width'] * bbox['height']), 'segmentation': [], 'iscrowd': 0})
            annotion_id += 1
    json_file = {'categories': categories, 'images': images, 'annotations': annotations}
    return json_file