Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pascal2yolo/voc2yolo.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@

annotation_no_xml = os.path.splitext(file)[0]

imagePath = os.path.join(imgFolderPath, annotation_no_xml + ".jpg")
image_file = [_file for _file in os.listdir(imgFolderPath) if os.path.splitext(_file)[0]==annotation_no_xml and _file!=file][0]

imagePath = os.path.join(imgFolderPath, image_file)

print("Image path:", imagePath)

Expand Down
4 changes: 3 additions & 1 deletion yolo2pascal/yolo2voc.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
print("Convert", file)

annotation_no_txt = os.path.splitext(file)[0]

image_file = [_file for _file in os.listdir(imgFolderPath) if os.path.splitext(_file)[0]==annotation_no_txt and _file!=file][0]

imagePath = os.path.join(imgFolderPath, annotation_no_txt + ".jpg")
imagePath = os.path.join(imgFolderPath, image_file)

print("Load this image:", imagePath)

Expand Down