Downloads · 30 days
0
turhancan97/yolov5-detect-trash-classification
yolov5-detect-trash-classification is a object detection model from turhancan97. Use it when you need objects located in an image. The card lists the license as mit.
<div align="center" <img width="416" alt="turhancan97/yolov5-detect-trash-classification" src="https://huggingface.co/turhancan97/yolov5-detect-trash-classification/resolve/main/example1.jpg" </div <div align="center"…
Downloads · 30 days
0
Access
Public
Updated Jul 9, 2023
Repo size
14.3 MB
Likes
7
Public
Click a slice to open those files.
.pt14.3 MB · 99%
From the Hugging Face model README
pip install -U yolov5
import yolov5
# load model
model = yolov5.load('turhancan97/yolov5-detect-trash-classification')
# 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=416)
# 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 416 --batch 16 --weights turhancan97/yolov5-detect-trash-classification --epochs 10