Skip to content

Commit

Permalink
Merge branch 'main' of github.com:stefanklut/laypa into main
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanklut committed Dec 4, 2023
2 parents 79ffb3e + e62adcf commit 2b44f6c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion configs/segmentation/baseline/baseline_ovdr2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ PREPROCESS:
INPUT:
RESIZE_MODE: "shortest_edge"
MIN_SIZE_TRAIN_SAMPLING: choice
MIN_SIZE_TRAIN: (896, 960, 1024, 1088, 1152)
MIN_SIZE_TRAIN: (1024,)
MAX_SIZE_TRAIN: 2024

MAX_SIZE_TEST: 2024
Expand Down
2 changes: 1 addition & 1 deletion configs/segmentation/baseline/baseline_ovdr3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ PREPROCESS:
INPUT:
RESIZE_MODE: "shortest_edge"
MIN_SIZE_TRAIN_SAMPLING: choice
MIN_SIZE_TRAIN: (896, 960, 1024, 1088, 1152)
MIN_SIZE_TRAIN: (1024,)
MAX_SIZE_TRAIN: 2024

MAX_SIZE_TEST: 2024
Expand Down
2 changes: 1 addition & 1 deletion configs/segmentation/segmentation_base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ PREPROCESS:
INPUT:
RESIZE_MODE: "shortest_edge"
MIN_SIZE_TRAIN_SAMPLING: choice
MIN_SIZE_TRAIN: (896, 960, 1024, 1088, 1152)
MIN_SIZE_TRAIN: (1024,)
MAX_SIZE_TRAIN: 2048
SCALING_TRAIN: 0.5

Expand Down
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 2b44f6c

Please sign in to comment.