예제 #1
0
 def preprocess(img):
     img = tf.image.resize_images(img, [360, 360])
     img = common_layers.image_augmentation(tf.to_float(img) / 255.)
     return tf.to_int64(img * 255.)
예제 #2
0
 def testImageAugmentation(self):
     x = np.random.rand(500, 500, 3)
     with self.test_session() as session:
         y = common_layers.image_augmentation(tf.constant(x))
         res = session.run(y)
     self.assertEqual(res.shape, (299, 299, 3))
예제 #3
0
 def preprocess(img):
   img = tf.image.resize_images(img, [360, 360])
   img = common_layers.image_augmentation(
       tf.to_float(img) / 255., crop_size=resize_size)
   return tf.to_int64(img * 255.)