@@ -289,7 +289,9 @@ def _export_yolo(self, json_files_by_split):
289289 output_img_name = osp .basename (image_path )
290290 if self .use_random_names :
291291 # Extract base_name from the output_path
292- random_base = osp .splitext (osp .basename (output_path ))[0 ]
292+ random_base = osp .splitext (osp .basename (output_path ))[
293+ 0
294+ ]
293295 output_img_name = random_base + img_ext
294296
295297 if self .split_data :
@@ -301,7 +303,9 @@ def _export_yolo(self, json_files_by_split):
301303 )
302304 else :
303305 image_output_path = osp .join (
304- self .output_dir , "images" , output_img_name ,
306+ self .output_dir ,
307+ "images" ,
308+ output_img_name ,
305309 )
306310 shutil .copy2 (image_path , image_output_path )
307311
@@ -360,17 +364,17 @@ def _export_pascal_voc(self, json_files_by_split):
360364
361365 # Get file name and extension for the image
362366 img_name , img_ext = osp .splitext (osp .basename (image_path ))
363-
367+
364368 # Generate a random name if requested
365369 output_img_name = osp .basename (image_path )
366370 if self .use_random_names :
367371 # Extract base_name from the output_path
368- random_base = osp .splitext (osp .basename (output_path ))[0 ]
372+ random_base = osp .splitext (osp .basename (output_path ))[
373+ 0
374+ ]
369375 output_img_name = random_base + img_ext
370376
371- image_output_path = osp .join (
372- split_dir , output_img_name
373- )
377+ image_output_path = osp .join (split_dir , output_img_name )
374378 shutil .copy2 (image_path , image_output_path )
375379
376380 def _export_coco (self , json_files_by_split ):
@@ -432,7 +436,7 @@ def _export_coco(self, json_files_by_split):
432436
433437 # Get file name and extension for the image
434438 img_name , img_ext = osp .splitext (osp .basename (image_path ))
435-
439+
436440 # Generate a random name if requested
437441 output_img_name = osp .basename (image_path )
438442 if self .use_random_names :
@@ -441,9 +445,7 @@ def _export_coco(self, json_files_by_split):
441445 # Update the image path in all_image_paths for the export formats
442446 all_image_paths [- 1 ] = output_img_name
443447
444- image_output_path = osp .join (
445- split_dir , output_img_name
446- )
448+ image_output_path = osp .join (split_dir , output_img_name )
447449 shutil .copy2 (image_path , image_output_path )
448450
449451 self .signals .progress .emit (
@@ -522,7 +524,7 @@ def _export_createml(self, json_files_by_split):
522524
523525 # Get file name and extension for the image
524526 img_name , img_ext = osp .splitext (osp .basename (image_path ))
525-
527+
526528 # Generate a random name if requested
527529 output_img_name = osp .basename (image_path )
528530 if self .use_random_names :
@@ -531,9 +533,7 @@ def _export_createml(self, json_files_by_split):
531533 # Update the image path in all_image_paths for the export formats
532534 all_image_paths [- 1 ] = output_img_name
533535
534- image_output_path = osp .join (
535- split_dir , output_img_name
536- )
536+ image_output_path = osp .join (split_dir , output_img_name )
537537 shutil .copy2 (image_path , image_output_path )
538538
539539 self .signals .progress .emit (
0 commit comments