Closed deolipankaj closed 5 months ago
Thanks for writing the issue and introducing the dataset. We download the CanaTree100 and converted to segmentation and keypoints to YOLO format separately. On RectLabel, segmentations and keypoints are correctly shown.
To fix the class index -1 problem, change this line not to subtract 1 from the category_id. Usually in the COCO format, category_id starts from 1, but in this dataset, category_id starts from 0.
# cls = coco80[ann['category_id'] - 1] if cls91to80 else ann['category_id'] - 1 # class
cls = coco80[ann['category_id'] - 1] if cls91to80 else ann['category_id'] # class
In my understanding, when traing YOLOv8, segmentation and keypoints are trained separately. In Detectron, training from COCO format directly, it can train the segmentation and keypoints at the same time.
In the YOLO format for keypoints, (x, y, v) values are included, and a visibility flag v defined as v=0: not labeled, v=1: labeled but not visible, and v=2: labeled and visible.
Please let us know your feedback.
We updated the general_json2yolo script so that both segmentation and keypoints are converted in different lines.
convert_coco_json('../datasets/coco/annotations', # directory with *.json
use_segments=True,
use_keypoints=True,
cls91to80=False,
category_id_starts_from_0=True)
Hi Ryo, thank you for the fast reply. I did try with the updated conversion file and here's what I encountered with.
use_segments=False, use_keypoints=False, cls91to80=False, category_id_starts_from_0=True)
, everything works fine. use_segments=True, use_keypoints=False, cls91to80=False, category_id_starts_from_0=True)
, I get the following errorThanks..
Thanks for the detailed feedback.
We updated the general_json2yolo script so that it works for the SynthTree43k datasets.
Please let us know your feedback.
convert_coco_json('../datasets/coco/annotations', # directory with *.json
use_segments=True,
use_keypoints=True,
rle_to_polygons_holes=False,
save_rle_masks=False,
cls91to80=False,
category_id_starts_from_0=True)
Hi Ryo,
Thank you for your support. Now the code is working perfectly for all use-cases.
Thanks for your detailed feedback. If you have any other problems, please let us know. We are happy to support users.
Hi Ryo, i am trying to convert a dataset (https://github.com/norlab-ulaval/PercepTreeV1/tree/main) which has been labelled originally with the help of coco-annotator (https://github.com/jsbroks/coco-annotator) to the yolov8 format to be used for object detection/instance segmentation.
For conversion, i am using your updated "general_json2yolo" file which also has support for Keypoints. But while conversion, i am getting some issues with Keypoints.![image](https://github.com/ryouchinsa/Rectlabel-support/assets/64693591/7fee0c21-053c-45c4-8f91-9de48a00502b)
If we look at a snippet of the coco json file, we have something that looks like this (wrt keypoints)..
However, after also conversion, the yolov8 file looks like this![image](https://github.com/ryouchinsa/Rectlabel-support/assets/64693591/4d72bdd0-0702-4f09-95a3-39452762247f)
Please ignore the class id, i rectified it. But can you please suggest why the keypoints are not getting normalized (between 0 and 1). I did not changed anything from the code. Also, i put use_segment and use_keypoint to true, but still there are no segmentation points in the converted yolov8 txt file.
And i guess, when I am doing the training for Yolov8, the error I am getting is due to this ?![image](https://github.com/ryouchinsa/Rectlabel-support/assets/64693591/0e0ed020-db0a-463e-bd6f-2dee09771cc6)