CoolFace
Modelpublic

Hansung-Cho/yolov8-ppe-detection

sourceHugging Facemitupdated 10mo agoView on Hugging Face
7likes3.7kdownloads
Model Card

🦺 YOLOv8 PPE Detection – End-to-End Safety Vision Model

Author: Hansung Cho Model: YOLOv8n fine-tuned for PPE (Personal Protective Equipment) detection on construction-like scenes.

이 λͺ¨λΈμ€ 건섀 ν˜„μž₯ λ“±μ˜ 이미지/μ˜μƒμ—μ„œ μ•ˆμ „λͺ¨(Hardhat), 마슀크, μ•ˆμ „μ‘°λΌ(Safety Vest), μ‚¬λžŒ(Person) λ“± PPE 착용 μ—¬λΆ€λ₯Ό νƒμ§€ν•˜κΈ° μœ„ν•΄ ν•™μŠ΅λœ YOLOv8 기반 객체 탐지 λͺ¨λΈμž…λ‹ˆλ‹€.

  • β€”Custom PPE dataset 기반 fine-tuning
  • β€”Web / FastAPI / WebcamκΉŒμ§€ μ—°λ™λœ End-to-End ν”„λ‘œμ νŠΈμ˜ 핡심 λͺ¨λΈ
  • β€”Hugging Face Hubμ—μ„œ λ°”λ‘œ λ‹€μš΄λ‘œλ“œ 및 μ‚¬μš© κ°€λŠ₯

🧠 Model Description

  • β€”Base model: YOLOv8n (Ultralytics)
  • β€”Task: Object Detection (Bounding Box)
  • β€”Domain: Construction site & industrial safety PPE detection
  • β€”Classes (μ˜ˆμ‹œ):
  • β€”Person
  • β€”Hardhat
  • β€”No-Hardhat
  • β€”Safety Vest
  • β€”No-Safety Vest
  • β€”Mask
  • β€”No-Mask
  • β€”+ 기타 PPE κ΄€λ ¨ 클래슀 (총 μ•½ 10개)

λ³Έ λͺ¨λΈμ€ μ‚¬λžŒ + PPE 착용 μ—¬λΆ€λ₯Ό λ™μ‹œμ— νƒμ§€ν•˜μ—¬ Web UI / Webcam / FastAPI μ„œλ²„μ—μ„œ μ‹€μ‹œκ°„ κ²½κ³  μ‹œμŠ€ν…œ ꡬ좕에 ν™œμš©λ  수 μžˆμŠ΅λ‹ˆλ‹€.


πŸ“Š Training & Evaluation

Validation μ„±λŠ₯ (YOLOv8n Fine-tuning, Validation Set κΈ°μ€€)

MetricScore
mAP@0.500.744
mAP@0.50:0.950.436
Precision0.831
Recall0.685

πŸ“ Training Data

  • β€”Public PPE / construction-related datasets (Kaggle λ“±)
  • β€”RGB 이미지
  • β€”Bounding box + class label
  • β€”Hardhat / No-Hardhat / Mask / No-Mask / Safety Vest / No-Safety Vest / Person λ“±
데이터셋 μžμ²΄λŠ” ν¬ν•¨ν•˜μ§€ μ•ŠμœΌλ©°, λΌμ΄μ„ μŠ€λŠ” 데이터 제곡처λ₯Ό λ”°λ¦…λ‹ˆλ‹€.

βš™οΈ How to Use

Ultralytics YOLO + Hugging Face Hub

python
from huggingface_hub import hf_hub_download
from ultralytics import YOLO

ckpt_path = hf_hub_download(
    repo_id="Hansung-Cho/yolov8-ppe-detection",
    filename="best.pt"
)

model = YOLO(ckpt_path)
results = model("your_image.jpg")
results[0].plot()

Command Line (CLI)

bash
yolo task=detect mode=predict \
    model="https://huggingface.co/Hansung-Cho/yolov8-ppe-detection/resolve/main/best.pt" \
    source="your_image_or_video.mp4" \
    conf=0.25

🎯 Intended Uses & Use Cases

