Tool on segmentation 5 sand grain microtextures (two chemical and three mechanical). The repository contains data, train/inference code and showcase of a final model. This repository was created as a part of batchelor thesis on the Faculty of Informational Technologies in Czech Technical University in Prague. Full research is available on DSpace
As a final segmentation model was selected DeepLabv3+. Model can segment microtextures with next IoU on test set:
| Microtexture | IoU |
|---|---|
| pitting | 0.111 |
| edge_abrasion | 0.197 |
| precipitation | 0.229 |
| adhering_particles | 0.415 |
| conchoidal_fracture | 0.452 |
The simplest way to run this tool is Google Colab Notebook.
If you want to run this project locally, make the next steps:
- Clone this repository
git clone https://github.com/DainfromLiria/Sand_grains_classification.git- In the project folder run
setup.shscript (firstly runchmod +x setup.shif a script doesn't have execute permission). Next script makes python venv, install all requirements and merge model chunks into onemodel.ptfile. Splitting on chunks allows loading a large model file on GitHub.
source setup.sh- Run jupyter notebook
jupyter notebook showcase.ipynb If you want to run model in train or validation mode, add .env
file into the project directory. .env must contain
Neptune project name and API key in format:
NEPTUNE_PROJECT=<project_name>
NEPTUNE_API_KEY=<api_key>
You can find this information inside your Neptune profile after you create a project.
Use run_train.sh for running the train loop.
- 📁 data - evaluation and train dataset with annotations in COCO format
- 📁 examples - images for
README.md - 📁 input_images - user images for prediction. Folder already contains six example images
- 📁 results - model weights and file with train settings
- 📁 scripts - utility scripts for visualization data from Neptun and dataset statistics. Script on split/merge 'model.pt'
- 📁 src - main project folder with source code
- 📄 run_train.sh - bash script for running model train loop using
nohup - 📄 setup.sh - bash script for setup venv, install requirements and merge model chunks into
model.pt - 📄 showcase.ipynb - showcase of final model for local run on PC.
- 📄 showcase_colab.ipynb - showcase of final model for Colab.
