From 3789862a6f2eb6b805b58f412ee4af9ee1c3848b Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Sun, 19 Feb 2023 07:37:29 -0600 Subject: [PATCH] mark unused params, fix shared lists --- api/onnx_web/image.py | 6 +++--- api/onnx_web/server/context.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/api/onnx_web/image.py b/api/onnx_web/image.py index e4540f03..37ffd13a 100644 --- a/api/onnx_web/image.py +++ b/api/onnx_web/image.py @@ -67,7 +67,7 @@ def noise_source_fill_edge( def noise_source_fill_mask( - source: Image.Image, dims: Point, origin: Point, fill="white", **kw + _source: Image.Image, dims: Point, origin: Point, fill="white", **kw ) -> Image.Image: """ Fill the whole canvas, no source or noise. @@ -95,7 +95,7 @@ def noise_source_gaussian( def noise_source_uniform( - source: Image.Image, dims: Point, origin: Point, **kw + _source: Image.Image, dims: Point, origin: Point, **kw ) -> Image.Image: width, height = dims size = width * height @@ -115,7 +115,7 @@ def noise_source_uniform( def noise_source_normal( - source: Image.Image, dims: Point, origin: Point, **kw + _source: Image.Image, dims: Point, origin: Point, **kw ) -> Image.Image: width, height = dims size = width * height diff --git a/api/onnx_web/server/context.py b/api/onnx_web/server/context.py index a3e60f78..4e1f7960 100644 --- a/api/onnx_web/server/context.py +++ b/api/onnx_web/server/context.py @@ -18,13 +18,13 @@ class ServerContext: cors_origin: str = "*", num_workers: int = 1, any_platform: bool = True, - block_platforms: List[str] = [], + block_platforms: List[str] = None, default_platform: str = None, image_format: str = "png", cache: ModelCache = None, cache_path: str = None, show_progress: bool = True, - optimizations: List[str] = [], + optimizations: List[str] = None, ) -> None: self.bundle_path = bundle_path self.model_path = model_path @@ -33,13 +33,13 @@ class ServerContext: self.cors_origin = cors_origin self.num_workers = num_workers self.any_platform = any_platform - self.block_platforms = block_platforms + self.block_platforms = block_platforms or [] self.default_platform = default_platform self.image_format = image_format self.cache = cache or ModelCache(num_workers) self.cache_path = cache_path or path.join(model_path, ".cache") self.show_progress = show_progress - self.optimizations = optimizations + self.optimizations = optimizations or [] @classmethod def from_environ(cls):