콘텐츠로 건너뛰기

YOLOv5 빠른 시작 🚀

Embark on your journey into the dynamic realm of real-time object detection with YOLOv5! This guide is crafted to serve as a comprehensive starting point for AI enthusiasts and professionals aiming to master YOLOv5. From initial setup to advanced training techniques, we've got you covered. By the end of this guide, you'll have the knowledge to implement YOLOv5 into your projects confidently. Let's ignite the engines and soar into YOLOv5!

설치

리포지토리를 복제하고 환경을 설정하여 출시를 준비합니다. 이렇게 하면 필요한 모든 요구 사항이 설치됩니다. 다음이 있는지 확인합니다. Python>=3.8.0PyTorch>=1.8 이 준비되었는지 확인합니다.

git clone https://github.com/ultralytics/yolov5  # clone repository
cd yolov5
pip install -r requirements.txt  # install dependencies

Inference with PyTorch Hub

최신 YOLOv5 릴리스에서 모델을 원활하게 다운로드할 수 있는 YOLOv5 PyTorch 허브 추론의 간편함을 경험해 보세요.

import torch

# Model loading
model = torch.hub.load("ultralytics/yolov5", "yolov5s")  # Can be 'yolov5n' - 'yolov5x6', or 'custom'

# Inference on images
img = "https://ultralytics.com/images/zidane.jpg"  # Can be a file, Path, PIL, OpenCV, numpy, or list of images

# Run inference
results = model(img)

# Display results
results.print()  # Other options: .show(), .save(), .crop(), .pandas(), etc.

detect.py를 사용한 추론

하네스 detect.py 를 사용하여 다양한 소스에 대한 다양한 추론을 수행할 수 있습니다. 자동으로 다음을 가져옵니다. 모델 최신 YOLOv5 릴리스 를 클릭하고 결과를 쉽게 저장할 수 있습니다.

python detect.py --weights yolov5s.pt --source 0                               # webcam
                                               image.jpg                       # image
                                               video.mp4                       # video
                                               screen                          # screenshot
                                               path/                           # directory
                                               list.txt                        # list of images
                                               list.streams                    # list of streams
                                               'path/*.jpg'                    # glob
                                               'https://youtu.be/LNwODJXcvt4'  # YouTube
                                               'rtsp://example.com/media.mp4'  # RTSP, RTMP, HTTP stream

교육

복제 YOLOv5 COCO 벤치마크에 대한 자세한 내용은 아래 지침을 참조하세요. 필요한 모델 그리고 데이터 세트 에서 직접 가져온 것입니다. YOLOv5 릴리스. V100 GPU 에서 YOLOv5n/s/m/l/x를 교육하는 데는 일반적으로 각각 1/2/4/6/8일이 소요됩니다. 멀티GPU 설정이 더 빠르게 작동합니다). 가능한 최고 수준의 --batch-size 또는 --batch-size -1 에 대한 YOLOv5 자동 배치 feature. The following batch sizes are ideal for V100-16GB GPUs.

python train.py --data coco.yaml --epochs 300 --weights '' --cfg yolov5n.yaml  --batch-size 128
                                                                 yolov5s                    64
                                                                 yolov5m                    40
                                                                 yolov5l                    24
                                                                 yolov5x                    16

YOLO 교육 곡선

To conclude, YOLOv5 is not only a state-of-the-art tool for object detection but also a testament to the power of machine learning in transforming the way we interact with the world through visual understanding. As you progress through this guide and begin applying YOLOv5 to your projects, remember that you are at the forefront of a technological revolution, capable of achieving remarkable feats. Should you need further insights or support from fellow visionaries, you're invited to our GitHub repository home to a thriving community of developers and researchers. Keep exploring, keep innovating, and enjoy the marvels of YOLOv5. Happy detecting! 🌠🔍

📅 Created 11 months ago ✏️ Updated 29 days ago

댓글