jakeret / tf_unet

Generic U-Net Tensorflow implementation for image segmentation
GNU General Public License v3.0
1.9k stars 748 forks source link

How to test? #274

Closed Gumballing closed 5 years ago

Gumballing commented 5 years ago

hi, jakeret

I have completed the training and got the result model. I would like to use the following command to test, but how to properly load the test image into the required shape as data? `prediction = net.predict(path, data)

unet.error_rate(prediction, util.crop_to_shape(label, prediction.shape))

img = util.combine_img_prediction(data, label, prediction) util.save_image(img, "prediction.jpg")`

In the unet.py file, I see that the loaded data needs to be in the form of (n,nx,ny,channels) as shown in the figure below. What is the value of n? image Looking forward to your reply.

jakeret commented 5 years ago

Hi @gzhengli sorry for being so absent.

n is the number of images you feed into the network simultaneously but of course n=1 is valid as well.

Best is to use the same DataProvider as you used for the training to ensure the exact same preprocessing of the test images

Gumballing commented 5 years ago

@jakeret thank you~ Get it.