Closed AISoltani closed 11 months ago
Thanks for writing the issue.
Looking at the global_json2yolo code, there are some flags. Converting the COCO bbox format to YOLO bbox format.
use_segments=False,
use_keypoints=False,
Converting the COCO segmentation format to YOLO segmentation format.
use_segments=True,
use_keypoints=False,
Converting the COCO keypoints format to YOLO keypoints format.
use_segments=False,
use_keypoints=True,
This code originates from Ultralytics JSON2YOLO repository. https://github.com/ultralytics/JSON2YOLO/issues/45
this code creates three empty directories when i run it, not very helpful.
Thanks for writing the issue. The converted YOLO txt files are saved in new_dir/labels/coco_filename directory.
You can customize the folder structure editing save_dir and fn.
def convert_coco_json(json_dir='../coco/annotations/', use_segments=False, use_keypoints=False, cls91to80=False):
save_dir = make_dirs() # output directory
coco80 = coco91_to_coco80_class()
# Import json
for json_file in sorted(Path(json_dir).resolve().glob('*.json')):
fn = Path(save_dir) / 'labels' / json_file.stem.replace('instances_', '') # folder name
fn.mkdir()
If you have further questions, please write an issue in the original repository. https://github.com/ultralytics/JSON2YOLO
Hey Guys. can anyone tell me how can i use this method?
from colab i import my data contain of 1000 photos with 1 JSON file which is their label, i address the path to my json but when i run global_json2yolo, It creates a folder with name new_dir for me that is empty. what's wrong? how can i fix? i have single json for all these 1000 images how can i convert it to use on yolov8 segment?