Skip to content

Commit

Permalink
Incorrect saving
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanklut committed Dec 4, 2023
1 parent 1b7c3db commit e62adcf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def get_arguments() -> argparse.Namespace:
# io_args.add_argument("-t", "--train", help="Train input folder/file",
# nargs="+", action="extend", type=str, default=None)
io_args.add_argument("-i", "--input", help="Input folder/file", nargs="+", action="extend", type=str, default=None)
io_args.add_argument("-o", "--output", help="Output folder", type=str, required=True)
io_args.add_argument("-o", "--output", help="Output folder", type=str)

tmp_args = parser.add_argument_group("tmp files")
tmp_args.add_argument("--tmp_dir", help="Temp files folder", type=str, default=None)
Expand Down
4 changes: 1 addition & 3 deletions utils/image_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,10 @@ def save_image_array_to_path(
Args:
image_path (Path | str): save path location
array (np.ndarray): image in array form (BGR between 0 and 255)
array (np.ndarray): image in array form (RGB between 0 and 255)
"""
try:
# cv2.imwrite(str(image_path), array)
if len(array.shape) == 3:
array = cv2.cvtColor(array.astype(np.uint8), cv2.COLOR_BGR2RGB)
image = Image.fromarray(array)
image.save(image_path)
except OSError:
Expand Down

0 comments on commit e62adcf

Please sign in to comment.