/crack_detection

khan_seg++

Primary LanguagePython

Crack Detection and Segmentation

Introduction

Based on khanhha/crack_segmentation
Updated to fit newer version of python and cuda
Remove and replace the deprecated code
Some improvements on usabilities

System Requirements

Ubuntu (Recommand 22.04 LTS)
Cuda (Recommand 11.6)
Anaconda

Environment Preparation

Create and Enter Conda environment

conda create --name crack python=3.10
conda activate crack

Dependencies Installation

conda install matplotlib scipy numpy tqdm pillow
conda install pytorch torchvision torchaudio pytorch-cuda=11.6 -c pytorch -c nvidia
conda install -c conda-forge opencv

Other Versions of Pytorch

Pre-Trained Model

Use the pre-trained model in order to run the crack detection algorithm without training
Download model_unet_vgg_16_best.pt and put it in ./Models

Run Crack Detection

conda activate crack
python run.py

Default input and output directories:
./Data/Inputs ./Data/Outputs

To modify input and output directories, add arguments:

python run.py input_dir output_dir

Default model directory and type: ./Models/model_unet_vgg_16_best.pt
vgg16

To modify model path and model type:

python run.py input_dir output_dir model_dir model_type