JeVoisBase
1.22
JeVois Smart Embedded Machine Vision Toolkit Base Modules
Share this page:
Tweet
Loading...
Searching...
No Matches
detection.py
Go to the documentation of this file.
1
import
cv2
as
cv
2
3
from
.base_metric
import
BaseMetric
4
from
..factory
import
METRICS
5
6
@METRICS.register
7
class
Detection
(
BaseMetric
):
8
def
__init__
(self, **kwargs):
9
super().
__init__
(**kwargs)
10
11
def
forward
(self, model, *args, **kwargs):
12
img = args[0]
13
size = [img.shape[1], img.shape[0]]
14
try
:
15
model.setInputSize(size)
16
except
:
17
pass
18
19
# warmup
20
for
_
in
range(self.
_warmup
_warmup
):
21
model.infer(img)
22
# repeat
23
self.
_timer
.reset()
24
for
_
in
range(self.
_repeat
_repeat
):
25
self.
_timer
.start()
26
model.infer(img)
27
self.
_timer
.stop()
28
29
return
self.
_getResult
()
utils.metrics.base_metric.BaseMetric
Definition
base_metric.py:5
utils.metrics.base_metric.BaseMetric._warmup
_warmup
Definition
base_metric.py:7
utils.metrics.base_metric.BaseMetric._repeat
_repeat
Definition
base_metric.py:8
utils.metrics.base_metric.BaseMetric._getResult
_getResult(self)
Definition
base_metric.py:32
utils.metrics.base_metric.BaseMetric._timer
_timer
Definition
base_metric.py:11
utils.metrics.detection.Detection
Definition
detection.py:7
utils.metrics.detection.Detection._repeat
_repeat
Definition
detection.py:24
utils.metrics.detection.Detection.__init__
__init__(self, **kwargs)
Definition
detection.py:8
utils.metrics.detection.Detection._warmup
_warmup
Definition
detection.py:20
utils.metrics.detection.Detection.forward
forward(self, model, *args, **kwargs)
Definition
detection.py:11
opencv_zoo
benchmark
utils
metrics
detection.py
Please help us improve this page: Edit it on
GitHub
or
email us your edits and suggestions.
Generated by
1.9.8