Skip to content

Commit f16ee51

Browse files
committed
Fixed img path error when labelImg to yolov5
1 parent f6c325c commit f16ee51

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

label_convert/labelImg_to_yolov5.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ def get_train_val_test_list(
9090
self, img_list, ratio=0.2, have_test=True, test_ratio=0.2
9191
):
9292
random.shuffle(img_list)
93-
img_list = [f"{self.out_img_dir / img_path.name}" for img_path in img_list]
93+
img_list = [
94+
f"{Path(self.out_img_dir.name) / img_path.name}" for img_path in img_list
95+
]
9496
len_img = len(img_list)
9597
if have_test:
9698
split_idx_first = int(len_img * ratio)

0 commit comments

Comments
 (0)