Bläddra i källkod

fix resize image throughout

Chenyang Liu 9 år sedan
förälder
incheckning
253ca4ab81

+ 2 - 2
inception/inception/image_processing.py

@@ -253,8 +253,8 @@ def distort_image(image, height, width, bbox, thread_id=0, scope=None):
     # fashion based on the thread number.
     # Note that ResizeMethod contains 4 enumerated resizing methods.
     resize_method = thread_id % 4
-    distorted_image = tf.image.resize_images(distorted_image, height, width,
-                                             resize_method)
+    distorted_image = tf.image.resize_images(distorted_image, [height, width],
+                                             method=resize_method)
     # Restore the shape since the dynamic slice based upon the bbox_size loses
     # the third dimension.
     distorted_image.set_shape([height, width, 3])

+ 1 - 1
slim/preprocessing/inception_preprocessing.py

@@ -212,7 +212,7 @@ def preprocess_for_train(image, height, width, bbox,
     num_resize_cases = 1 if fast_mode else 4
     distorted_image = apply_with_random_selector(
         distorted_image,
-        lambda x, method: tf.image.resize_images(x, height, width, method),
+        lambda x, method: tf.image.resize_images(x, [height, width], method=method),
         num_cases=num_resize_cases)
 
     tf.image_summary('cropped_resized_image',

+ 1 - 1
slim/slim_walkthough.ipynb

@@ -634,7 +634,7 @@
     "    \n",
     "    # Preprocess the image for display purposes.\n",
     "    image_raw = tf.expand_dims(image_raw, 0)\n",
-    "    image_raw = tf.image.resize_images(image_raw, height, width)\n",
+    "    image_raw = tf.image.resize_images(image_raw, [height, width])\n",
     "    image_raw = tf.squeeze(image_raw)\n",
     "\n",
     "    # Batch it up.\n",