edgefirst-validator 4.2.1__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.
- deepview/modelpack/utils/argmax.py +16 -0
- edgefirst/validator/__init__.py +1 -0
- edgefirst/validator/__main__.py +375 -0
- edgefirst/validator/datasets/__init__.py +118 -0
- edgefirst/validator/datasets/cache.py +296 -0
- edgefirst/validator/datasets/core.py +250 -0
- edgefirst/validator/datasets/darknet.py +446 -0
- edgefirst/validator/datasets/database.py +1067 -0
- edgefirst/validator/datasets/instance/__init__.py +4 -0
- edgefirst/validator/datasets/instance/core.py +222 -0
- edgefirst/validator/datasets/instance/detection.py +145 -0
- edgefirst/validator/datasets/instance/multitask.py +80 -0
- edgefirst/validator/datasets/instance/segmentation.py +120 -0
- edgefirst/validator/datasets/utils/fetch.py +682 -0
- edgefirst/validator/datasets/utils/readers.py +425 -0
- edgefirst/validator/datasets/utils/transformations.py +1695 -0
- edgefirst/validator/evaluators/__init__.py +17 -0
- edgefirst/validator/evaluators/callbacks/__init__.py +3 -0
- edgefirst/validator/evaluators/callbacks/core.py +192 -0
- edgefirst/validator/evaluators/callbacks/plots.py +900 -0
- edgefirst/validator/evaluators/callbacks/studio.py +234 -0
- edgefirst/validator/evaluators/core.py +257 -0
- edgefirst/validator/evaluators/detection.py +749 -0
- edgefirst/validator/evaluators/multitask.py +270 -0
- edgefirst/validator/evaluators/parameters/__init__.py +53 -0
- edgefirst/validator/evaluators/parameters/core.py +554 -0
- edgefirst/validator/evaluators/parameters/dataset.py +239 -0
- edgefirst/validator/evaluators/parameters/model.py +338 -0
- edgefirst/validator/evaluators/parameters/validation.py +528 -0
- edgefirst/validator/evaluators/segmentation.py +729 -0
- edgefirst/validator/evaluators/utils/__init__.py +3 -0
- edgefirst/validator/evaluators/utils/classify.py +292 -0
- edgefirst/validator/evaluators/utils/match.py +262 -0
- edgefirst/validator/evaluators/utils/timer.py +132 -0
- edgefirst/validator/metrics/__init__.py +9 -0
- edgefirst/validator/metrics/data/__init__.py +7 -0
- edgefirst/validator/metrics/data/label.py +668 -0
- edgefirst/validator/metrics/data/metrics.py +759 -0
- edgefirst/validator/metrics/data/plots.py +476 -0
- edgefirst/validator/metrics/data/stats.py +507 -0
- edgefirst/validator/metrics/detection.py +595 -0
- edgefirst/validator/metrics/segmentation.py +173 -0
- edgefirst/validator/metrics/utils/math.py +717 -0
- edgefirst/validator/publishers/__init__.py +3 -0
- edgefirst/validator/publishers/console.py +147 -0
- edgefirst/validator/publishers/studio.py +128 -0
- edgefirst/validator/publishers/tensorboard.py +119 -0
- edgefirst/validator/publishers/utils/logger.py +111 -0
- edgefirst/validator/publishers/utils/table.py +403 -0
- edgefirst/validator/runners/__init__.py +8 -0
- edgefirst/validator/runners/core.py +727 -0
- edgefirst/validator/runners/deepviewrt.py +177 -0
- edgefirst/validator/runners/hailo.py +263 -0
- edgefirst/validator/runners/keras.py +150 -0
- edgefirst/validator/runners/kinara.py +265 -0
- edgefirst/validator/runners/offline.py +228 -0
- edgefirst/validator/runners/onnx.py +241 -0
- edgefirst/validator/runners/processing/decode.py +320 -0
- edgefirst/validator/runners/processing/dvapi.py +4192 -0
- edgefirst/validator/runners/processing/nms.py +637 -0
- edgefirst/validator/runners/processing/outputs.py +507 -0
- edgefirst/validator/runners/tensorrt.py +321 -0
- edgefirst/validator/runners/tflite.py +221 -0
- edgefirst/validator/validate.py +843 -0
- edgefirst/validator/visualize/__init__.py +3 -0
- edgefirst/validator/visualize/detection.py +623 -0
- edgefirst/validator/visualize/segmentation.py +281 -0
- edgefirst/validator/visualize/utils/plots.py +635 -0
- edgefirst_validator-4.2.1.dist-info/METADATA +111 -0
- edgefirst_validator-4.2.1.dist-info/RECORD +73 -0
- edgefirst_validator-4.2.1.dist-info/WHEEL +5 -0
- edgefirst_validator-4.2.1.dist-info/entry_points.txt +2 -0
- edgefirst_validator-4.2.1.dist-info/top_level.txt +2 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from edgefirst.validator.evaluators.callbacks import (Callback, CallbacksList,
|
|
2
|
+
PlotsCallback,
|
|
3
|
+
StudioProgress)
|
|
4
|
+
from edgefirst.validator.evaluators.parameters import (Parameters,
|
|
5
|
+
CommonParameters,
|
|
6
|
+
CombinedParameters,
|
|
7
|
+
ModelParameters,
|
|
8
|
+
DatasetParameters,
|
|
9
|
+
ValidationParameters)
|
|
10
|
+
from edgefirst.validator.evaluators.utils import (Matcher, DetectionClassifier,
|
|
11
|
+
TimerContext)
|
|
12
|
+
from edgefirst.validator.evaluators.core import Evaluator
|
|
13
|
+
from edgefirst.validator.evaluators.detection import (YOLOValidator,
|
|
14
|
+
EdgeFirstValidator)
|
|
15
|
+
from edgefirst.validator.evaluators.segmentation import (YOLOSegmentationValidator,
|
|
16
|
+
SegmentationValidator)
|
|
17
|
+
from edgefirst.validator.evaluators.multitask import MultitaskValidator
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING, List
|
|
4
|
+
|
|
5
|
+
if TYPE_CHECKING:
|
|
6
|
+
from edgefirst.validator.publishers import StudioPublisher
|
|
7
|
+
from edgefirst.validator.evaluators import CombinedParameters
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Callback(object):
|
|
11
|
+
"""
|
|
12
|
+
A class to handle callback functions during validation.
|
|
13
|
+
Callbacks are used to communicate the progress of the stages
|
|
14
|
+
to EdgeFirst Studio.
|
|
15
|
+
|
|
16
|
+
Parameters
|
|
17
|
+
-----------
|
|
18
|
+
studio_publisher: StudioPublisher
|
|
19
|
+
Publishes metrics, timings, plots, and
|
|
20
|
+
progress to EdgeFirst Studio.
|
|
21
|
+
parameters: CombinedParameters
|
|
22
|
+
These are the model, dataset, and validation parameters
|
|
23
|
+
set from the command line.
|
|
24
|
+
stage: str
|
|
25
|
+
The current stage to update for the progress in Studio.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
def __init__(
|
|
29
|
+
self,
|
|
30
|
+
studio_publisher: StudioPublisher,
|
|
31
|
+
parameters: CombinedParameters,
|
|
32
|
+
stage: str = "validate"
|
|
33
|
+
):
|
|
34
|
+
self.studio_publisher = studio_publisher
|
|
35
|
+
self.parameters = parameters
|
|
36
|
+
self.message = 'Running Validation'
|
|
37
|
+
self.stage = stage
|
|
38
|
+
|
|
39
|
+
def on_test_begin(self, logs=None):
|
|
40
|
+
"""
|
|
41
|
+
Called at the beginning of the test.
|
|
42
|
+
|
|
43
|
+
Parameters
|
|
44
|
+
----------
|
|
45
|
+
logs: dict
|
|
46
|
+
A dictionary containing logs related to the test (default is None).
|
|
47
|
+
"""
|
|
48
|
+
return
|
|
49
|
+
|
|
50
|
+
def on_test_batch_begin(self, step: int, logs=None):
|
|
51
|
+
"""
|
|
52
|
+
Called at the beginning of each test batch.
|
|
53
|
+
|
|
54
|
+
Parameters
|
|
55
|
+
----------
|
|
56
|
+
step : int
|
|
57
|
+
The index of the current test batch.
|
|
58
|
+
logs : dict, optional
|
|
59
|
+
A dictionary containing logs related
|
|
60
|
+
to the test batch (default is None).
|
|
61
|
+
"""
|
|
62
|
+
return
|
|
63
|
+
|
|
64
|
+
def on_test_batch_end(self, step: int, logs=None):
|
|
65
|
+
"""
|
|
66
|
+
Called at the end of each test batch.
|
|
67
|
+
|
|
68
|
+
Parameters
|
|
69
|
+
----------
|
|
70
|
+
step : int
|
|
71
|
+
The index of the current test batch.
|
|
72
|
+
logs : dict, optional
|
|
73
|
+
A dictionary containing logs related
|
|
74
|
+
to the test batch (default is None).
|
|
75
|
+
"""
|
|
76
|
+
return
|
|
77
|
+
|
|
78
|
+
def on_test_error(self, step: int, error, logs=None):
|
|
79
|
+
"""
|
|
80
|
+
Called when the callback raises an error.
|
|
81
|
+
|
|
82
|
+
Parameters
|
|
83
|
+
----------
|
|
84
|
+
step : int
|
|
85
|
+
The index of the current test batch.
|
|
86
|
+
error: Exception
|
|
87
|
+
The error exception.
|
|
88
|
+
logs : dict, optional
|
|
89
|
+
A dictionary containing logs related
|
|
90
|
+
to the test batch (default is None).
|
|
91
|
+
"""
|
|
92
|
+
return
|
|
93
|
+
|
|
94
|
+
def on_test_end(self, logs=None):
|
|
95
|
+
"""
|
|
96
|
+
Called at the end of the test.
|
|
97
|
+
|
|
98
|
+
Parameters
|
|
99
|
+
----------
|
|
100
|
+
logs : dict, optional
|
|
101
|
+
A dictionary containing logs related to the test (default is None).
|
|
102
|
+
"""
|
|
103
|
+
return
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
class CallbacksList(object):
|
|
107
|
+
"""
|
|
108
|
+
A list of callbacks that can be triggered during the validation process.
|
|
109
|
+
|
|
110
|
+
Parameters
|
|
111
|
+
----------
|
|
112
|
+
callbacks : List[Callback], optional
|
|
113
|
+
A list of callback objects to be triggered
|
|
114
|
+
during the testing process (default is None).
|
|
115
|
+
"""
|
|
116
|
+
|
|
117
|
+
def __init__(
|
|
118
|
+
self,
|
|
119
|
+
callbacks: List[Callback] = None
|
|
120
|
+
):
|
|
121
|
+
self.callbacks = callbacks if callbacks else []
|
|
122
|
+
|
|
123
|
+
def on_test_begin(self, logs=None):
|
|
124
|
+
"""
|
|
125
|
+
Triggers the `on_test_begin` method of each callback in the list.
|
|
126
|
+
|
|
127
|
+
Parameters
|
|
128
|
+
----------
|
|
129
|
+
logs: dict
|
|
130
|
+
A dictionary containing logs related to the test (default is None).
|
|
131
|
+
"""
|
|
132
|
+
for callback in self.callbacks:
|
|
133
|
+
callback.on_test_begin(logs)
|
|
134
|
+
|
|
135
|
+
def on_test_batch_begin(self, step: int, logs=None):
|
|
136
|
+
"""
|
|
137
|
+
Triggers the `on_test_batch_begin` method of each callback in the list.
|
|
138
|
+
|
|
139
|
+
Parameters
|
|
140
|
+
----------
|
|
141
|
+
step : int
|
|
142
|
+
The index of the current test batch.
|
|
143
|
+
logs : dict, optional
|
|
144
|
+
A dictionary containing logs related
|
|
145
|
+
to the test batch (default is None).
|
|
146
|
+
"""
|
|
147
|
+
for callback in self.callbacks:
|
|
148
|
+
callback.on_test_batch_begin(step, logs)
|
|
149
|
+
|
|
150
|
+
def on_test_batch_end(self, step: int, logs=None):
|
|
151
|
+
"""
|
|
152
|
+
Triggers the `on_test_batch_end` method of each callback in the list.
|
|
153
|
+
|
|
154
|
+
Parameters
|
|
155
|
+
----------
|
|
156
|
+
step : int
|
|
157
|
+
The index of the current test batch.
|
|
158
|
+
logs : dict, optional
|
|
159
|
+
A dictionary containing logs related
|
|
160
|
+
to the test batch (default is None).
|
|
161
|
+
"""
|
|
162
|
+
for callback in self.callbacks:
|
|
163
|
+
callback.on_test_batch_end(step, logs)
|
|
164
|
+
|
|
165
|
+
def on_test_error(self, step: int, error, logs=None):
|
|
166
|
+
"""
|
|
167
|
+
Triggers the `on_test_error` method of each callback in the list.
|
|
168
|
+
|
|
169
|
+
Parameters
|
|
170
|
+
----------
|
|
171
|
+
step : int
|
|
172
|
+
The index of the current test batch.
|
|
173
|
+
error: Exception
|
|
174
|
+
The error exception.
|
|
175
|
+
logs : dict, optional
|
|
176
|
+
A dictionary containing logs related
|
|
177
|
+
to the test batch (default is None).
|
|
178
|
+
"""
|
|
179
|
+
for callback in self.callbacks:
|
|
180
|
+
callback.on_test_error(step, error, logs)
|
|
181
|
+
|
|
182
|
+
def on_test_end(self, logs=None):
|
|
183
|
+
"""
|
|
184
|
+
Triggers the `on_test_end` method of each callback in the list.
|
|
185
|
+
|
|
186
|
+
Parameters
|
|
187
|
+
----------
|
|
188
|
+
logs : dict, optional
|
|
189
|
+
A dictionary containing logs related to the test (default is None).
|
|
190
|
+
"""
|
|
191
|
+
for callback in self.callbacks:
|
|
192
|
+
callback.on_test_end(logs)
|