refactor: ♻️ update Edges type from List to Tuple for better performance

Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
This commit is contained in:
Onuralp SEZER 2024-09-19 20:30:43 +03:00
parent 1f0c278c4e
commit a34f0e9597
No known key found for this signature in database
GPG Key ID: CF0835DFDF14CA38
1 changed files with 10 additions and 10 deletions

View File

@ -1,11 +1,11 @@
from enum import Enum
from typing import ClassVar, Dict, List, Tuple
from typing import Dict, Tuple
Edges = List[Tuple[int, int]]
Edges = Tuple[Tuple[int, int], ...]
class Skeleton(Enum):
COCO: ClassVar[List[Tuple[int, int]]] = [
COCO: Edges = (
(1, 2),
(1, 3),
(2, 3),
@ -23,9 +23,9 @@ class Skeleton(Enum):
(15, 13),
(16, 14),
(17, 15),
]
)
GHUM: ClassVar[List[Tuple[int, int]]] = [
GHUM: Edges = (
(1, 2),
(1, 5),
(2, 3),
@ -61,9 +61,9 @@ class Skeleton(Enum):
(29, 33),
(30, 32),
(31, 33),
]
)
FACEMESH_TESSELATION_NO_IRIS: ClassVar[List[Tuple[int, int]]] = [
FACEMESH_TESSELATION_NO_IRIS: Edges = (
(128, 35),
(35, 140),
(140, 128),
@ -2620,9 +2620,9 @@ class Skeleton(Enum):
(340, 449),
(449, 256),
(256, 340),
]
)
FACEMESH_TESSELATION: ClassVar[List[Tuple[int, int]]] = [
FACEMESH_TESSELATION: Edges = (
(474, 474),
(475, 476),
(476, 477),
@ -2634,7 +2634,7 @@ class Skeleton(Enum):
(472, 473),
(473, 470),
*FACEMESH_TESSELATION_NO_IRIS,
]
)
SKELETONS_BY_EDGE_COUNT: Dict[int, Edges] = {}