Merge remote-tracking branch 'origin/feature/redesigned_annotators' into feature/redesigned_annotators

This commit is contained in:
SkalskiP 2023-09-28 18:08:45 +02:00
commit 28d279bec3
2 changed files with 3 additions and 20 deletions

View File

@ -6,18 +6,6 @@ try:
except importlib_metadata.PackageNotFoundError:
__version__ = "development"
from supervision.annotators.composable import DetectionAnnotator, SegmentationAnnotator
from supervision.annotators.core import (
BoundingBoxAnnotator,
BoxCornerAnnotator,
EllipseAnnotator,
LabelAdvancedAnnotator,
LabelAnnotator,
MaskAnnotator,
TraceAnnotator,
build_label_formatter,
)
from supervision.classification.core import Classifications
from supervision.dataset.core import (
BaseDataset,

View File

@ -291,22 +291,17 @@ class BoxCornerAnnotator(BaseAnnotator):
color_map=self.color_map,
)
color = resolve_color(color=self.color, idx=idx)
corners = [
(x1, y1), (x2, y1),
(x1, y2), (x2, y2)
]
corners = [(x1, y1), (x2, y1), (x1, y2), (x2, y2)]
for x, y in corners:
x_end = x + self.corner_length if x == x1 else x - self.corner_length
cv2.line(
scene, (x, y), (x_end, y),
color.as_bgr(), thickness=self.thickness
scene, (x, y), (x_end, y), color.as_bgr(), thickness=self.thickness
)
y_end = y + self.corner_length if y == y1 else y - self.corner_length
cv2.line(
scene, (x, y), (x, y_end),
color.as_bgr(), thickness=self.thickness
scene, (x, y), (x, y_end), color.as_bgr(), thickness=self.thickness
)
return scene