Key-Point-Detection-on-Custom-Dataset icon indicating copy to clipboard operation
Key-Point-Detection-on-Custom-Dataset copied to clipboard

Error in visualizing loaded data

Open Syazaniwhd opened this issue 3 years ago • 0 comments

I seem to get this error when verifying to see if my data is loaded properly. I followed your code exactly. Trying to train 5 keypoints on a hand

errors: KeyError: 'segmentation'


KeyError Traceback (most recent call last) Input In [12], in <cell line: 11>() 12 img = cv2.imread(d["file_name"]) 13 visualizer = Visualizer(img[:, :, ::-1], metadata=fingers_metadata, scale=0.5)
---> 14 vis = visualizer.draw_dataset_dict(d) 15 cv2_imshow(vis.get_image()[:, :, ::-1])

File c:\users\pc\documents\urops\detectron2\detectron2\detectron2\utils\visualizer.py:551, in Visualizer.draw_dataset_dict(self, dic) 549 if annos: 550 if "segmentation" in annos[0]: --> 551 masks = [x["segmentation"] for x in annos] 552 else: 553 masks = None

File c:\users\pc\documents\urops\detectron2\detectron2\detectron2\utils\visualizer.py:551, in (.0) 549 if annos: 550 if "segmentation" in annos[0]: --> 551 masks = [x["segmentation"] for x in annos] 552 else: 553 masks = None

KeyError: 'segmentation'

Syazaniwhd avatar Oct 20 '22 03:10 Syazaniwhd