MCPcopy Create free account
hub / github.com/PaddlePaddle/Serving / __call__

Method __call__

python/paddle_serving_app/reader/image_reader.py:587–601  ·  view source on GitHub ↗
(self, img_path)

Source from the content-addressed store, hash-verified

585 pass
586
587 def __call__(self, img_path):
588 if py_version == 2:
589 fin = open(img_path)
590 else:
591 fin = open(img_path, "rb")
592 sample = fin.read()
593 data = np.fromstring(sample, np.uint8)
594 img = cv2.imdecode(data, cv2.IMREAD_COLOR)
595 '''
596 img = cv2.imread(img_path, -1)
597 channels = img.shape[2]
598 ori_h = img.shape[0]
599 ori_w = img.shape[1]
600 '''
601 return img
602
603 def __repr__(self):
604 return self.__class__.__name__ + "()"

Callers

nothing calls this directly

Calls 1

readMethod · 0.80

Tested by

no test coverage detected