code highly taken from here
path = Path(r'/home/hasan/Schreibtisch/projects/data/microscopy')
path.ls()
(#9) [Path('/home/hasan/Schreibtisch/projects/data/microscopy/patch_mask_train_coco_format.json'),Path('/home/hasan/Schreibtisch/projects/data/microscopy/patch_mask_val_coco_format.json'),Path('/home/hasan/Schreibtisch/projects/data/microscopy/patch_train_images.cache'),Path('/home/hasan/Schreibtisch/projects/data/microscopy/train_images'),Path('/home/hasan/Schreibtisch/projects/data/microscopy/patch_train_images'),Path('/home/hasan/Schreibtisch/projects/data/microscopy/patch_train_masks'),Path('/home/hasan/Schreibtisch/projects/data/microscopy/data.yaml'),Path('/home/hasan/Schreibtisch/projects/data/microscopy/train_msks'),Path('/home/hasan/Schreibtisch/projects/data/microscopy/yolo_dataset_train')]
#trn_msk_path = Path(r'/home/hasan/workspace/data/microscopy_data/patch_images')
#trn_img_path = Path(r'/home/hasan/workspace/data/microscopy_data/patch_masks/')
#trn_output_path = Path(r'/home/hasan/workspace/data/microscopy_data/yolo_dataset_train')
trn_msk_path = Path(r'/home/hasan/Schreibtisch/projects/data/microscopy/patch_train_masks')
trn_img_path = Path(r'/home/hasan/Schreibtisch/projects/data/microscopy/patch_train_images')
val_msk_path = Path(r'/home/hasan/Schreibtisch/projects/data/microscopy/patch_val_masks')
val_img_path = Path(r'/home/hasan/Schreibtisch/projects/data/microscopy/patch_val_images')
trn_output_path = Path(r'/home/hasan/Schreibtisch/projects/data/microscopy/yolo_dataset_train')
val_output_path = Path(r'/home/hasan/Schreibtisch/projects/data/microscopy/yolo_dataset_test')
Path(trn_output_path).mkdir(parents=True, exist_ok=True)
#val_msk_path = Path(r'/home/hasan/workspace/data/microscopy_data/test_patch_images/')
#val_img_path = Path(r'/home/hasan/workspace/data/microscopy_data/test_patch_masks/')
#val_output_path = Path(r'/home/hasan/workspace/data/microscopy_data/yolo_dataset_test')
#Path(val_output_path).mkdir(parents=True, exist_ok=True)
#trn_json_path = Path(r'/home/hasan/workspace/data/microscopy_data/patch_mask_train_coco_format.json')
#val_json_path = Path(r'/home/hasan/workspace/data/microscopy_data/patch_mask_val_coco_format.json')
trn_json_path = Path(r'/home/hasan/Schreibtisch/projects/data/microscopy/patch_mask_train_coco_format.json')
val_json_path = Path(r'/home/hasan/Schreibtisch/projects/data/microscopy/patch_mask_val_coco_format.json')
trn_msk_path.ls(), trn_img_path.ls()
((#1642) [Path('/home/hasan/Schreibtisch/projects/data/microscopy/patch_train_masks/img_162_p_9.png'),Path('/home/hasan/Schreibtisch/projects/data/microscopy/patch_train_masks/img_11_p_9.png'),Path('/home/hasan/Schreibtisch/projects/data/microscopy/patch_train_masks/img_70_p_5.png'),Path('/home/hasan/Schreibtisch/projects/data/microscopy/patch_train_masks/img_67_p_1.png'),Path('/home/hasan/Schreibtisch/projects/data/microscopy/patch_train_masks/img_74_p_9.png'),Path('/home/hasan/Schreibtisch/projects/data/microscopy/patch_train_masks/img_16_p_5.png'),Path('/home/hasan/Schreibtisch/projects/data/microscopy/patch_train_masks/img_23_p_1.png'),Path('/home/hasan/Schreibtisch/projects/data/microscopy/patch_train_masks/img_112_p_6.png'),Path('/home/hasan/Schreibtisch/projects/data/microscopy/patch_train_masks/img_121_p_11.png'),Path('/home/hasan/Schreibtisch/projects/data/microscopy/patch_train_masks/img_152_p_1.png')...],
(#1642) [Path('/home/hasan/Schreibtisch/projects/data/microscopy/patch_train_images/img_162_p_9.png'),Path('/home/hasan/Schreibtisch/projects/data/microscopy/patch_train_images/img_11_p_9.png'),Path('/home/hasan/Schreibtisch/projects/data/microscopy/patch_train_images/img_70_p_5.png'),Path('/home/hasan/Schreibtisch/projects/data/microscopy/patch_train_images/img_67_p_1.png'),Path('/home/hasan/Schreibtisch/projects/data/microscopy/patch_train_images/img_74_p_9.png'),Path('/home/hasan/Schreibtisch/projects/data/microscopy/patch_train_images/img_16_p_5.png'),Path('/home/hasan/Schreibtisch/projects/data/microscopy/patch_train_images/img_23_p_1.png'),Path('/home/hasan/Schreibtisch/projects/data/microscopy/patch_train_images/img_112_p_6.png'),Path('/home/hasan/Schreibtisch/projects/data/microscopy/patch_train_images/img_121_p_11.png'),Path('/home/hasan/Schreibtisch/projects/data/microscopy/patch_train_images/img_152_p_1.png')...])