eye-cv 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- eye/__init__.py +115 -0
- eye/__init___supervision_original.py +120 -0
- eye/annotators/__init__.py +0 -0
- eye/annotators/base.py +22 -0
- eye/annotators/core.py +2699 -0
- eye/annotators/line.py +107 -0
- eye/annotators/modern.py +529 -0
- eye/annotators/trace.py +142 -0
- eye/annotators/utils.py +177 -0
- eye/assets/__init__.py +2 -0
- eye/assets/downloader.py +95 -0
- eye/assets/list.py +83 -0
- eye/classification/__init__.py +0 -0
- eye/classification/core.py +188 -0
- eye/config.py +2 -0
- eye/core/__init__.py +0 -0
- eye/core/trackers/__init__.py +1 -0
- eye/core/trackers/botsort_tracker.py +336 -0
- eye/core/trackers/bytetrack_tracker.py +284 -0
- eye/core/trackers/sort_tracker.py +200 -0
- eye/core/tracking.py +146 -0
- eye/dataset/__init__.py +0 -0
- eye/dataset/core.py +919 -0
- eye/dataset/formats/__init__.py +0 -0
- eye/dataset/formats/coco.py +258 -0
- eye/dataset/formats/pascal_voc.py +279 -0
- eye/dataset/formats/yolo.py +272 -0
- eye/dataset/utils.py +259 -0
- eye/detection/__init__.py +0 -0
- eye/detection/auto_convert.py +155 -0
- eye/detection/core.py +1529 -0
- eye/detection/detections_enhanced.py +392 -0
- eye/detection/line_zone.py +859 -0
- eye/detection/lmm.py +184 -0
- eye/detection/overlap_filter.py +270 -0
- eye/detection/tools/__init__.py +0 -0
- eye/detection/tools/csv_sink.py +181 -0
- eye/detection/tools/inference_slicer.py +288 -0
- eye/detection/tools/json_sink.py +142 -0
- eye/detection/tools/polygon_zone.py +202 -0
- eye/detection/tools/smoother.py +123 -0
- eye/detection/tools/smoothing.py +179 -0
- eye/detection/tools/smoothing_config.py +202 -0
- eye/detection/tools/transformers.py +247 -0
- eye/detection/utils.py +1175 -0
- eye/draw/__init__.py +0 -0
- eye/draw/color.py +154 -0
- eye/draw/utils.py +374 -0
- eye/filters.py +112 -0
- eye/geometry/__init__.py +0 -0
- eye/geometry/core.py +128 -0
- eye/geometry/utils.py +47 -0
- eye/keypoint/__init__.py +0 -0
- eye/keypoint/annotators.py +442 -0
- eye/keypoint/core.py +687 -0
- eye/keypoint/skeletons.py +2647 -0
- eye/metrics/__init__.py +21 -0
- eye/metrics/core.py +72 -0
- eye/metrics/detection.py +843 -0
- eye/metrics/f1_score.py +648 -0
- eye/metrics/mean_average_precision.py +628 -0
- eye/metrics/mean_average_recall.py +697 -0
- eye/metrics/precision.py +653 -0
- eye/metrics/recall.py +652 -0
- eye/metrics/utils/__init__.py +0 -0
- eye/metrics/utils/object_size.py +158 -0
- eye/metrics/utils/utils.py +9 -0
- eye/py.typed +0 -0
- eye/quick.py +104 -0
- eye/tracker/__init__.py +0 -0
- eye/tracker/byte_tracker/__init__.py +0 -0
- eye/tracker/byte_tracker/core.py +386 -0
- eye/tracker/byte_tracker/kalman_filter.py +205 -0
- eye/tracker/byte_tracker/matching.py +69 -0
- eye/tracker/byte_tracker/single_object_track.py +178 -0
- eye/tracker/byte_tracker/utils.py +18 -0
- eye/utils/__init__.py +0 -0
- eye/utils/conversion.py +132 -0
- eye/utils/file.py +159 -0
- eye/utils/image.py +794 -0
- eye/utils/internal.py +200 -0
- eye/utils/iterables.py +84 -0
- eye/utils/notebook.py +114 -0
- eye/utils/video.py +307 -0
- eye/utils_eye/__init__.py +1 -0
- eye/utils_eye/geometry.py +71 -0
- eye/utils_eye/nms.py +55 -0
- eye/validators/__init__.py +140 -0
- eye/web.py +271 -0
- eye_cv-1.0.0.dist-info/METADATA +319 -0
- eye_cv-1.0.0.dist-info/RECORD +94 -0
- eye_cv-1.0.0.dist-info/WHEEL +5 -0
- eye_cv-1.0.0.dist-info/licenses/LICENSE +21 -0
- eye_cv-1.0.0.dist-info/top_level.txt +1 -0
eye/metrics/__init__.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from eye.metrics.core import (
|
|
2
|
+
AveragingMethod,
|
|
3
|
+
Metric,
|
|
4
|
+
MetricTarget,
|
|
5
|
+
)
|
|
6
|
+
from eye.metrics.f1_score import F1Score, F1ScoreResult
|
|
7
|
+
from eye.metrics.mean_average_precision import (
|
|
8
|
+
MeanAveragePrecision,
|
|
9
|
+
MeanAveragePrecisionResult,
|
|
10
|
+
)
|
|
11
|
+
from eye.metrics.mean_average_recall import (
|
|
12
|
+
MeanAverageRecall,
|
|
13
|
+
MeanAverageRecallResult,
|
|
14
|
+
)
|
|
15
|
+
from eye.metrics.precision import Precision, PrecisionResult
|
|
16
|
+
from eye.metrics.recall import Recall, RecallResult
|
|
17
|
+
from eye.metrics.utils.object_size import (
|
|
18
|
+
ObjectSizeCategory,
|
|
19
|
+
get_detection_size_category,
|
|
20
|
+
get_object_size_category,
|
|
21
|
+
)
|
eye/metrics/core.py
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from abc import ABC, abstractmethod
|
|
4
|
+
from enum import Enum
|
|
5
|
+
from typing import Any
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Metric(ABC):
|
|
9
|
+
"""
|
|
10
|
+
The base class for all eye metrics.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
@abstractmethod
|
|
14
|
+
def update(self, *args, **kwargs) -> "Metric":
|
|
15
|
+
"""
|
|
16
|
+
Add data to the metric, without computing the result.
|
|
17
|
+
Return the metric itself to allow method chaining.
|
|
18
|
+
"""
|
|
19
|
+
raise NotImplementedError
|
|
20
|
+
|
|
21
|
+
@abstractmethod
|
|
22
|
+
def reset(self) -> None:
|
|
23
|
+
"""
|
|
24
|
+
Reset internal metric state.
|
|
25
|
+
"""
|
|
26
|
+
raise NotImplementedError
|
|
27
|
+
|
|
28
|
+
@abstractmethod
|
|
29
|
+
def compute(self, *args, **kwargs) -> Any:
|
|
30
|
+
"""
|
|
31
|
+
Compute the metric from the internal state and return the result.
|
|
32
|
+
"""
|
|
33
|
+
raise NotImplementedError
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class MetricTarget(Enum):
|
|
37
|
+
"""
|
|
38
|
+
Specifies what type of detection is used to compute the metric.
|
|
39
|
+
|
|
40
|
+
Attributes:
|
|
41
|
+
BOXES: xyxy bounding boxes
|
|
42
|
+
MASKS: Binary masks
|
|
43
|
+
ORIENTED_BOUNDING_BOXES: Oriented bounding boxes (OBB)
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
BOXES = "boxes"
|
|
47
|
+
MASKS = "masks"
|
|
48
|
+
ORIENTED_BOUNDING_BOXES = "obb"
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class AveragingMethod(Enum):
|
|
52
|
+
"""
|
|
53
|
+
Defines different ways of averaging the metric results.
|
|
54
|
+
|
|
55
|
+
Suppose, before returning the final result, a metric is computed for each class.
|
|
56
|
+
How do you combine those to get the final number?
|
|
57
|
+
|
|
58
|
+
Attributes:
|
|
59
|
+
MACRO: Calculate the metric for each class and average the results. The simplest
|
|
60
|
+
averaging method, but it does not take class imbalance into account.
|
|
61
|
+
MICRO: Calculate the metric globally by counting the total true positives, false
|
|
62
|
+
positives, and false negatives. Micro averaging is useful when you want to
|
|
63
|
+
give more importance to classes with more samples. It's also more
|
|
64
|
+
appropriate if you have an imbalance in the number of instances per class.
|
|
65
|
+
WEIGHTED: Calculate the metric for each class and average the results, weighted
|
|
66
|
+
by the number of true instances of each class. Use weighted averaging if
|
|
67
|
+
you want to take class imbalance into account.
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
MACRO = "macro"
|
|
71
|
+
MICRO = "micro"
|
|
72
|
+
WEIGHTED = "weighted"
|