Image segmentation using UNET and CRF
This project is for image segmentation using UNET model and Conditional random field modeling.
- Annotated label
- UNET predicted label
- CRF predicted label
This contains jupyter notebook be be used on google colab in combination with google drive for minimum install
- Clone current repository in your local machine
- Upload the segmentation folder (repo) on Google Drive at parent location i.e. in My Drive
- Open segmentation.ipynb from drive using Google colab
- Follow the steps in the notebook to train and predict labels
Segmantation folder contains pretrained weights. So you can do prediction without training.
- Run all cells and model will load pretrained model and predict on validation set.
- To train new model set TRAIN_MODEL = True in Step - 7 of notebook
Follow the below steps to predict on your image. Step-9 in notebook is used for your image prediction. Please run all above steps before this step.
- Upload your jpg image on google drive inside segmentation folder at location 'My Drive/segmentation/myimages/'
- In Step-9 of notebook set 'image_name' variable to your image name eg. 'myimage.jpg'
- Execute the cell and get prediction.
- It will give result using pretrained weights.
- If you want to use currently trained weights the set use_current_model = True in step-9.