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