From 5f86dbe29bcc3e67b51dbcddd17bcd2fbd44d824 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 25 Sep 2024 19:23:16 +0000 Subject: [PATCH] =?UTF-8?q?fix(pre=5Fcommit):=20=F0=9F=8E=A8=20auto=20form?= =?UTF-8?q?at=20pre-commit=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supervision/detection/line_zone.py | 2 +- supervision/draw/color.py | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/supervision/detection/line_zone.py b/supervision/detection/line_zone.py index aaa8eec6..870eee07 100644 --- a/supervision/detection/line_zone.py +++ b/supervision/detection/line_zone.py @@ -1,6 +1,6 @@ -from functools import lru_cache import math import warnings +from functools import lru_cache from typing import Any, Dict, Iterable, Tuple import cv2 diff --git a/supervision/draw/color.py b/supervision/draw/color.py index 4422bcb8..b101e0f7 100644 --- a/supervision/draw/color.py +++ b/supervision/draw/color.py @@ -254,12 +254,17 @@ class Color: @classproperty def ROBOFLOW(cls) -> Color: return Color.from_hex("#A351FB") - + def __hash__(self): return hash((self.r, self.g, self.b)) - + def __eq__(self, other): - return isinstance(other, Color) and self.r == other.r and self.g == other.g and self.b == other.b + return ( + isinstance(other, Color) + and self.r == other.r + and self.g == other.g + and self.b == other.b + ) @dataclass