Package: yolov5-icevision
YOLOv5 🚀 is a family of object detection architectures and models pretrained on the COCO dataset, and representsUltralyticsopen-source research into future vision AI methods, incorporating lessons learned and best practices evolved over thousands of hours of research and development.DocumentationSee theYOLOv5 Docsfor full documentation on training, testing and deployment.Quick Start ExamplesInstallPython>=3.6.0is required with allrequirements.txtinstalled includingPyTorch>=1.7:$gitclonehttps://github.com/ultralytics/yolov5
$cdyolov5
$pipinstall-rrequirements.txtInferenceInference with YOLOv5 andPyTorch Hub. Models automatically download
from thelatest YOLOv5 release.importtorch# Modelmodel=torch.hub.load('ultralytics/yolov5','yolov5s')# or yolov5m, yolov5l, yolov5x, custom# Imagesimg='https://ultralytics.com/images/zidane.jpg'# or file, Path, PIL, OpenCV, numpy, list# Inferenceresults=model(img)# Resultsresults.print()# or .show(), .save(), .crop(), .pandas(), etc.Inference with detect.pydetect.pyruns inference on a variety of sources, downloading models automatically from
thelatest YOLOv5 releaseand saving results toruns/detect.$pythondetect.py--source0# webcamfile.jpg# imagefile.mp4# videopath/# directorypath/*.jpg# glob'https://youtu.be/NUsoVlDFqZg'# YouTube'rtsp://example.com/media.mp4'# RTSP, RTMP, HTTP streamTrainingRun commands below to reproduce results
onCOCOdataset (dataset auto-downloads on
first use). Training times for YOLOv5s/m/l/x are 2/4/6/8 days on a single V100 (multi-GPU times faster). Use the
largest--batch-sizeyour GPU allows (batch sizes shown for 16 GB devices).$pythontrain.py--datacoco.yaml--cfgyolov5s.yaml--weights''--batch-size64yolov5m40yolov5l24yolov5x16TutorialsTrain Custom Data🚀 RECOMMENDEDTips for Best Training Results☘️
RECOMMENDEDWeights & Biases Logging🌟 NEWRoboflow for Datasets, Labeling, and Active Learning🌟 NEWMulti-GPU TrainingPyTorch Hub⭐ NEWTorchScript, ONNX, CoreML Export🚀Test-Time Augmentation (TTA)Model EnsemblingModel Pruning/SparsityHyperparameter EvolutionTransfer Learning with Frozen Layers⭐ NEWTensorRT DeploymentEnvironmentsGet started in seconds with our verified environments. Click each icon below for details.IntegrationsWeights and BiasesRoboflow ⭐ NEWAutomatically track and visualize all your YOLOv5 training runs in the cloud withWeights & BiasesLabel and automatically export your custom datasets directly to YOLOv5 for training withRoboflowWhy YOLOv5YOLOv5-P5 640 Figure (click to expand)Figure Notes (click to expand)COCO AP valdenotes mAP@0.5:0.95 metric measured on the 5000-imageCOCO val2017dataset over various inference sizes from 256 to 1536.GPU Speedmeasures average inference time per image onCOCO val2017dataset using aAWS p3.2xlargeV100 instance at batch-size 32.EfficientDetdata fromgoogle/automlat batch size 8.Reproducebypython val.py --task study --data coco.yaml --iou 0.7 --weights yolov5n6.pt yolov5s6.pt yolov5m6.pt yolov5l6.pt yolov5x6.ptPretrained CheckpointsModelsize(pixels)mAPval0.5:0.95mAPval0.5SpeedCPU b1(ms)SpeedV100 b1(ms)SpeedV100 b32(ms)params(M)FLOPs@640 (B)YOLOv5n64028.446.0456.30.61.94.5YOLOv5s64037.256.0986.40.97.216.5YOLOv5m64045.263.92248.21.721.249.0YOLOv5l64048.867.243010.12.746.5109.1YOLOv5x64050.768.976612.14.886.7205.7YOLOv5n6128034.050.71538.12.13.24.6YOLOv5s6128044.563.03858.23.616.812.6YOLOv5m6128051.069.088711.16.835.750.0YOLOv5l6128053.671.6178415.810.576.8111.4YOLOv5x6+TTA1280153654.755.472.472.33136-26.2-19.4-140.7-209.8-Table Notes (click to expand)All checkpoints are trained to 300 epochs with default settings and hyperparameters.mAPvalvalues are for single-model single-scale onCOCO val2017dataset.Reproduce bypython val.py --data coco.yaml --img 640 --conf 0.001 --iou 0.65Speedaveraged over COCO val images using aAWS p3.2xlargeinstance. NMS times (~1 ms/img) not included.Reproduce bypython val.py --data coco.yaml --img 640 --conf 0.25 --iou 0.45TTATest Time Augmentationincludes reflection and scale augmentations.Reproduce bypython val.py --data coco.yaml --img 1536 --iou 0.7 --augmentContributeWe love your input! We want to make contributing to YOLOv5 as easy and transparent as possible. Please see
ourContributing Guideto get started, and fill out
theYOLOv5 Surveyto provide
thoughts and feedback on your experience with YOLOv5. Thank you!ContactFor issues running YOLOv5 please visitGitHub Issues. For business or
professional support requests please visithttps://ultralytics.com/contact.