From 191281c78f8cf9a8d87d1ef4fa47faf99cd67e2d Mon Sep 17 00:00:00 2001 From: Joey Ballentine <34788790+joeyballentine@users.noreply.github.com> Date: Fri, 29 Apr 2022 21:26:53 -0400 Subject: [PATCH] Various small fixes (#92) * Fix color correction node to support 1x scale * remove % from sat * remove websockets from requirements.txt --- backend/nodes/image_nodes.py | 13 ++++++++----- requirements.txt | 3 +-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/backend/nodes/image_nodes.py b/backend/nodes/image_nodes.py index f863c6b38..7823f4ea0 100644 --- a/backend/nodes/image_nodes.py +++ b/backend/nodes/image_nodes.py @@ -1,14 +1,17 @@ from __future__ import annotations + import math import os import platform import subprocess import time from tempfile import mkdtemp +from typing import Tuple + import cv2 import numpy as np from sanic.log import logger -from typing import Tuple + from .node_base import NodeBase from .node_factory import NodeFactory from .properties.inputs import * @@ -16,8 +19,8 @@ from .utils.image_utils import ( get_opencv_formats, get_pil_formats, - normalize_normals, normalize, + normalize_normals, with_background, ) @@ -695,7 +698,7 @@ def __init__(self): self.inputs = [ ImageInput(), SliderInput("Hue", -180, 180, 0), - SliderInput("Saturation (%)", -255, 255, 0), + SliderInput("Saturation", -255, 255, 0), ] self.outputs = [ImageOutput()] self.icon = "MdOutlineColorLens" @@ -1449,8 +1452,8 @@ def run( ref_h, ref_w = ref_img.shape[:2] assert ( - ref_w < input_w and ref_h < input_h - ), "Image must be larger than Reference Image" + ref_w <= input_w and ref_h <= input_h + ), "Image must be the same size or larger than Reference Image" # Find the diff of both images diff --git a/requirements.txt b/requirements.txt index fce98a7d5..c35910d4c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,5 +5,4 @@ opencv-python Pillow pylint sanic -sanic_cors -websockets==9.1 +sanic_cors \ No newline at end of file