Skip to content

Instantly share code, notes, and snippets.

@woolpeeker
woolpeeker / coco2yolo.py
Last active March 14, 2023 15:16
Convert other datasets to yolo format
import json
from pathlib import Path
import glob
import os
import shutil
from tqdm import tqdm
import numpy as np
@woolpeeker
woolpeeker / visualize_coco.py
Created May 28, 2020 13:11
Visualize coco detection output with fp tp missing boxes
""" only part codes """
# read groundtruth and predictions
dataDir= Path('datasets/coco')
valImageRoot = dataDir / 'val2017'
groudtruth_path = dataDir / 'annotations/instances_val2017.json'
prediction_path = 'output/inference/coco_instances_results.json'
cocoGt=COCO(groudtruth_path)
cocoDt = cocoGt.loadRes(prediction_path)