change --gui_size to --gui-size; use nargs for crop-trigger-size
This commit is contained in:
parent
c5223008d5
commit
1c997991e4
8
main.py
8
main.py
@ -102,7 +102,7 @@ def get_args_parser():
|
|||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("--port", default=8080, type=int)
|
parser.add_argument("--port", default=8080, type=int)
|
||||||
parser.add_argument("--model", default="lama", choices=["lama", "ldm"])
|
parser.add_argument("--model", default="lama", choices=["lama", "ldm"])
|
||||||
parser.add_argument("--crop-trigger-size", default="2042,2042",
|
parser.add_argument("--crop-trigger-size", nargs=2, type=int,
|
||||||
help="If image size large then crop-trigger-size, "
|
help="If image size large then crop-trigger-size, "
|
||||||
"crop each area from original image to do inference."
|
"crop each area from original image to do inference."
|
||||||
"Mainly for performance and memory reasons"
|
"Mainly for performance and memory reasons"
|
||||||
@ -119,7 +119,7 @@ def get_args_parser():
|
|||||||
parser.add_argument("--device", default="cuda", type=str)
|
parser.add_argument("--device", default="cuda", type=str)
|
||||||
parser.add_argument("--gui", action="store_true",
|
parser.add_argument("--gui", action="store_true",
|
||||||
help="Launch as desktop app")
|
help="Launch as desktop app")
|
||||||
parser.add_argument("--gui_size", default=[1600, 1000], nargs=2, type=int,
|
parser.add_argument("--gui-size", default=[1600, 1000], nargs=2, type=int,
|
||||||
help="Set window size for GUI")
|
help="Set window size for GUI")
|
||||||
parser.add_argument("--debug", action="store_true")
|
parser.add_argument("--debug", action="store_true")
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
@ -131,10 +131,8 @@ def main():
|
|||||||
args = get_args_parser()
|
args = get_args_parser()
|
||||||
device = torch.device(args.device)
|
device = torch.device(args.device)
|
||||||
|
|
||||||
crop_trigger_size = [int(it) for it in args.crop_trigger_size.split(",")]
|
|
||||||
|
|
||||||
if args.model == "lama":
|
if args.model == "lama":
|
||||||
model = LaMa(crop_trigger_size=crop_trigger_size, crop_margin=args.crop_margin, device=device)
|
model = LaMa(crop_trigger_size=args.crop_trigger_size, crop_margin=args.crop_margin, device=device)
|
||||||
elif args.model == "ldm":
|
elif args.model == "ldm":
|
||||||
model = LDM(device, steps=args.ldm_steps)
|
model = LDM(device, steps=args.ldm_steps)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user