Downloads · 30 days
17
1% of all-time downloads
uisikdag/yolo-v5-hard-hat-detection
yolo-v5-hard-hat-detection is a object detection model from uisikdag. Use it when you need objects located in an image. It is set up for yolov5.
<div align="center" <img width="640" alt="uisikdag/hardhat" src="https://huggingface.co/uisikdag/hardhat/resolve/main/samplevisuals.jpg" Dataset: <br<a href="https://universe.roboflow.com/roboflow-universe-projects/ha…
Downloads · 30 days
17
1% of all-time downloads
All-time downloads
2.2K
Public
Repo size
42.7 MB
Likes
3
Public
Click a slice to open those files.
.pt42.2 MB · 97%
From the Hugging Face model README
pip install -U yolov5
import yolov5
# load model
model = yolov5.load('uisikdag/hardhat')
# set model parameters
model.conf = 0.25 # NMS confidence threshold
model.iou = 0.45 # NMS IoU threshold
model.agnostic = False # NMS class-agnostic
model.multi_label = False # NMS multiple labels per box
model.max_det = 1000 # maximum number of detections per image
# set image
img = 'https://github.com/ultralytics/yolov5/raw/master/data/images/zidane.jpg'
# perform inference
results = model(img, size=640)
# inference with test time augmentation
results = model(img, augment=True)
# parse results
predictions = results.pred[0]
boxes = predictions[:, :4] # x1, y1, x2, y2
scores = predictions[:, 4]
categories = predictions[:, 5]
# show detection bounding boxes on image
results.show()
# save results into "results/" folder
results.save(save_dir='results/')
yolov5 train --data data.yaml --img 640 --batch 16 --weights uisikdag/hardhat --epochs 10
More models available at: awesome-yolov5-models