Skip to content

Commit

Permalink
Fixed img path error when labelImg to yolov5
Browse files Browse the repository at this point in the history
  • Loading branch information
SWHL committed Apr 24, 2024
1 parent f6c325c commit f16ee51
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion label_convert/labelImg_to_yolov5.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ def get_train_val_test_list(
self, img_list, ratio=0.2, have_test=True, test_ratio=0.2
):
random.shuffle(img_list)
img_list = [f"{self.out_img_dir / img_path.name}" for img_path in img_list]
img_list = [
f"{Path(self.out_img_dir.name) / img_path.name}" for img_path in img_list
]
len_img = len(img_list)
if have_test:
split_idx_first = int(len_img * ratio)
Expand Down

0 comments on commit f16ee51

Please sign in to comment.