- Clone the repository
git clone https://github.com/Parsaardehali/example_deeplearning_project.gitcd example_deeplearning_project- Create a virtual environment (recommended)
python3 -m venv venv
source venv/bin/activate- Install dependencies
pip install -r requirements.txtThis jupyter notebook gives an overall view of a simple project. Specially for a segmentation task.
Example_project.ipynb
First you need to have some data. You can simulate it by running
python Simulator.pyAdjust the number of images (num_samples) and size of each image (img_size) in the last line of the script to what you need.
Preprocessing and splitting data into train an test sets is done by
python preprocess_split.pyAdjust the split ratio of test data (test_size) in the script to what you need. Default is 0.2.
Set data_dir, train_path and test_path carefully .
We do not do preprocessing here, but you can add it as a function in this script.
To train the model make sure your environment is activated by running
source venv/bin/activateAnd to run the training run python main.py --config configs/config_file.json.
You can edit the config file to adjust the hyperparameters and paths for training and test datasets.
To set up weights and biases (wandb) check this setup link Play around with loss function, for example using MSE loss instead of Dice loss. You can also try different architectures and optimizers.
If you have any suggestions or find any bugs, please create an issue or a pull request.
- This repo is highly inspired by Simple-UNet repo that uses only pytorch. -Thanks to Prof. Michael Habeck for motivating me and providing feedback and suggestions.