CoolFace
Modelpublic

yihong1120/Construction-Hazard-Detection

sourceHugging Faceagpl-3.0updated 2mo agoView on Hugging Face
13likes535downloads
Model Card

Construction-Hazard-Detection

YOLO26 construction-site safety detection models, with legacy YOLO11 checkpoints. The repository includes portable PyTorch and ONNX weights, plus TensorRT INT8 artifacts evaluated on the original, unaugmented validation split.

The full application, training utilities, and evaluation tooling live in the main project.

Project and data links

The GitHub repository contains the production services, training code, and deployment configuration. The Roboflow project is the dataset reference for this work; the validation images and labels used for the published metrics are not redistributed in this model repository.

[image]

Recommended artifacts

  • Use models/yolo26/pt/*.pt for the most portable Ultralytics workflow.
  • Use models/yolo26/onnx/*.onnx for ONNX Runtime or custom deployment.
  • Use models/yolo26/tensorrt/mixed/*.engine on the documented RTX 4090 environment when accuracy and TensorRT throughput both matter.
  • Treat models/yolo26/tensorrt/int8/*.engine as a lower-accuracy option. It is not recommended for the m or x variants on this validation set.

Labels

0: Hardhat 1: Mask 2: NO-Hardhat 3: NO-Mask 4: NO-Safety Vest 5: Person 6: Safety Cone 7: Safety Vest 8: machinery 9: utility pole 10: vehicle

Validation results

All results use 6,664 original validation images (61,458 instances), at imgsz=640, batch size 16. A duplicate label in one source annotation was removed automatically by Ultralytics during validation. The table reports box mAP50-95; the full precision, recall, mAP50, timing, checksum, and file size records are in evaluation/yolo26_precision.csv.

ModelParametersFP32FP16Mixed INT8/FP16Pure INT8
YOLO26n2,508,0900.47650.47640.46890.4368
YOLO26s9,956,3780.59960.59940.59560.5742
YOLO26m21,789,8500.58910.58890.58820.4979
YOLO26l26,193,3060.64820.64800.63610.6012
YOLO26x58,833,9780.66730.66700.66420.5560

FP16 is evaluated from the same PyTorch checkpoint as FP32. "Mixed" denotes a TensorRT INT8 engine whose YOLO Detect head stays FP16. "Pure INT8" quantizes the full graph. These are validation results, not an independent held-out test: the TensorRT calibration set is a 512-image, class-balanced sample from the same original validation split. See evaluation/README.md for the exact methodology and limitations.

Inference efficiency

The table below is a dedicated model-forward microbenchmark, measured with synchronized CUDA events after 50 warmup iterations and over 200 timed iterations. Each cell is batch 1 latency in milliseconds / batch 16 model-only throughput in images per second. Lower latency and higher throughput are better.

ModelFP32FP16Mixed INT8/FP16Pure INT8
YOLO26n2.16 ms / 2,325 img/s2.36 ms / 3,623 img/s1.02 ms / 7,303 img/s0.98 ms / 7,402 img/s
YOLO26s2.28 ms / 964 img/s2.38 ms / 1,727 img/s1.32 ms / 4,706 img/s1.22 ms / 5,240 img/s
YOLO26m3.26 ms / 385 img/s2.56 ms / 739 img/s1.80 ms / 2,223 img/s1.68 ms / 2,620 img/s
YOLO26l4.32 ms / 312 img/s3.64 ms / 598 img/s2.52 ms / 1,753 img/s2.39 ms / 2,002 img/s
YOLO26x8.05 ms / 158 img/s4.86 ms / 315 img/s2.86 ms / 1,019 img/s2.54 ms / 1,189 img/s

At batch 1, FP16 can be marginally slower for the smallest models because launch and datatype-conversion costs outweigh tensor-core gains. At batch 16, FP16 is consistently faster. These are model-forward timings, not camera-stream FPS: they exclude RTSP decode, frame acquisition, queueing, tracking, annotation, encoding, and browser playback. The raw benchmark, environment, and reproducible implementation are available in evaluation/yolo26_inference_benchmark.csv, evaluation/inference_benchmark_environment.json, and scripts/benchmark_yolo26_inference.py.

TensorRT compatibility

The published engines were built and tested on:

OS: Linux x86_64 GPU: NVIDIA GeForce RTX 4090 (compute capability 8.9) NVIDIA driver: 580.173.02 CUDA: 13.0 TensorRT: 11.1.0.106 PyTorch: 2.13.0+cu130 Ultralytics: 8.4.113 Engine profile: dynamic batch, max batch 16, imgsz 640

TensorRT engines are hardware-, runtime-, and platform-dependent. Rebuild an engine for another GPU or TensorRT environment rather than assuming it will load. Only deserialize engine files from a trusted release. The reproducible export implementation is available in the main project's export script.

Quick start

from huggingfacehub import hfhub_download from ultralytics import YOLO

checkpoint = hfhubdownload( repo_id="yihong1120/Construction-Hazard-Detection", filename="models/yolo26/pt/yolo26x.pt", ) model = YOLO(checkpoint) results = model("data/examples/demo.jpg", imgsz=640, conf=0.25)

For the compatible TensorRT environment:

from ultralytics import YOLO

model = YOLO("models/yolo26/tensorrt/mixed/yolo26x.engine") results = model("data/examples/demo.jpg", imgsz=640, conf=0.25)

Repository layout

models/ yolo26/ pt/ # FP32/FP16 runtime checkpoints onnx/ # Portable ONNX exports tensorrt/ mixed/ # INT8 backbone/neck with FP16 Detect head int8/ # Full-graph INT8 yolo11/ # Legacy PyTorch and ONNX checkpoints evaluation/ yolo26precision.csv # Raw metrics, artifact hashes, and validation timing yolo26inferencebenchmark.csv # CUDA-event latency and throughput environment.json # Evaluation software and hardware environment inferencebenchmarkenvironment.json README.md # Methodology and reproducibility instructions scripts/ evaluateyolo26precision.py benchmarkyolo26_inference.py

Intended use and limitations

These models support research and prototyping for construction safety monitoring. Detection quality depends on camera placement, lighting, occlusion, PPE appearance, and site-specific conditions. Evaluate on the target site before safety-critical use, and combine detections with tracking and appropriate human review.

The original validation images and annotations are not redistributed in this repository. Do not treat the published validation metrics as a replacement for an independently licensed and held-out test set.

License

This repository, its models, and the associated Ultralytics workflow are released under AGPL-3.0. Review the license obligations before using the models in a networked or commercial deployment.