mirror of
https://git.mirrors.martin98.com/https://github.com/danielgatis/rembg
synced 2025-08-16 15:55:56 +08:00
fix docker
This commit is contained in:
parent
c0b08f831b
commit
ccaa9005af
@ -28,6 +28,11 @@ class BaseSession:
|
||||
else:
|
||||
self.providers.extend(_providers)
|
||||
|
||||
model_path = kwargs.get("model_path")
|
||||
|
||||
if model_path is None:
|
||||
raise ValueError("model_path is required")
|
||||
|
||||
self.inner_session = ort.InferenceSession(
|
||||
str(self.__class__.download_models(*args, **kwargs)),
|
||||
providers=self.providers,
|
||||
|
@ -34,9 +34,8 @@ class U2netCustomSession(BaseSession):
|
||||
@classmethod
|
||||
def download_models(cls, *args, **kwargs):
|
||||
model_path = kwargs.get("model_path")
|
||||
|
||||
if model_path is None:
|
||||
raise ValueError("model_path is required")
|
||||
return
|
||||
|
||||
return os.path.abspath(os.path.expanduser(model_path))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user