Package: ultralyticsutils
UltralyticsYOLOv8is a cutting-edge, state-of-the-art (SOTA) model that builds upon the success of previous YOLO versions and introduces new features and improvements to further boost performance and flexibility. YOLOv8 is designed to be fast, accurate, and easy to use, making it an excellent choice for a wide range of object detection and tracking, instance segmentation, image classification and pose estimation tasks.We hope that the resources here will help you get the most out of YOLOv8. Please browse the YOLOv8Docsfor details, raise an issue onGitHubfor support, and join ourDiscordcommunity for questions and discussions!To request an Enterprise License please complete the form atUltralytics Licensing.DocumentationSee below for a quickstart installation and usage example, and see theYOLOv8 Docsfor full documentation on training, validation, prediction and deployment.InstallPip install the ultralytics package including allrequirementsin aPython>=3.8environment withPyTorch>=1.8.pipinstallultralyticsFor alternative installation methods includingConda,Docker, and Git, please refer to theQuickstart Guide.UsageCLIYOLOv8 may be used directly in the Command Line Interface (CLI) with ayolocommand:yolopredictmodel=yolov8n.ptsource='https://ultralytics.com/images/bus.jpg'yolocan be used for a variety of tasks and modes and accepts additional arguments, i.e.imgsz=640. See the YOLOv8CLI Docsfor examples.PythonYOLOv8 may also be used directly in a Python environment, and accepts the sameargumentsas in the CLI example above:fromultralyticsimportYOLO# Load a modelmodel=YOLO("yolov8n.yaml")# build a new model from scratchmodel=YOLO("yolov8n.pt")# load a pretrained model (recommended for training)# Use the modelmodel.train(data="coco128.yaml",epochs=3)# train the modelmetrics=model.val()# evaluate model performance on the validation setresults=model("https://ultralytics.com/images/bus.jpg")# predict on an imagepath=model.export(format="onnx")# export the model to ONNX formatSee YOLOv8Python Docsfor more examples.ModelsYOLOv8Detect,SegmentandPosemodels pretrained on theCOCOdataset are available here, as well as YOLOv8Classifymodels pretrained on theImageNetdataset.Trackmode is available for all Detect, Segment and Pose models.AllModelsdownload automatically from the latest Ultralyticsreleaseon first use.Detection (COCO)SeeDetection Docsfor usage examples with these models trained onCOCO, which include 80 pre-trained classes.Modelsize(pixels)mAPval50-95SpeedCPU ONNX(ms)SpeedA100 TensorRT(ms)params(M)FLOPs(B)YOLOv8n64037.380.40.993.28.7YOLOv8s64044.9128.41.2011.228.6YOLOv8m64050.2234.71.8325.978.9YOLOv8l64052.9375.22.3943.7165.2YOLOv8x64053.9479.13.5368.2257.8mAPvalvalues are for single-model single-scale onCOCO val2017dataset.Reproduce byyolo val detect data=coco.yaml device=0Speedaveraged over COCO val images using anAmazon EC2 P4dinstance.Reproduce byyolo val detect data=coco.yaml batch=1 device=0|cpuDetection (Open Image V7)SeeDetection Docsfor usage examples with these models trained onOpen Image V7, which include 600 pre-trained classes.Modelsize(pixels)mAPval50-95SpeedCPU ONNX(ms)SpeedA100 TensorRT(ms)params(M)FLOPs(B)YOLOv8n64018.4142.41.213.510.5YOLOv8s64027.7183.11.4011.429.7YOLOv8m64033.6408.52.2626.280.6YOLOv8l64034.9596.92.4344.1167.4YOLOv8x64036.3860.63.5668.7260.6mAPvalvalues are for single-model single-scale onOpen Image V7dataset.Reproduce byyolo val detect data=open-images-v7.yaml device=0Speedaveraged over COCO val images using anAmazon EC2 P4dinstance.Reproduce byyolo val detect data=open-images-v7.yaml batch=1 device=0|cpuSegmentation (COCO)SeeSegmentation Docsfor usage examples with these models trained onCOCO-Seg, which include 80 pre-trained classes.Modelsize(pixels)mAPbox50-95mAPmask50-95SpeedCPU ONNX(ms)SpeedA100 TensorRT(ms)params(M)FLOPs(B)YOLOv8n-seg64036.730.596.11.213.412.6YOLOv8s-seg64044.636.8155.71.4711.842.6YOLOv8m-seg64049.940.8317.02.1827.3110.2YOLOv8l-seg64052.342.6572.42.7946.0220.5YOLOv8x-seg64053.443.4712.14.0271.8344.1mAPvalvalues are for single-model single-scale onCOCO val2017dataset.Reproduce byyolo val segment data=coco-seg.yaml device=0Speedaveraged over COCO val images using anAmazon EC2 P4dinstance.Reproduce byyolo val segment data=coco-seg.yaml batch=1 device=0|cpuPose (COCO)SeePose Docsfor usage examples with these models trained onCOCO-Pose, which include 1 pre-trained class, person.Modelsize(pixels)mAPpose50-95mAPpose50SpeedCPU ONNX(ms)SpeedA100 TensorRT(ms)params(M)FLOPs(B)YOLOv8n-pose64050.480.1131.81.183.39.2YOLOv8s-pose64060.086.2233.21.4211.630.2YOLOv8m-pose64065.088.8456.32.0026.481.0YOLOv8l-pose64067.690.0784.52.5944.4168.6YOLOv8x-pose64069.290.21607.13.7369.4263.2YOLOv8x-pose-p6128071.691.24088.710.0499.11066.4mAPvalvalues are for single-model single-scale onCOCO Keypoints val2017dataset.Reproduce byyolo val pose data=coco-pose.yaml device=0Speedaveraged over COCO val images using anAmazon EC2 P4dinstance.Reproduce byyolo val pose data=coco-pose.yaml batch=1 device=0|cpuClassification (ImageNet)SeeClassification Docsfor usage examples with these models trained onImageNet, which include 1000 pretrained classes.Modelsize(pixels)acctop1acctop5SpeedCPU ONNX(ms)SpeedA100 TensorRT(ms)params(M)FLOPs(B) at 640YOLOv8n-cls22466.687.012.90.312.74.3YOLOv8s-cls22472.391.123.40.356.413.5YOLOv8m-cls22476.493.285.40.6217.042.7YOLOv8l-cls22478.094.1163.00.8737.599.7YOLOv8x-cls22478.494.3232.01.0157.4154.8accvalues are model accuracies on theImageNetdataset validation set.Reproduce byyolo val classify data=path/to/ImageNet device=0Speedaveraged over ImageNet val images using anAmazon EC2 P4dinstance.Reproduce byyolo val classify data=path/to/ImageNet batch=1 device=0|cpuIntegrationsOur key integrations with leading AI platforms extend the functionality of Ultralytics' offerings, enhancing tasks like dataset labeling, training, visualization, and model management. Discover how Ultralytics, in collaboration withRoboflow, ClearML,Comet, Neural Magic andOpenVINO, can optimize your AI workflow.RoboflowClearML ⭐ NEWComet ⭐ NEWNeural Magic ⭐ NEWLabel and export your custom datasets directly to YOLOv8 for training withRoboflowAutomatically track, visualize and even remotely train YOLOv8 usingClearML(open-source!)Free forever,Cometlets you save YOLOv8 models, resume training, and interactively visualize and debug predictionsRun YOLOv8 inference up to 6x faster withNeural Magic DeepSparseUltralytics HUBExperience seamless AI withUltralytics HUB⭐, the all-in-one solution for data visualization, YOLOv5 and YOLOv8 🚀 model training and deployment, without any coding. Transform images into actionable insights and bring your AI visions to life with ease using our cutting-edge platform and user-friendlyUltralytics App. Start your journey forFreenow!ContributeWe love your input! YOLOv5 and YOLOv8 would not be possible without help from our community. Please see ourContributing Guideto get started, and fill out ourSurveyto send us feedback on your experience. Thank you 🙏 to all our contributors!LicenseUltralytics offers two licensing options to accommodate diverse use cases:AGPL-3.0 License: ThisOSI-approvedopen-source license is ideal for students and enthusiasts, promoting open collaboration and knowledge sharing. See theLICENSEfile for more details.Enterprise License: Designed for commercial use, this license permits seamless integration of Ultralytics software and AI models into commercial goods and services, bypassing the open-source requirements of AGPL-3.0. If your scenario involves embedding our solutions into a commercial offering, reach out throughUltralytics Licensing.ContactFor Ultralytics bug reports and feature requests please visitGitHub Issues, and join ourDiscordcommunity for questions and discussions!