JeVoisBase
1.22
JeVois Smart Embedded Machine Vision Toolkit Base Modules
Share this page:
Tweet
Loading...
Searching...
No Matches
recognition.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
Recognition
(
BaseMetric
):
8
def
__init__
(self, **kwargs):
9
super().
__init__
(**kwargs)
10
11
def
forward
(self, model, *args, **kwargs):
12
img, bboxes = args
13
14
self.
_timer
.reset()
15
for
idx, bbox
in
enumerate(bboxes):
16
for
_
in
range(self.
_warmup
_warmup
):
17
model.infer(img, bbox)
18
for
_
in
range(self.
_repeat
_repeat
):
19
self.
_timer
.start()
20
model.infer(img, bbox)
21
self.
_timer
.stop()
22
23
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.recognition.Recognition
Definition
recognition.py:7
utils.metrics.recognition.Recognition.forward
forward(self, model, *args, **kwargs)
Definition
recognition.py:11
utils.metrics.recognition.Recognition._warmup
_warmup
Definition
recognition.py:16
utils.metrics.recognition.Recognition.__init__
__init__(self, **kwargs)
Definition
recognition.py:8
utils.metrics.recognition.Recognition._repeat
_repeat
Definition
recognition.py:18
opencv_zoo
benchmark
utils
metrics
recognition.py
Please help us improve this page: Edit it on
GitHub
or
email us your edits and suggestions.
Generated by
1.9.8