JeVoisBase  1.22
JeVois Smart Embedded Machine Vision Toolkit Base Modules
Share this page:
Loading...
Searching...
No Matches
recognition.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, 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()
forward(self, model, *args, **kwargs)