From f2353d09e2f1c7cdd8efeefe0244ac81fb72beab Mon Sep 17 00:00:00 2001 From: Daniel Gatis Date: Thu, 27 Apr 2023 20:01:37 -0300 Subject: [PATCH] fix #434 --- rembg/commands/s_command.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/rembg/commands/s_command.py b/rembg/commands/s_command.py index 04d4b37..c04a0c4 100644 --- a/rembg/commands/s_command.py +++ b/rembg/commands/s_command.py @@ -1,5 +1,5 @@ import json -from typing import Annotated, Optional, Tuple, cast +from typing import Optional, Tuple, cast import aiohttp import click @@ -83,10 +83,10 @@ def s_command(port: int, log_level: str, threads: int) -> None: class CommonQueryParams: def __init__( self, - model: Annotated[ - str, Query(regex=r"(" + "|".join(sessions_names) + ")") - ] = Query( + model: str = Query( description="Model to use when processing image", + regex=r"(" + "|".join(sessions_names) + ")", + default="u2net", ), a: bool = Query(default=False, description="Enable Alpha Matting"), af: int = Query( @@ -128,10 +128,10 @@ def s_command(port: int, log_level: str, threads: int) -> None: class CommonQueryPostParams: def __init__( self, - model: Annotated[ - str, Form(regex=r"(" + "|".join(sessions_names) + ")") - ] = Form( + model: str = Form( description="Model to use when processing image", + regex=r"(" + "|".join(sessions_names) + ")", + default="u2net", ), a: bool = Form(default=False, description="Enable Alpha Matting"), af: int = Form(