zhixuhao / unet

unet for image segmentation
MIT License
4.59k stars 2k forks source link

hello.i want to ask the order to run #3

Open chenxiChu opened 7 years ago

chenxiChu commented 7 years ago

1.use data augmentation 2.data.py 3.splitmerge.py is it right or not? and i also want to ask the prepared data is only the augmented 30 images? and when and where to generate merge and .npy?in data.py? thank you

JianbingDong commented 7 years ago

@chenxiChu Hi, i`m using this tutorial to learn FCN Ttoo, i followed this blog(http://blog.csdn.net/u012931582/article/details/70215756) to download his .npy file, so there is no need to use data.py. Here is my using step: 1. change the path in class dataprocess() in data.py; 2. unet.py; 3. test_predict.py. By following these steps, there is no faults coming out.

BUT!!!!! Here is another question, after i run the test_predict.py, i got no faults, but i got no image , so how can i visually check whether i finish it right? @zhixuhao

zhixuhao commented 7 years ago

Hi, after the test_predict.py, you will get a output file named imgs_mask_test.npy, which shape is (30,512,512,1), Then you can use a for() to get every 30 image array in imgs_mask_test, and then use array_to_img() or skimage to convert it to image. For example: img0 = imgs_mask_test[0] img0 = array_to_img(img0) img0.save(yourpath)

make sure you import the array_to_img from keras.preprocessing.image

JianbingDong commented 7 years ago

thanks a lot!!

chenxiChu commented 7 years ago

thank you.i would try

JianbingDong commented 7 years ago

@zhixuhao hi , i am using the data..py to augment my train picture, here is a question , what is the difference between the method splitMerge() and splitTransform()? What`s these functions used for?

JianbingDong commented 7 years ago

and, here is another question, after i run the myAugmentation, there is no fault , but it just created the label and train fileholder without any pictures. So how can i fix this question?

lowkeygit commented 7 years ago

Hello @JianbingDong @zhixuhao

I have a question about the preprocessing. "1. change the path in class dataprocess() in data.py"

The code: def __init__(self, out_rows, out_cols, data_path = "../deform/train", label_path = "../deform/label", test_path = "../test", npy_path = "../npydata", img_type = "tif"): Dataset has 3 documents: test-volume.tif, train-labels.tif and train-volume.tif Are these documents corresponding to those paths mentioned in the code? How about the npy_path = "../npydata"?

Appreciate your reply. Thanks.

sreevasu commented 7 years ago

HI, @JianbingDong

i could not find his .npy file in the you followed blog. please can you provide that file and after that what i need to do changes in code. please can you help me on this. thank you

Pandolph commented 6 years ago

@sreevasu 受教了!不过我在运行你的代码的时候会报错“no such files or directory '../npydata/imgs_train.npy'” 请问这个错误该怎么解决呢?我看这个好像是在读取训练数据集,但是你的训练数据集是tif文件?

这是我的npydata分享链接https://drive.google.com/open?id=0BzWLLyI3R0pLclMzMzRxUm1qZmc 训练集图像只有30张,所以需要进行数据增强,我http://download.csdn.net/detail/u012931582/9817058这个代码进行的图像扭曲,扩展数据集到1000多张,然后用data.py代码把这些图片做成npy文件