MCPcopy Create free account
hub / github.com/apache/singa / preprocess

Function preprocess

examples/onnx/superresolution.py:34–41  ·  view source on GitHub ↗
(img)

Source from the content-addressed store, hash-verified

32
33
34def preprocess(img):
35 img = resizeimage.resize_cover(img, [224, 224], validate=False)
36 img_ycbcr = img.convert('YCbCr')
37 img_y_0, img_cb, img_cr = img_ycbcr.split()
38 img_ndarray = np.asarray(img_y_0)
39 img_4 = np.expand_dims(np.expand_dims(img_ndarray, axis=0), axis=0)
40 img_5 = img_4.astype(np.float32) / 255.0
41 return img_5, img_cb, img_cr
42
43
44def get_image():

Callers 1

superresolution.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected