This repository provides an integrated computer vision framework for infrastructure visual inspection, including:
- Quantitative bolt loosening assessment with full-range rotation measurement
- Surface appearance defect detection, including:
- Crack
- Rust
- Coating spalling / peeling
The framework is designed for engineering inspection scenarios and emphasizes reproducibility, robustness, and practical applicability.
The core pipeline is implemented in integration.py, which integrates multiple vision modules into a unified workflow.
The bolt loosening quantification framework consists of the following stages:
- YOLO-based bolt object detection
- Semantic segmentation of bolt regions
- Image super-resolution reconstruction to enhance local texture details
- SIFT-Bolt feature point generation, matching, and filtering
- Rotation angle calculation based on rigid-body transformation
Key capability:
- Full-range bolt rotation measurement within [0°, 360°)
- Overcomes the 0°–60° limitation of conventional flange-based 2D image methods
In addition to bolt loosening assessment, this repository provides YOLO-based visual inspection models for common surface defects, including:
- Crack detection / segmentation
- Rust detection / segmentation
- Coating spalling detection / segmentation
These defect detection modules can be executed independently or jointly with the bolt inspection pipeline.
.
├── README.md
├── requirements.txt
├── integration.py # main integrated pipeline
├── weights/ # model weights (public)
│ ├── bolts/
│ │ ├── detect/
│ │ │ └── bolt detection weight
│ │ └── segment/
│ │ └── bolt segmentation weight
│ └── surface defects segmentation weight
├── inference/
│ ├── rename.py
│ ├── surface image folder/
│ └── bolt image folder/
│ ├── first/
│ └── second/
├── SRGAN
│ ├── results/
│ │ └── SRGAN weight
│ └── test.py
├── ultralytics/ # your yolo file
├── bolt_vision.py
├── cut.py # crop from detection results
├── delete_broken_photo.py
├── detect.py
├── detect_s.py # surface defects segmentation
├── koutu.py # crop from segmentation results
├── models.py # SRGAN
├── segment.py
├── setup.py
├── show_result.py
├── sift_bolt.py
├── test_getpath.py
├── test_match.py
├── utils.py
└── wright_json.py
The datasets are hosted on Microsoft OneDrive and can be freely accessed for research and academic purposes:
- Bolt object detection - 18779 images, labeled as "jacketed bolts", "embedded bolts", and "missing" three classes
- Bolt segmentation and super-resolution reconstruction - 6000 images, labeled as "nuts", and "screw" two classes
- Surface defects segmentation : - 24511 images, labeled as "crack", "corrosion", and "spalling" three classes
All annotations follow the Ultralytics YOLO specification and can be directly used for detection and segmentation training.
The model weights trained in this study are publicly available via OneDrive:
- Bolt object detection:
- Bolt segmentation:
- Bolt super-resolution reconstruction:
- Surface defects segmentation:
Use this step if:
- Your image names are short (e.g.,
1.jpg,a.png) or not uniform - The two folders (
firstandsecond) do not share consistent ordering/naming - You want a deterministic, paired naming scheme for the bolt pipeline
python integration.py surface \
--source path/to/input_images \
--target path/to/output_results
python integration.py bolt \
--source1 path/to/first_inspection_images \
--source2 path/to/second_inspection_images \
--target path/to/output_results
This project makes use of the Ultralytics YOLO implementation for object detection and segmentation tasks.
If you use this repository, please also consider citing the Ultralytics YOLO framework:
@software{Jocher_Ultralytics_YOLO_2023,
author = {Jocher, Glenn and Chaurasia, Ayush and Qiu, Jing},
title = {Ultralytics YOLO},
year = {2023},
publisher = {GitHub},
url = {https://github.com/ultralytics/ultralytics}
}