Skip to content

Commit 7618a92

Browse files
authored
Remove a slash in path to save the file correctly on Linux (TheAlgorithms#8053)
1 parent 7021afd commit 7618a92

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

computer_vision/flip_augmentation.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ def main() -> None:
3232
letter_code = random_chars(32)
3333
file_name = paths[index].split(os.sep)[-1].rsplit(".", 1)[0]
3434
file_root = f"{OUTPUT_DIR}/{file_name}_FLIP_{letter_code}"
35-
cv2.imwrite(f"/{file_root}.jpg", image, [cv2.IMWRITE_JPEG_QUALITY, 85])
35+
cv2.imwrite(f"{file_root}.jpg", image, [cv2.IMWRITE_JPEG_QUALITY, 85])
3636
print(f"Success {index+1}/{len(new_images)} with {file_name}")
3737
annos_list = []
3838
for anno in new_annos[index]:
3939
obj = f"{anno[0]} {anno[1]} {anno[2]} {anno[3]} {anno[4]}"
4040
annos_list.append(obj)
41-
with open(f"/{file_root}.txt", "w") as outfile:
41+
with open(f"{file_root}.txt", "w") as outfile:
4242
outfile.write("\n".join(line for line in annos_list))
4343

4444

0 commit comments

Comments
 (0)