84 frame = inframe.getCvRGB()
if self.
rgb else inframe.getCvBGR()
92 image = Image.fromarray(frame).resize(size, Image.LANCZOS)
96 start = time.perf_counter()
98 inference_time = time.perf_counter() - start
104 msgbox = np.zeros((24, w, 3), dtype = np.uint8) + 80
106 rlabel =
'%s: %.2f' % (self.
labels.get(c.id, c.id), c.score)
107 cv.putText(msgbox, rlabel, (3, 15), cv.FONT_HERSHEY_SIMPLEX, 0.4, (255, 255, 255), 1, cv.LINE_AA)
110 cv.putText(frame,
'JeVois Coral Classification - ' + self.
model, (3, 15),
111 cv.FONT_HERSHEY_SIMPLEX, 0.4, (255, 255, 255), 1, cv.LINE_AA)
113 fps = self.
timer.stop()
114 label = fps +
', %dms' % (inference_time * 1000.0)
115 cv.putText(frame, label, (3, h-5), cv.FONT_HERSHEY_SIMPLEX, 0.4, (255, 255, 255), 1, cv.LINE_AA)
118 frame = np.vstack((frame, msgbox))
121 if self.
rgb: outframe.sendCvRGB(frame)
122 else: outframe.sendCv(frame)
128 idle, winw, winh = helper.startFrame()
131 x, y, w, h = helper.drawInputFrame(
"c", inframe,
False,
False)
134 frame = inframe.getCvRGBp()
if self.
rgb else inframe.getCvBGRp()
141 image = Image.fromarray(frame).resize(size, Image.LANCZOS)
145 start = time.perf_counter()
147 inference_time = time.perf_counter() - start
153 helper.itext(
'JeVois-Pro Python Coral Classification - %s - %dms/inference' %
154 (self.
model, inference_time * 1000.0))
158 rlabel =
'%s: %.2f' % (self.
labels.get(c.id, c.id), c.score)
162 fps = self.
timer.stop()
163 helper.iinfo(inframe, fps, winw, winh);