LeeJunHyun / Image_Segmentation

Pytorch implementation of U-Net, R2U-Net, Attention U-Net, and Attention R2U-Net.
2.68k stars 595 forks source link

Custom dataset #7

Closed Jorisfournel closed 5 years ago

Jorisfournel commented 5 years ago

Hello,

First of all thank you for your contribution. Could you please point us what is to be changed in your code in order to apply those networks to a custom dataset?

Thanks!! Joris

LeeJunHyun commented 5 years ago

Dear @Jorisfournel , I appreciate about your interest.

At main.py#L93, you can change the path to your own dataset directory if your dataset already split train/valid/test. In this case, you should save your ground truth data at TRAIN_PATH_NAME + _GT/,VALID_PATH_NAME + _GT/,TEST_PATH_NAME + _GT/

else, you can change the path of dataset.py#L99, if you have only the split image/groud truth. And then run dataset.py.


or you can use argparser like main.py --train_path='YOUR_TRAIN_IMG_PATH' --valid_path='YOUR_VALID_IMG_PATH' --test_path='YOUR_TEST_IMG_PATH' In this case, you also should save your ground truth data at TRAIN_PATH_NAME + _GT/,VALID_PATH_NAME + _GT/,TEST_PATH_NAME + _GT/

or

dataset.py --origin_data_path='CUSTUM_IMAGE_PATH' --'origin_GT_path=CUSTUM_GROUND_TRUTH_PATH'


If it not works, then plz leave more issues anytime :)

LeeJunHyun commented 5 years ago

If you don't have further questions, I will close the issue. I hope my answer was helpful :)

loaysh2010 commented 5 years ago

Hello, @LeeJunHyun I followed your instruction by changing the path to my data in dataset.py L99,100 .. but after running the code I got num of samples= 0 in all folders (train, valid, test)