Skip to content

Pothole Segmentation using a custom U-Net Segmentation model built and trained from scratch using TensorFlow and Keras

Notifications You must be signed in to change notification settings

lilNewbie/SemanticSegmentation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Semantic Segmentation

I have created a Semantic Segmentation model to segment potholes from an input video.

About the model

  • I have trained a U-Net model from scratch using Tensorflow and Keras.
  • I have used a custom Data Generator to feed the images and the masks as input to the U-Net model.
  • The depth of the U-Net model can be customised. (recommended depth - 3 to 5 for (256,256,3) images).
  • The maximum allowed depth of the U-Net model is determined by the dimensions of the input frames.

Structure of the U-Net Model

U_Net

Run Locally

Following were the versions of the libraries I used

  • Tensorflow - 2.10.1
  • OpenCV (cv2) - 4.6.0
  • Numpy - 1.23.5
  • Moviepy - 1.0.3

Clone the project

  git clone https://github.com/lilNewbie/SemanticSegmentation.git

Go to the project directory

  cd SemanticSegmentation

Important! Set the paths to the input and output video files

Run segfile.py

  python segfile.py

Running the Train file (SemanticSegmentation_Pothole.ipynb)

  • The U-Net model was trained in Google Colab.
  • You will need to use your Kaggle public API to access the dataset via Colab

Sample Video

Input Video

input_video.mp4

Output Video

output_video.mp4

The difference in input and output clarity is due to resizing the input frames for prediction and later resizing it back to its actual dimensions

References

About

Pothole Segmentation using a custom U-Net Segmentation model built and trained from scratch using TensorFlow and Keras

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published