(self, image_bytes)
| 222 | return img |
| 223 | |
| 224 | def __call__(self, image_bytes): |
| 225 | if self.sess is None: |
| 226 | self.sess = tf.Session() |
| 227 | img = self.sess.run(self.process_image, feed_dict={self._image_bytes: image_bytes}) |
| 228 | img = img.round().clip(0, 255).astype(np.uint8) |
| 229 | if img.ndim < 3: |
| 230 | img = np.expand_dims(img, axis=-1) |
| 231 | img = np.rollaxis(img, 2) # HWC to CHW |
| 232 | return img |
nothing calls this directly
no outgoing calls
no test coverage detected