jakeret / tf_unet

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

Question about x_test and prediction Shape? #159

Closed yokoyang closed 6 years ago

yokoyang commented 6 years ago

Hi, I am new to TensorFlow. here,

x_test: Data to predict on. Shape [n, nx, ny, channels] prediction: The unet prediction Shape [n, px, py, labels] (px=nx-self.offset/2)

what does the first n mean? it seems n always equal 1, because only input one test image?

example: x_test[0][171][170] = [0.91764706 0.9254902 0.92156863] Does it means in the first image data the pixel location [171,170] rgb (normalized)= [0.91764706 0.9254902 0.92156863]?

Besides, if the prediction array shape is <class 'tuple'>: (1, 512, 512, 3), min =0.0, max = 1,but I set n_class=3, why max isn't 2.0 ? please help me, thanks a lot.

jakeret commented 6 years ago

This n stands for the mini batch size. Default is set to 1 but it's a hyperparameter that has to be tuned.

Does it means in the first image data the pixel location [171,170] rgb (normalized)= [0.91764706 0.9254902 0.92156863]?

Exactly.

Besides, if the prediction array shape is <class 'tuple'>: (1, 512, 512, 3), min =0.0, max = 1,but I set n_class=3, why max isn't 2.0 ?

You get a softmax probability that adds up to one. E.g. a pixel has 80% probability to be class A, 15% class B and 5% class C.