This is a deep learning based project to segmentate brains of fetuses of MRI.
- Python3
- pip
For an easy use of the project is highly recommended to create a virtual environment and install the dependencies found in the requirements.txt file.
Access to your terminal and type the following:
$ pip install virtualenv virtualenvwrapper
Then create a directory for the virtual environments:
$ mkdir ~/python-envs
Now you'll add to your .bashrc file these two lines:
$ export WORKON_HOME=~python-envs
$ source /usr/share/virtualenvwrapper/virtualenvwrapper.sh
(If this path to virtualenvwrapper.sh doesn't work, try with:)
$ /usr/share/virtualenvwrapper/virtualenvwrapper.sh
Now you're ready to source your .bashrc and create a Python3 environment:
$ source .bashrc
$ mkvirtualenv --python=python3 python_env
$ workon python_env
(Note that "python_env" is a suggested name, you can replace it with any desired name for your environment)
And finally when you're done working you can deactivate the environment with:
$ deactivate
Once you're in your own environment access to the desired location and type the following commands:
$ git clone https://github.com/chrisorozco1097/brain_segmentation.git
$ cd brain_segmentation
Now install the requirements
$ pip install -r requirements.txt
Before running the project you will have to access the "data" folder and add the images and masks in the "test" and "train" folders. It's recommended to divide the total amount of images in 80% train, 20% test.
Finally you're ready to execute the project:
$ python train.py --exp name_of_the_training
If you don't chose a name_of_the_training or you pick an existing one the tool will show an error message
You will have to activate the environment every time you want to run the tool.