JeVoisBase  1.22
JeVois Smart Embedded Machine Vision Toolkit Base Modules
Share this page:
Loading...
Searching...
No Matches
detection.py
Go to the documentation of this file.
1import cv2 as cv
2
3from .base_metric import BaseMetric
4from ..factory import METRICS
5
6@METRICS.register
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()
forward(self, model, *args, **kwargs)
Definition detection.py:11