anishreddy3 / Crack-Semantic-Segmentation

Real time crack segmentation using PyTorch, OpenCV and ONNX runtime

Home Page:https://docs.google.com/document/d/1gJtviJ3ks5ddoKysCEBuZs0xUSVYecq-EYUO7ba8fp4/edit?usp=sharing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unet Semantic Segmentation for Cracks

Real time Crack Segmentation using PyTorch, OpenCV, ONNX runtime

Dependencies:

Pytorch

OpenCV

ONNX runtime

CUDA >= 9.0

Instructions:

1.Train model with your datatset and save model weights (.pt file) using unet_train.py on supervisely.ly

2.Convert model weights to ONNX format using pytorch_to_onnx.py

3.Obtain real time inference using crack_det_new.py

Crack segmentation model files can be downloaded by clicking this link

Commands

Usage: Used to inference on images available in a folder on GPU

python crack_inference_folder.py -c "class file" -l "color file"  -idir "dataset directory" -odir "output directory" -m model file

python crack_inference_folder.py -c unet_classes.txt -l unet_colors.txt -idir "Dataset/sample dataset/" -odir "output_test/" -m model_files/model.pt

Usage: Used to inference on images available in a folder on CPU

python crack_det_new.py -c "class file" -l "color file"  -i "input video" -o "output video" -m model file

python crack_det_new.py -c unet_classes.txt -l unet_colors.txt -i "input_vdo.mp4 -odir "output_vdo.mp4" 

Results:

Graphs:

alt text

alt text