Giter Site home page Giter Site logo

pix2pix-tensorflow's People

Contributors

fullfanta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pix2pix-tensorflow's Issues

Test results are all blue washed images

Hi, I trained facades dataset and added testing function but the results look like all blue color intensified image.

Image link: https://imgur.com/2LZgl8E

I think post-processing is the one causes the issue.
I used the np scaling.

result = np.interp(output_image, (-1, 1), (0, 255))

Is there any method you used for post-processing?
Thanks,

Here is the code:

def test(argv=None):
    with tf.device("/%s:0" % (FLAGS.device)):        
        input_image         = tf.placeholder(tf.float32, [FLAGS.batch_size, FLAGS.fine_size, FLAGS.fine_size, 3])
        gt_image            = tf.placeholder(tf.float32, [FLAGS.batch_size, FLAGS.fine_size, FLAGS.fine_size, 3])
        generated_image     = generator.get_inference(input_image, FLAGS, reuse=False, drop_prob = 0.5)
     

    test_list = get_test_list()
    total_test_size = len(test_list)

    print ('train list - ', total_test_size)
    test_images = get_test_batch(test_list)

    # Create a saver.
    saver = tf.train.Saver(tf.global_variables())

    gpu_options = tf.GPUOptions(allow_growth=True)
    with tf.Session(config=tf.ConfigProto(log_device_placement=False, allow_soft_placement=True, gpu_options=gpu_options)) as sess: 
        # initialize the variables
        sess.run(tf.global_variables_initializer())

        # load pretrained model
        if FLAGS.pretrained_model:
            point = tf.train.latest_checkpoint(FLAGS.train_dir + '_' + FLAGS.dataset)
            print ('check point - ', point)
            saver.restore(sess, point)

        # initialize the queue threads to start to shovel data
        coord = tf.train.Coordinator()
        threads = tf.train.start_queue_runners(coord=coord)

        for elk in range(20):        
            test_info = sess.run(test_images)
            test_input_images = test_info[0]
            test_gt_images = test_info[1]

            inferred_image = sess.run(generated_image, feed_dict = {input_image : test_input_images, gt_image : test_gt_images})    
            output_image = inferred_image[0]
            result = np.interp(output_image, (-1, 1), (0, 255))  
            cv2.imwrite('inferred_image_' + str(elk) +'.jpg', result) 

        coord.request_stop()
        coord.join(threads)
        sess.close()  `

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.