Closed manvirvirk closed 4 years ago
Hi,
That is a good question indeed
If you noticed in the source code file prepare_datasets_DRIVE.py which is responsible of the dataset and the first step of running this model. You have path to images line 20-27 which defines training and testing the model in a specific way. This model is based on 3 sets of images, original images, ground truth and bordermask images. Unfortunately there are not many datasets that provide all these specification so you either need to find a way to extract ground truth and border mask from an retinal image or rewritte the code to read original images only which I have not yet figured a way around this.
Note that removing ground truth and border mask will affect the results dramatically as our purpose here is Retinal Blood Vessel Segmentation which means these attributes are essential to improving the acurracy of this model.
Let me know if you do find a way though :)
yea facing this same issue, will go through it.
Thanks for help @AnthonyKuci. It's basically as AnthonyKuci said.
i have only database containing simple retina images without ground truth . how to segment them with ground truth and mask?
It's impossible to generate ground truth with any model. Models can only generate predictions.
i have generated masks of my database. So can you tell what changes need to be made in files?
Happy to help @juntang-zhuang
it's quite easy @manvirvirk just change prepare_dataset_DRIVE.py as follows:
lines 19 to 28 change the path with your new image path or replace the images inside these folders
`------------Path of the images --------------------------------------------------------------
original_imgs_train = "./DRIVE/training/images/" groundTruth_imgs_train = "./DRIVE/training/1st_manual/" borderMasks_imgs_train = "./DRIVE/training/mask/"
original_imgs_test = "./DRIVE/test/images/" groundTruth_imgs_test = "./DRIVE/test/1st_manual/" borderMasks_imgs_test = "./DRIVE/test/mask/"
`
change lines 30 to 34 Nimgs the number of images in your path, channels the dimension of your images this part will most likely throw you an ValueError: could not broadcast input array from shape (height, width, dimension ) into shape (height, width) *Note that images in DRIVE dataset are specific dimensions as such (584, 565, 3) and ground images and mask images are (584, 565, 1) if you do not have the same parameters this will not work
`Nimgs = 20 #number of iages channels = 3 #dimension height = 584 #this is for drive you must change it to your images or convert them t match its one width = 565 #this is for drive you must change it to your images or convert them t match its one
dataset_path = "./DRIVE_datasets_training_testing/"`
FInally lines 50, 57, 59 need to be changed to your images name and type or match the existing ones as shown below:
` groundTruth_name = files[i][0:2] + "_manual1.gif"
border_masks_name = files[i][0:2] + "_training_mask.gif"
border_masks_name = files[i][0:2] + "_test_mask.gif"
`
I hope that help,
Good Luck
@AnthonyKuci Thanks for reply. I have database of 20 images and corresponding masks on which i want to train this model. So i have to make these changes in prepare_dataset_DRIVE file.
what all changes we need to make in retinaNN_train.py file?
Only path related changes you would have to make if you change the path folder with your images this also includes configuration.txt file
i m getting this error when i made the changes accirding to my data: original image: 1_training.png specify if train or test!!
Is this error coming from prepare_dataset_Drive.py?
It seems to me that this is the case in which you most likely have not specified the path in your images. If you check the DRIVE folder it has a specific structure you must follow that structure to avoid error and further rearrangements in the source code.
all you need is the following structure:
-DRIVE ------test ------------images ------------1st_manual ------------mask ------training ------------images ------------1st_manual ------------mask
hope that helps
actually i want to train on data which have only images and respective labels. I dont have 1st_manual so i deleted that line in code. Rest database directory is same
Yeah, that should be fine if you apply the changes in the source code, however, *Note that this will affect the network dramatically.
hi,i m using this to train on my database which have only images and mask. I have made changes in prepare dataset file. i m getting following error in training file:
File "retinaNN_training.py", line 91, in
hi, i want to run laddernet on different images other than DRIVE. How to do that?