Meet YOLO26: next-gen vision AI.

Link to this sectionYOLOv5 퀵스타트 🚀#

Ultralytics YOLOv5와 함께 실시간 객체 탐지의 역동적인 세계로 여정을 떠나보십시오! 이 가이드는 YOLOv5를 마스터하려는 AI 애호가와 전문가들을 위한 포괄적인 시작점이 되도록 작성되었습니다. 초기 설정부터 고급 학습 기법까지 모든 내용을 다룹니다. 이 가이드를 마칠 때쯤이면 최첨단 딥러닝 방식을 사용하여 프로젝트에 YOLOv5를 자신 있게 구현할 지식을 갖추게 될 것입니다. 엔진을 점화하고 YOLOv5와 함께 비상할 준비를 하십시오!

Link to this section설치#

YOLOv5 저장소를 복제하고 환경을 설정하여 시작할 준비를 하십시오. 이를 통해 필요한 모든 요구 사항이 설치되었는지 확인할 수 있습니다. 이륙을 위해 Python>=3.8.0PyTorch>=1.8이 준비되었는지 확인하십시오. 이러한 기본 도구들은 YOLOv5를 효과적으로 실행하는 데 필수적입니다.

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

Link to this sectionPyTorch Hub를 활용한 추론#

Experience the simplicity of YOLOv5 PyTorch Hub inference, where models are seamlessly downloaded from the latest YOLOv5 release. This method leverages the power of PyTorch for easy model loading and execution, making it straightforward to get predictions.

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. Explore these in the Predict mode documentation.

Link to this sectiondetect.py를 활용한 추론#

Harness detect.py for versatile inference on various sources. It automatically fetches models from the latest YOLOv5 release and saves results with ease. This script is ideal for command-line usage and integrating YOLOv5 into larger systems, supporting inputs like images, videos, directories, webcams, and even live streams.

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

Link to this section학습#

Replicate the YOLOv5 COCO dataset benchmarks by following the training instructions below. The necessary models and datasets (like coco128.yaml or the full coco.yaml) are pulled directly from the latest YOLOv5 release. Training YOLOv5n/s/m/l/x on a V100 GPU should typically take 1/2/4/6/8 days respectively (note that Multi-GPU training setups work faster). Maximize performance by using the highest possible --batch-size or use --batch-size -1 for the YOLOv5 AutoBatch feature, which automatically finds the optimal batch size. The following batch sizes are ideal for V100-16GB GPUs. Refer to our configuration guide for details on model configuration files (*.yaml).

# Train YOLOv5n on COCO128 for 3 epochs
python train.py --data coco128.yaml --epochs 3 --weights yolov5n.pt --batch-size 128

# Train YOLOv5s on COCO for 300 epochs
python train.py --data coco.yaml --epochs 300 --weights '' --cfg yolov5s.yaml --batch-size 64

# Train YOLOv5m on COCO for 300 epochs
python train.py --data coco.yaml --epochs 300 --weights '' --cfg yolov5m.yaml --batch-size 40

# Train YOLOv5l on COCO for 300 epochs
python train.py --data coco.yaml --epochs 300 --weights '' --cfg yolov5l.yaml --batch-size 24

# Train YOLOv5x on COCO for 300 epochs
python train.py --data coco.yaml --epochs 300 --weights '' --cfg yolov5x.yaml --batch-size 16
YOLOv5 training curves for COCO dataset

결론적으로 YOLOv5는 객체 탐지를 위한 최첨단 도구일 뿐만 아니라, 시각적 이해를 통해 우리가 세상과 상호 작용하는 방식을 변화시키는 머신러닝의 힘을 증명하는 결과물입니다. 이 가이드를 진행하며 프로젝트에 YOLOv5를 적용하기 시작할 때, 여러분은 컴퓨터 비전 분야에서 놀라운 성과를 이룰 수 있는 기술 혁명의 최전선에 서 있다는 것을 기억하십시오. 더 많은 통찰력이나 동료 비전 전문가들의 지원이 필요하다면 개발자와 연구자들이 활발히 활동하는 저희 GitHub 저장소를 방문해 주십시오. 데이터셋 관리 및 코드 없는 모델 학습을 위해 Ultralytics Platform과 같은 추가 리소스를 탐색하거나, 실제 적용 사례와 영감을 얻으려면 솔루션 페이지를 확인해 보십시오. 계속해서 탐구하고 혁신하며 YOLOv5의 경이로움을 즐기십시오. 즐거운 탐지 되시길 바랍니다! 🌠🔍

댓글