def SequenceToImageAndDiff(images):
 image_diff_list = []
 image_seq = tf.unstack(images, axis=1)
 for size in [32, 64, 128, 256]:
  resized_images = [tf.image.resize_images(i, [size, size]) for i in image_seq]
  diffs = []
  for i in xrange(0, (len(resized_images) - 1)):
   diffs.append((resized_images[(i + 1)] - resized_images[i]))
  image_diff_list.append((tf.concat(0, resized_images[:(-1)]), tf.concat(0, diffs)))
 return image_diff_list

def SequenceToImageAndDiff ( images ) : image_diff_list = [ ] image_seq = tf . unstack ( images , axis = 1 ) for size in [ 32 , 64 , 128 , 256 ] : resized_images = [ tf . image . resize_images ( i , [ size , size ] ) for i in image_seq ] diffs = [ ] for i in xrange ( 0 , ( len ( resized_images ) - 1 ) ) : diffs . append ( ( resized_images [ ( i + 1 ) ] - resized_images [ i ] ) ) image_diff_list . append ( ( tf . concat ( 0 , resized_images [ : ( - 1 ) ] ) , tf . concat ( 0 , diffs ) ) ) return image_diff_list
convert image sequence batch into image and diff batch .