tadax / glcic

Globally and Locally Consistent Image Completion with TensorFlow
MIT License
135 stars 42 forks source link

How to use this on a test image using the pretrained model #11

Open Abhi001vj opened 6 years ago

Abhi001vj commented 6 years ago

I thought I could load the model and load the saved weights and then execute this step to generate the results. completion = sess.run(model.completion, feed_dict={x: img, mask: mask_img, is_training: False}) sample = np.array((completion[0] + 1) * 127.5, dtype=np.uint8) cv2.imwrite('./output.jpg', cv2.cvtColor(sample, cv2.COLOR_RGB2BGR)) I used the images you given as test results.

This is the error I got.

You must feed a value for placeholder tensor 'Placeholder' with dtype float and shape [16,128,128,3]
     [[Node: Placeholder = Placeholder[dtype=DT_FLOAT, shape=[16,128,128,3], _device="/job:localhost/replica:0/task:0/device:GPU:0"]

Thank you for the implementation.

muyue1238 commented 5 years ago

I've achieved on testing images using the author's model, though you maybe don't need answer half years later. First generate a *.npy file using data/to_npy.py, and use it as the input of src/test/test.py, and the outcome pictures will be stored in /src/test/output folder.

Erizu91 commented 2 years ago

Hello, I am trying to do a test on an image after training with my own data set but I get an error because it cannot find this file "lfw.npy '"