Intended

  • —건섀 ν˜„μž₯ CCTV / Webcam λͺ¨λ‹ˆν„°λ§
  • β€”PPE 착용 μ—¬λΆ€ μžλ™ 점검
  • β€”μ•ˆμ „ ꡐ윑 PoC / 데λͺ¨
  • β€”FastAPI + Web UI μ‹€μ‹œκ°„ κ²½κ³  μ‹œμŠ€ν…œ

Not Intended

  • —법적 제재/μ§•κ³„μ˜ μœ μΌν•œ κ·Όκ±°
  • β€”μ˜λ£Œ/생λͺ… μ•ˆμ „μ˜ 단독 νŒλ‹¨ κΈ°μ€€
  • β€”μ™„μ „νžˆ λ‹€λ₯Έ 도메인(일상사진/슀포츠 λ“±)μ—μ„œ μ‚¬μš©

⚠️ Limitations & Ethical Considerations

  • —도메인 편ν–₯: μ‹€λ‚΄Β·μ•Όκ°„Β·νŠΉμˆ˜λ³΅μž₯ ν™˜κ²½μ—μ„œ μ„±λŠ₯ μ €ν•˜ κ°€λŠ₯
  • β€”Occlusion: κ°€λ €μ§„ 경우 μ˜€νƒ/미탐 κ°€λŠ₯
  • β€”Low Resolution: 멀리 μžˆλŠ” 인물 탐지 어렀움
  • β€”Ethical Use:
  • —보쑰적 검사 λ„κ΅¬λ‘œλ§Œ μ‚¬μš©ν•΄μ•Ό 함
  • β€”μΈκΆŒΒ·κ°œμΈμ •λ³΄ 보호λ₯Ό λ°˜λ“œμ‹œ κ³ λ €ν•΄μ•Ό 함

πŸ§ͺ Evaluation & Reproducibility

  • β€”Framework: Ultralytics YOLOv8 / PyTorch
  • β€”Hardware: Colab GPU / 단일 GPU
  • β€”Notebook: training/YOLO_PPE.ipynb

Visualization Assets

  • β€”Training curves (results.png)
  • β€”Confusion matrix (confusion_matrix.png)
  • β€”PR Curve (BoxPR_curve.png)
  • β€”F1 Curve (BoxF1_curve.png)
  • β€”Prediction example (example.png)

🧩 Integration Example (FastAPI + Web)

Backend

  • β€”FastAPI server (backend/app.py)
  • β€”/predict β†’ 이미지 μ—…λ‘œλ“œ ν›„ YOLO μΆ”λ‘ 
  • β€”bounding boxκ°€ ν¬ν•¨λœ κ²°κ³Όλ₯Ό base64둜 λ°˜ν™˜

Frontend

  • β€”HTML / JavaScript (index.html, webcam.html)
  • —이미지 μ—…λ‘œλ“œ / μ‹€μ‹œκ°„ Webcam 슀트림
  • β€”NO-Hardhat, NO-Mask λ“± μœ„ν—˜ μš”μ†Œ 감지

Local

  • β€”local/webcam_ppe.py β†’ 둜컬 μ›ΉμΊ  μ‹€μ‹œκ°„ 감지
전체 μ‹œμŠ€ν…œ κ΅¬ν˜„μ€ GitHub λ ˆν¬μ§€ν† λ¦¬μ—μ„œ 확인할 수 μžˆμŠ΅λ‹ˆλ‹€.

πŸ“š Citation

Cho, Hansung. "YOLOv8 PPE Detection – End-to-End AI System for Safety Monitoring."
Hugging Face Model Hub, 2025.

πŸ“¬ Contact & References

  • β€”GitHub Project Repository: https://github.com/Hansung-Cho/YOLO_PPE
  • β€”GitHub Profile: https://github.com/Hansung-Cho
  • β€”Model Page: https://huggingface.co/Hansung-Cho/yolov8-ppe-detection
  • β€”Ultralytics YOLOv8 Source: https://github.com/ultralytics/ultralytics

Feel free to open an issue or reach out for questions, collaboration, or improvements.