Skip to content

Commit

Permalink
Fixed relative paths in darknet_images.py (AlexeyAB#7566)
Browse files Browse the repository at this point in the history
  • Loading branch information
juantoca authored Apr 25, 2021
1 parent 5c92722 commit 98fa47c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion darknet_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def save_annotations(name, image, detections, class_names):
"""
Files saved with image_name.txt and relative coordinates
"""
file_name = name.split(".")[:-1][0] + ".txt"
file_name = os.path.splitext(name)[0] + ".txt"
with open(file_name, "w") as f:
for label, confidence, bbox in detections:
x, y, w, h = convert2relative(image, bbox)
Expand Down

0 comments on commit 98fa47c

Please sign in to comment.