项目作者: ultralytics

项目描述 :
YOLOv3 in PyTorch > ONNX > CoreML > TFLite
高级语言: Python
项目地址: git://github.com/ultralytics/yolov3.git
创建时间: 2018-08-26T08:57:20Z
项目社区:https://github.com/ultralytics/yolov3

开源协议:GNU General Public License v3.0

下载





Ultralytics YOLOv3 banner



中文 | 한국어 | 日本語 | Русский | Deutsch | Français | Español | Português | Türkçe | Tiếng Việt | العربية


YOLOv3 CI
YOLOv3 Citation
Docker Pulls
Discord
Ultralytics Forums
Ultralytics Reddit


Run on Gradient
Open In Colab
Open In Kaggle




Ultralytics YOLOv3 is a robust and efficient computer vision model developed by Ultralytics. Built on the PyTorch framework, this implementation extends the original YOLOv3 architecture, renowned for its improvements in object detection speed and accuracy over earlier versions. It incorporates best practices and insights from extensive research, making it a reliable choice for a wide range of vision AI applications.

Explore the Ultralytics Docs for in-depth guidance (YOLOv3-specific docs may be limited, but general YOLO principles apply), open an issue on GitHub for support, and join our Discord community for questions and discussions!

For Enterprise License requests, please complete the form at Ultralytics Licensing.


Ultralytics GitHub
space
Ultralytics LinkedIn
space
Ultralytics Twitter
space
Ultralytics YouTube
space
Ultralytics TikTok
space
Ultralytics BiliBili
space
Ultralytics Discord





## 🚀 YOLO11: The Next Evolution

We are thrilled to introduce Ultralytics YOLO11 🚀, the latest advancement in our state-of-the-art vision models! Available now at the Ultralytics YOLO GitHub repository, YOLO11 continues our legacy of speed, precision, and user-friendly design. Whether you’re working on object detection, instance segmentation, pose estimation, image classification, or oriented object detection (OBB), YOLO11 delivers the performance and flexibility needed for modern computer vision tasks.

Get started today and unlock the full potential of YOLO11! Visit the Ultralytics Docs for comprehensive guides and resources:

PyPI version Downloads

bash # Install the ultralytics package pip install ultralytics

📚 Documentation

See the Ultralytics Docs for YOLOv3 for full documentation on training, testing, and deployment using the Ultralytics framework. While YOLOv3-specific documentation may be limited, the general YOLO principles apply. Below are quickstart examples adapted for YOLOv3 concepts.


Install

Clone the repository and install dependencies from requirements.txt in a Python>=3.8.0 environment. Ensure you have PyTorch>=1.8 installed. (Note: This repo is originally YOLOv5, dependencies should be compatible but tailored testing for YOLOv3 is recommended).

bash # Clone the YOLOv3 repository git clone https://github.com/ultralytics/yolov3 # Navigate to the cloned directory cd yolov3 # Install required packages pip install -r requirements.txt


Inference with PyTorch Hub

Use YOLOv3 via PyTorch Hub for inference. Models like yolov3.pt, yolov3-spp.pt, yolov3-tiny.pt can be loaded.

python import torch # Load a YOLOv3 model (e.g., yolov3, yolov3-spp) model = torch.hub.load("ultralytics/yolov3", "yolov3", pretrained=True) # specify 'yolov3' or other variants # Define the input image source (URL, local file, PIL image, OpenCV frame, numpy array, or list) img = "https://ultralytics.com/images/zidane.jpg" # Example image # Perform inference results = model(img) # Process the results (options: .print(), .show(), .save(), .crop(), .pandas()) results.print() # Print results to console results.show() # Display results in a window results.save() # Save results to runs/detect/exp


Inference with detect.py

The detect.py script runs inference on various sources. Use --weights yolov3.pt or other YOLOv3 variants. It automatically downloads models and saves results to runs/detect.

bash # Run inference using a webcam with yolov3-tiny python detect.py --weights yolov3-tiny.pt --source 0 # Run inference on a local image file with yolov3 python detect.py --weights yolov3.pt --source img.jpg # Run inference on a local video file with yolov3-spp python detect.py --weights yolov3-spp.pt --source vid.mp4 # Run inference on a screen capture python detect.py --weights yolov3.pt --source screen # Run inference on a directory of images python detect.py --weights yolov3.pt --source path/to/images/ # Run inference on a text file listing image paths python detect.py --weights yolov3.pt --source list.txt # Run inference on a text file listing stream URLs python detect.py --weights yolov3.pt --source list.streams # Run inference using a glob pattern for images python detect.py --weights yolov3.pt --source 'path/to/*.jpg' # Run inference on a YouTube video URL python detect.py --weights yolov3.pt --source 'https://youtu.be/LNwODJXcvt4' # Run inference on an RTSP, RTMP, or HTTP stream python detect.py --weights yolov3.pt --source 'rtsp://example.com/media.mp4'


Training

The commands below show how to train YOLOv3 models on the COCO dataset. Models and datasets are downloaded automatically. Use the largest --batch-size your hardware allows.

