mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-23 21:11:08 +00:00
Remove a slash in path to save the file correctly on Linux (#8053)
This commit is contained in:
parent
7021afda04
commit
7618a92fee
|
@ -32,13 +32,13 @@ def main() -> None:
|
||||||
letter_code = random_chars(32)
|
letter_code = random_chars(32)
|
||||||
file_name = paths[index].split(os.sep)[-1].rsplit(".", 1)[0]
|
file_name = paths[index].split(os.sep)[-1].rsplit(".", 1)[0]
|
||||||
file_root = f"{OUTPUT_DIR}/{file_name}_FLIP_{letter_code}"
|
file_root = f"{OUTPUT_DIR}/{file_name}_FLIP_{letter_code}"
|
||||||
cv2.imwrite(f"/{file_root}.jpg", image, [cv2.IMWRITE_JPEG_QUALITY, 85])
|
cv2.imwrite(f"{file_root}.jpg", image, [cv2.IMWRITE_JPEG_QUALITY, 85])
|
||||||
print(f"Success {index+1}/{len(new_images)} with {file_name}")
|
print(f"Success {index+1}/{len(new_images)} with {file_name}")
|
||||||
annos_list = []
|
annos_list = []
|
||||||
for anno in new_annos[index]:
|
for anno in new_annos[index]:
|
||||||
obj = f"{anno[0]} {anno[1]} {anno[2]} {anno[3]} {anno[4]}"
|
obj = f"{anno[0]} {anno[1]} {anno[2]} {anno[3]} {anno[4]}"
|
||||||
annos_list.append(obj)
|
annos_list.append(obj)
|
||||||
with open(f"/{file_root}.txt", "w") as outfile:
|
with open(f"{file_root}.txt", "w") as outfile:
|
||||||
outfile.write("\n".join(line for line in annos_list))
|
outfile.write("\n".join(line for line in annos_list))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user