Built a real-time Pipe Detection system with YOLOv8

Excited to share my latest project: Building a Computer Vision Model with YOLOv8 to Count Pipes! 🚀

As a machine learning enthusiast, I recently dove into object detection to solve a real-world problem—accurately counting pipes in industrial settings. Using YOLOv8, I trained a custom model on a dataset sourced from Google Images, and the results were impressive: the model successfully detects and counts pipes with high precision!

The training process was seamless on Google Colab, where I handled data augmentation, model fine-tuning, and evaluation. Once trained, I deployed the model locally using Flask, creating a simple web app for real-time inference. This setup makes it easy to integrate into workflows for inventory management or quality control.

– **Why**: Speed up inspection/estimation workflows with consistent, explainable detections.
– **What I built**:
– Custom-trained YOLOv8 model on a pipe dataset (train/test/valid)
– Robust label cleaning (segmentation → bounding boxes), Drive-safe handling
– Google Colab notebook for GPU training + Drive persistence
– Flask web app: upload from desktop or phone, confidence slider, annotated results, and live pipe count

### Tech stack
– **Model**: Ultralytics YOLOv8 (PyTorch)
– **Training**: Google Colab + Google Drive integration
– **App**: Flask, OpenCV, Pillow, NumPy

### What you can do with it
– Upload a photo from your phone or desktop
– Adjust the confidence threshold
– Get JSON detections, an annotated image, and an automatic pipe count

### Results
– Out-of-the-box YOLO struggled on pipe images; the fine-tuned model delivers far more reliable detections and counts.
– The web demo makes it easy for non-technical users to try the model instantly.

Check out the attached video demo below, showcasing the training in Colab and a quick run of the Flask app. (Note: The video includes some audio glitches with repeated “Heat” mentions—likely from background noise during recording, but the visuals tell the story!)

Related: Built a Safety Equipment Detection using YOLO.

Related: Face detection using google vision.


Discover more from Susiloharjo

Subscribe to get the latest posts sent to your email.

Discover more from Susiloharjo

Subscribe now to keep reading and get access to the full archive.

Continue reading