bash # Train YOLOv3-tiny on COCO for 300 epochs (example settings) python train.py --data coco.yaml --epochs 300 --weights '' --cfg yolov3-tiny.yaml --batch-size 64 # Train YOLOv3 on COCO for 300 epochs (example settings) python train.py --data coco.yaml --epochs 300 --weights '' --cfg yolov3.yaml --batch-size 32 # Train YOLOv3-SPP on COCO for 300 epochs (example settings) python train.py --data coco.yaml --epochs 300 --weights '' --cfg yolov3-spp.yaml --batch-size 16


Tutorials

Note: These tutorials primarily use YOLOv5 examples but the principles often apply to YOLOv3 within the Ultralytics framework.

- Train Custom Data 🚀 RECOMMENDED: Learn how to train models on your own datasets.
- Tips for Best Training Results ☘️: Improve your model’s performance with expert tips.
- Multi-GPU Training: Speed up training using multiple GPUs.
- PyTorch Hub Integration 🌟 NEW: Easily load models using PyTorch Hub.
- Model Export (TFLite, ONNX, CoreML, TensorRT) 🚀: Convert your models to various deployment formats.
- NVIDIA Jetson Deployment 🌟 NEW: Deploy models on NVIDIA Jetson devices.
- Test-Time Augmentation (TTA): Enhance prediction accuracy with TTA.
- Model Ensembling: Combine multiple models for better performance.
- Model Pruning/Sparsity: Optimize models for size and speed.
- Hyperparameter Evolution: Automatically find the best training hyperparameters.
- Transfer Learning with Frozen Layers: Adapt pretrained models to new tasks efficiently.
- Architecture Summary 🌟 NEW: Understand the model architecture (focus on YOLOv3 principles).
- Ultralytics HUB Training 🚀 RECOMMENDED: Train and deploy YOLO models using Ultralytics HUB.
- ClearML Logging: Integrate with ClearML for experiment tracking.
- Neural Magic DeepSparse Integration: Accelerate inference with DeepSparse.
- Comet Logging 🌟 NEW: Log experiments using Comet ML.

🧩 Integrations

Ultralytics offers robust integrations with leading AI platforms to enhance your workflow, including dataset labeling, training, visualization, and model management. Discover how Ultralytics, in collaboration with partners like Weights & Biases, Comet ML, Roboflow, and Intel OpenVINO, can optimize your AI projects. Explore more at Ultralytics Integrations.


Ultralytics active learning integrations




Ultralytics HUB 🌟 Weights & Biases Comet Neural Magic
Streamline YOLO workflows: Label, train, and deploy effortlessly with Ultralytics HUB. Try now! Track experiments, hyperparameters, and results with Weights & Biases. Free forever, Comet ML lets you save YOLO models, resume training, and interactively visualize predictions. Run YOLO inference up to 6x faster with Neural Magic DeepSparse.

⭐ Ultralytics HUB

Experience seamless AI development with Ultralytics HUB ⭐, the ultimate platform for building, training, and deploying computer vision models. Visualize datasets, train YOLOv3, YOLOv5, and YOLOv8 🚀 models, and deploy them to real-world applications without writing any code. Transform images into actionable insights using our advanced tools and user-friendly Ultralytics App. Start your journey for Free today!


Ultralytics HUB Platform Screenshot

🤔 Why YOLOv3?

YOLOv3 marked a major leap forward in real-time object detection at its release. Key advantages include:

  • Improved Accuracy: Enhanced detection of small objects compared to YOLOv2.
  • Multi-Scale Predictions: Detects objects at three different scales, boosting performance across varied object sizes.
  • Class Prediction: Uses logistic classifiers for object classes, enabling multi-label classification.
  • Feature Extractor: Employs a deeper network (Darknet-53) versus the Darknet-19 used in YOLOv2.

While newer models like YOLOv5 and YOLO11 offer further advancements, YOLOv3 remains a reliable and widely adopted baseline, efficiently implemented in PyTorch by Ultralytics.

☁️ Environments

Get started quickly with our pre-configured environments. Click the icons below for setup details.

🤝 Contribute

We welcome your contributions! Making YOLO models accessible and effective is a community effort. Please see our Contributing Guide to get started. Share your feedback through the Ultralytics Survey. Thank you to all our contributors for making Ultralytics YOLO better!

Ultralytics open-source contributors

📜 License

Ultralytics provides two licensing options to meet different needs:

  • AGPL-3.0 License: An OSI-approved open-source license ideal for academic research, personal projects, and testing. It promotes open collaboration and knowledge sharing. See the LICENSE file for details.
  • Enterprise License: Tailored for commercial applications, this license allows seamless integration of Ultralytics software and AI models into commercial products and services, bypassing the open-source requirements of AGPL-3.0. For commercial use cases, please contact us via Ultralytics Licensing.

📧 Contact

For bug reports and feature requests related to Ultralytics YOLO implementations, please visit GitHub Issues. For general questions, discussions, and community support, join our Discord server!



Ultralytics GitHub
space
Ultralytics LinkedIn
space
Ultralytics Twitter
space
Ultralytics YouTube
space
Ultralytics TikTok
space
Ultralytics BiliBili
space
Ultralytics Discord