fullfanta / pix2pix-tensorflow Goto Github PK
View Code? Open in Web Editor NEWpix2pix tensorflow implementation
pix2pix tensorflow implementation
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() `
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.