Skip to content

Instantly share code, notes, and snippets.

@Tony607
Created October 14, 2019 05:35
Show Gist options
  • Save Tony607/dfe719641ebeb9d74e39fa09661a4734 to your computer and use it in GitHub Desktop.
Save Tony607/dfe719641ebeb9d74e39fa09661a4734 to your computer and use it in GitHub Desktop.
How to train Detectron2 with Custom COCO Datasets | DLology
import random
from detectron2.utils.visualizer import Visualizer
for d in random.sample(dataset_dicts, 3):
img = cv2.imread(d["file_name"])
visualizer = Visualizer(img[:, :, ::-1], metadata=fruits_nuts_metadata, scale=0.5)
vis = visualizer.draw_dataset_dict(d)
cv2_imshow(vis.get_image()[:, :, ::-1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment