o
    Ďi;                     @  s`   d dl mZ d dlZd dlmZ d dlmZmZ 						ddddZe	dkr.e
e dS dS )    )annotationsN)Coco)Pathincrement_path?runs/coco2yoloexp   F	image_dirstrdataset_json_pathtrain_splitint | floatprojectnameseedintc           	      C  sN   t tt || dd}tj|| d}|jt||||d td|  dS )a  
    Args:
        images_dir (str): directory for coco images
        dataset_json_path (str): file path for the coco json file to be converted
        train_split (float or int): set the training split ratio
        project (str): save results to project/name
        name (str): save results to project/name"
        seed (int): fix the seed for reproducibility
        disable_symlink (bool): required in google colab env
    F)exist_ok)coco_dict_or_pathr
   )
output_dirtrain_split_rate
numpy_seeddisable_symlinkz=COCO to YOLO conversion results are successfully exported to N)r   r   r   from_coco_dict_or_pathexport_as_yolor   print)	r
   r   r   r   r   r   r   save_dircoco r   R/home/jeff/fluffinator/venv/lib/python3.10/site-packages/sahi/scripts/coco2yolo.pymain	   s   r    __main__)r   r   r   r	   F)r
   r   r   r   r   r   r   r   r   r   r   r   )
__future__r   firesahi.utils.cocor   sahi.utils.filer   r   r    __name__Firer   r   r   r   <module>   s    &