@@ -221,7 +221,7 @@ def distort_image(image, height, width, bbox, thread_id=0, scope=None):
221
221
if not thread_id :
222
222
image_with_box = tf .image .draw_bounding_boxes (tf .expand_dims (image , 0 ),
223
223
bbox )
224
- tf .image_summary ('image_with_bounding_boxes' , image_with_box )
224
+ tf .summary . image ('image_with_bounding_boxes' , image_with_box )
225
225
226
226
# A large fraction of image datasets contain a human-annotated bounding
227
227
# box delineating the region of the image containing the object of interest.
@@ -242,7 +242,7 @@ def distort_image(image, height, width, bbox, thread_id=0, scope=None):
242
242
if not thread_id :
243
243
image_with_distorted_box = tf .image .draw_bounding_boxes (
244
244
tf .expand_dims (image , 0 ), distort_bbox )
245
- tf .image_summary ('images_with_distorted_bounding_box' ,
245
+ tf .summary . image ('images_with_distorted_bounding_box' ,
246
246
image_with_distorted_box )
247
247
248
248
# Crop the image to the specified bounding box.
@@ -259,7 +259,7 @@ def distort_image(image, height, width, bbox, thread_id=0, scope=None):
259
259
# the third dimension.
260
260
distorted_image .set_shape ([height , width , 3 ])
261
261
if not thread_id :
262
- tf .image_summary ('cropped_resized_image' ,
262
+ tf .summary . image ('cropped_resized_image' ,
263
263
tf .expand_dims (distorted_image , 0 ))
264
264
265
265
# Randomly flip the image horizontally.
@@ -269,7 +269,7 @@ def distort_image(image, height, width, bbox, thread_id=0, scope=None):
269
269
distorted_image = distort_color (distorted_image , thread_id )
270
270
271
271
if not thread_id :
272
- tf .image_summary ('final_distorted_image' ,
272
+ tf .summary . image ('final_distorted_image' ,
273
273
tf .expand_dims (distorted_image , 0 ))
274
274
return distorted_image
275
275
@@ -328,8 +328,8 @@ def image_preprocessing(image_buffer, bbox, train, thread_id=0):
328
328
image = eval_image (image , height , width )
329
329
330
330
# Finally, rescale to [-1,1] instead of [0, 1)
331
- image = tf .sub (image , 0.5 )
332
- image = tf .mul (image , 2.0 )
331
+ image = tf .subtract (image , 0.5 )
332
+ image = tf .multiply (image , 2.0 )
333
333
return image
334
334
335
335
@@ -394,7 +394,7 @@ def parse_example_proto(example_serialized):
394
394
ymax = tf .expand_dims (features ['image/object/bbox/ymax' ].values , 0 )
395
395
396
396
# Note that we impose an ordering of (y, x) just to make life difficult.
397
- bbox = tf .concat (0 , [ymin , xmin , ymax , xmax ])
397
+ bbox = tf .concat (axis = 0 , values = [ymin , xmin , ymax , xmax ])
398
398
399
399
# Force the variable number of bounding boxes into the shape
400
400
# [1, num_boxes, coords].
@@ -505,6 +505,6 @@ def batch_inputs(dataset, batch_size, train, num_preprocess_threads=None,
505
505
images = tf .reshape (images , shape = [batch_size , height , width , depth ])
506
506
507
507
# Display the training images in the visualizer.
508
- tf .image_summary ('images' , images )
508
+ tf .summary . image ('images' , images )
509
509
510
510
return images , tf .reshape (label_index_batch , [batch_size ])
0 commit comments