예제 #1
0
    def testAdjustPositiveHue(self):
        x_shape = [2, 2, 3]
        x_data = [0, 5, 13, 54, 135, 226, 37, 8, 234, 90, 255, 1]
        x_np = np.array(x_data, dtype=np.uint8).reshape(x_shape)

        delta = 0.25
        y_data = [13, 0, 11, 226, 54, 221, 234, 8, 92, 1, 217, 255]
        y_np = np.array(y_data, dtype=np.uint8).reshape(x_shape)

        with self.test_session():
            x = constant_op.constant(x_np, shape=x_shape)
            y = image_ops.adjust_hue(x, delta)
            y_tf = y.eval()
            self.assertAllEqual(y_tf, y_np)
예제 #2
0
  def testAdjustPositiveHue(self):
    x_shape = [2, 2, 3]
    x_data = [0, 5, 13, 54, 135, 226, 37, 8, 234, 90, 255, 1]
    x_np = np.array(x_data, dtype=np.uint8).reshape(x_shape)

    delta = 0.25
    y_data = [13, 0, 11, 226, 54, 221, 234, 8, 92, 1, 217, 255]
    y_np = np.array(y_data, dtype=np.uint8).reshape(x_shape)

    with self.test_session():
      x = constant_op.constant(x_np, shape=x_shape)
      y = image_ops.adjust_hue(x, delta)
      y_tf = y.eval()
      self.assertAllEqual(y_tf, y_np)