2if pyjevois.pro:
import libjevoispro
as jevois
3else:
import libjevois
as jevois
40 self.
scale = jevois.Parameter(self,
'scale',
'float',
41 "Value scaling factor applied to input pixels, or 0.0 to extract a " +
42 "UINT8 blob, typically for use with quantized networks",
45 self.
mean = jevois.Parameter(self,
'mean',
'fscalar',
46 "Mean value subtracted from input image",
47 (127.5, 127.5, 127.5), pc)
71 if alist[0] !=
'NCHW':
raise ValueError(
"Only NCHW blobs supported. Try the C++ preprocessor for more.")
76 if typ ==
'8U': typ = cv2.CV_8U
77 elif typ ==
'32F': typ = cv2.CV_32F
78 else:
raise ValueError(
"Only 8U or 32F blob types supported. Try the C++ preprocessor for more.")
81 dlist = dims.split(
'x')
82 if len(dlist) != 4:
raise ValueError(
"Only 4D blobs supported. Try the C++ preprocessor for more.")
85 siz = (int(dlist[3]), int(dlist[2]))
89 b = cv2.dnn.blobFromImage(img, self.
scale.get(), siz, self.
mean.get(), swaprb, crop =
False, ddepth = typ)
94 crops.append( ( (0, 0), (img.shape[1], img.shape[0] ) ) )
109 def report(self, outimg, helper, overlay, idle):
Simple DNN pre-processor written in python.
init(self)
[Optional] JeVois parameters initialization
process(self, img, swaprb, attrs)
[Required] Main processing function: extract one or more 4D blobs from an image img is the input imag...
__init__(self)
[Optional] Constructor
report(self, outimg, helper, overlay, idle)
[Optional] Report the latest results obtained by process() by drawing them outimg is None or a RawIma...