findCats.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:RaspberryPi-Robot 作者: timestocome 项目源码 文件源码
def capture_image(self):

      image = np.empty((self.width, self.height, 3), dtype=np.uint8)
      self.camera.capture(image, 'rgb')

      float_caster = tf.cast(image, tf.float32)
      dims_expander = tf.expand_dims(float_caster, 0);
      resized = tf.image.resize_bilinear(dims_expander, [self.height, self.width])

      normalized = tf.divide(tf.subtract(resized, [self.input_mean]), [self.input_std])
      sess = tf.Session()
      result = sess.run(normalized)

      return result
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号