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.
Files changed (94) hide show
  1. eye/__init__.py +115 -0
  2. eye/__init___supervision_original.py +120 -0
  3. eye/annotators/__init__.py +0 -0
  4. eye/annotators/base.py +22 -0
  5. eye/annotators/core.py +2699 -0
  6. eye/annotators/line.py +107 -0
  7. eye/annotators/modern.py +529 -0
  8. eye/annotators/trace.py +142 -0
  9. eye/annotators/utils.py +177 -0
  10. eye/assets/__init__.py +2 -0
  11. eye/assets/downloader.py +95 -0
  12. eye/assets/list.py +83 -0
  13. eye/classification/__init__.py +0 -0
  14. eye/classification/core.py +188 -0
  15. eye/config.py +2 -0
  16. eye/core/__init__.py +0 -0
  17. eye/core/trackers/__init__.py +1 -0
  18. eye/core/trackers/botsort_tracker.py +336 -0
  19. eye/core/trackers/bytetrack_tracker.py +284 -0
  20. eye/core/trackers/sort_tracker.py +200 -0
  21. eye/core/tracking.py +146 -0
  22. eye/dataset/__init__.py +0 -0
  23. eye/dataset/core.py +919 -0
  24. eye/dataset/formats/__init__.py +0 -0
  25. eye/dataset/formats/coco.py +258 -0
  26. eye/dataset/formats/pascal_voc.py +279 -0
  27. eye/dataset/formats/yolo.py +272 -0
  28. eye/dataset/utils.py +259 -0
  29. eye/detection/__init__.py +0 -0
  30. eye/detection/auto_convert.py +155 -0
  31. eye/detection/core.py +1529 -0
  32. eye/detection/detections_enhanced.py +392 -0
  33. eye/detection/line_zone.py +859 -0
  34. eye/detection/lmm.py +184 -0
  35. eye/detection/overlap_filter.py +270 -0
  36. eye/detection/tools/__init__.py +0 -0
  37. eye/detection/tools/csv_sink.py +181 -0
  38. eye/detection/tools/inference_slicer.py +288 -0
  39. eye/detection/tools/json_sink.py +142 -0
  40. eye/detection/tools/polygon_zone.py +202 -0
  41. eye/detection/tools/smoother.py +123 -0
  42. eye/detection/tools/smoothing.py +179 -0
  43. eye/detection/tools/smoothing_config.py +202 -0
  44. eye/detection/tools/transformers.py +247 -0
  45. eye/detection/utils.py +1175 -0
  46. eye/draw/__init__.py +0 -0
  47. eye/draw/color.py +154 -0
  48. eye/draw/utils.py +374 -0
  49. eye/filters.py +112 -0
  50. eye/geometry/__init__.py +0 -0
  51. eye/geometry/core.py +128 -0
  52. eye/geometry/utils.py +47 -0
  53. eye/keypoint/__init__.py +0 -0
  54. eye/keypoint/annotators.py +442 -0
  55. eye/keypoint/core.py +687 -0
  56. eye/keypoint/skeletons.py +2647 -0
  57. eye/metrics/__init__.py +21 -0
  58. eye/metrics/core.py +72 -0
  59. eye/metrics/detection.py +843 -0
  60. eye/metrics/f1_score.py +648 -0
  61. eye/metrics/mean_average_precision.py +628 -0
  62. eye/metrics/mean_average_recall.py +697 -0
  63. eye/metrics/precision.py +653 -0
  64. eye/metrics/recall.py +652 -0
  65. eye/metrics/utils/__init__.py +0 -0
  66. eye/metrics/utils/object_size.py +158 -0
  67. eye/metrics/utils/utils.py +9 -0
  68. eye/py.typed +0 -0
  69. eye/quick.py +104 -0
  70. eye/tracker/__init__.py +0 -0
  71. eye/tracker/byte_tracker/__init__.py +0 -0
  72. eye/tracker/byte_tracker/core.py +386 -0
  73. eye/tracker/byte_tracker/kalman_filter.py +205 -0
  74. eye/tracker/byte_tracker/matching.py +69 -0
  75. eye/tracker/byte_tracker/single_object_track.py +178 -0
  76. eye/tracker/byte_tracker/utils.py +18 -0
  77. eye/utils/__init__.py +0 -0
  78. eye/utils/conversion.py +132 -0
  79. eye/utils/file.py +159 -0
  80. eye/utils/image.py +794 -0
  81. eye/utils/internal.py +200 -0
  82. eye/utils/iterables.py +84 -0
  83. eye/utils/notebook.py +114 -0
  84. eye/utils/video.py +307 -0
  85. eye/utils_eye/__init__.py +1 -0
  86. eye/utils_eye/geometry.py +71 -0
  87. eye/utils_eye/nms.py +55 -0
  88. eye/validators/__init__.py +140 -0
  89. eye/web.py +271 -0
  90. eye_cv-1.0.0.dist-info/METADATA +319 -0
  91. eye_cv-1.0.0.dist-info/RECORD +94 -0
  92. eye_cv-1.0.0.dist-info/WHEEL +5 -0
  93. eye_cv-1.0.0.dist-info/licenses/LICENSE +21 -0
  94. eye_cv-1.0.0.dist-info/top_level.txt +1 -0
@@ -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"