Meet YOLO26: next-gen vision AI.

Link to this sectionUltralytics 설치#

Ultralytics는 pip, conda, Docker를 포함한 다양한 설치 방법을 제공합니다. 가장 최신 안정 버전을 사용하려면 ultralytics pip 패키지를 통해 YOLO를 설치하거나, 최신 개발 버전을 위해 Ultralytics GitHub 저장소를 클론(clone)하여 설치할 수 있습니다. Docker를 사용하면 격리된 컨테이너에서 패키지를 실행할 수 있어 로컬 설치 과정을 생략할 수 있습니다.



Watch: Ultralytics YOLO Quick Start Guide
설치

PyPI - Python Version

Install or update the ultralytics package using pip by running pip install -U ultralytics. For more details on the ultralytics package, visit the Python Package Index (PyPI).

PyPI - Version Downloads

# Install or upgrade the ultralytics package from PyPI
pip install -U ultralytics

ultralyticsUltralytics GitHub 저장소에서 직접 설치할 수도 있습니다. 이는 최신 개발 버전을 사용하려는 경우 유용합니다. Git 명령줄 도구가 설치되어 있는지 확인한 후 다음을 실행하십시오:

# Install the ultralytics package from GitHub
pip install git+https://github.com/ultralytics/ultralytics.git@main

의존성 목록은 ultralytics pyproject.toml 파일을 참조하십시오. 위의 모든 예제는 필요한 모든 의존성을 함께 설치합니다.

PyTorch 요구 사항은 운영 체제 및 CUDA 요구 사항에 따라 다르므로, PyTorch의 안내에 따라 PyTorch를 먼저 설치하십시오.

PyTorch installation selector for different platforms

Link to this section헤드리스(Headless) 서버 설치#

For server environments without a display (e.g., cloud VMs, Docker containers, CI/CD pipelines), use the ultralytics-opencv-headless package. This is identical to the standard ultralytics package but depends on opencv-python-headless instead of opencv-python, avoiding unnecessary GUI dependencies and potential libGL errors.

헤드리스 설치
pip install ultralytics-opencv-headless

두 패키지 모두 동일한 기능과 API를 제공합니다. 헤드리스 변형은 단순히 디스플레이 라이브러리가 필요한 OpenCV의 GUI 구성 요소만 제외합니다.

Link to this section고급 설치#

표준 설치 방법으로 대부분의 사용 사례를 다룰 수 있지만, 개발이나 사용자 지정 구성을 위해 더 맞춤화된 설정이 필요할 수 있습니다.

고급 방법

지속적인 사용자 지정 수정이 필요한 경우, Ultralytics 저장소를 포크하고 pyproject.toml이나 다른 코드를 변경한 뒤 포크에서 설치할 수 있습니다.

  1. Ultralytics GitHub 저장소를 본인의 GitHub 계정으로 포크하십시오.
  2. 본인의 포크를 로컬로 클론하십시오:
    git clone https://github.com/YOUR_USERNAME/ultralytics.git
    cd ultralytics
  3. 변경 사항을 위한 새 브랜치를 생성하십시오:
    git checkout -b my-custom-branch
  4. 필요에 따라 pyproject.toml 또는 다른 파일을 수정하십시오.
  5. 변경 사항을 커밋 및 푸시하십시오:
    git add .
    git commit -m "My custom changes"
    git push origin my-custom-branch
  6. 브랜치를 가리키는 git+https 구문을 사용하여 pip으로 설치하십시오:
    pip install git+https://github.com/YOUR_USERNAME/ultralytics.git@my-custom-branch

Link to this sectionCLI와 함께 Ultralytics 사용#

Ultralytics 명령줄 인터페이스(CLI)를 사용하면 Python 환경 없이도 간단한 한 줄 명령어로 작업을 수행할 수 있습니다. CLI는 사용자 지정이나 Python 코드가 필요 없으며, 터미널에서 yolo 명령어로 모든 작업을 실행할 수 있습니다. 명령줄에서 YOLO를 사용하는 방법에 대한 자세한 내용은 CLI 가이드를 참조하십시오.

예시

Ultralytics yolo 명령어는 다음 문법을 따릅니다:

yolo TASK MODE ARGS

모든 ARGS는 전체 Configuration Guide 또는 yolo cfg CLI 명령어를 통해 확인할 수 있습니다.

경고

Arguments must be passed as arg=value pairs, split by an equals = sign and delimited by spaces. Do not use -- argument prefixes or commas , between arguments.

  • yolo predict model=yolo26n.pt imgsz=640 conf=0.25
  • yolo predict model yolo26n.pt imgsz 640 conf 0.25 ❌ (= 누락)
  • yolo predict model=yolo26n.pt, imgsz=640, conf=0.25 ❌ (, 사용 금지)
  • yolo predict --model yolo26n.pt --imgsz 640 --conf 0.25 ❌ (-- 사용 금지)
  • yolo solution model=yolo26n.pt imgsz=640 conf=0.25 ❌ (use solutions, not solution)

CLI 가이드

Link to this sectionPython과 함께 Ultralytics 사용#

Ultralytics YOLO Python 인터페이스는 Python 프로젝트에 원활하게 통합되어 모델을 쉽게 로드, 실행 및 처리할 수 있도록 지원합니다. 단순성을 위해 설계된 Python 인터페이스를 통해 사용자는 객체 감지, 인스턴스 세그멘테이션, 시맨틱 세그멘테이션, 분류를 빠르게 구현할 수 있습니다. 이는 YOLO Python 인터페이스를 이러한 기능을 Python 프로젝트에 통합하기 위한 매우 가치 있는 도구로 만듭니다.

예를 들어, 몇 줄의 코드만으로 모델을 로드하고, 학습하고, 성능을 평가하며 ONNX 형식으로 내보낼 수 있습니다. Python 프로젝트 내에서 YOLO를 사용하는 방법에 대한 자세한 내용은 Python 가이드를 참조하십시오.

예시
from ultralytics import YOLO

# Create a new YOLO model from scratch
model = YOLO("yolo26n.yaml")

# Load a pretrained YOLO model (recommended for training)
model = YOLO("yolo26n.pt")

# Train the model using the 'coco8.yaml' dataset for 3 epochs
results = model.train(data="coco8.yaml", epochs=3)

# Evaluate the model's performance on the validation set
results = model.val()

# Perform object detection on an image using the model
results = model("https://ultralytics.com/images/bus.jpg")

# Export the model to ONNX format
success = model.export(format="onnx")

Python 가이드

Link to this sectionUltralytics 설정#

Ultralytics 라이브러리에는 실험을 세밀하게 제어할 수 있는 SettingsManager가 포함되어 있어 사용자가 설정을 쉽게 액세스하고 수정할 수 있습니다. 환경의 사용자 구성 디렉토리 내 JSON 파일에 저장된 이러한 설정은 Python 환경이나 명령줄 인터페이스(CLI)를 통해 확인하거나 수정할 수 있습니다.

Link to this section설정 확인#

현재 설정 구성을 보려면 다음을 수행하십시오:

설정 보기

Use Python to view your settings by importing the settings object from the ultralytics module. Print and return settings with these commands:

from ultralytics import settings

# View all settings
print(settings)

# Return a specific setting
value = settings["runs_dir"]

Link to this section설정 수정#

Ultralytics는 다음과 같은 방법으로 설정을 쉽게 수정할 수 있도록 지원합니다:

설정 업데이트

In Python, use the update method on the settings object:

from ultralytics import settings

# Update a setting
settings.update({"runs_dir": "/path/to/runs"})

# Update multiple settings
settings.update({"runs_dir": "/path/to/runs", "tensorboard": False})

# Reset settings to default values
settings.reset()

Link to this section설정 이해하기#

아래 표는 예시 값, 데이터 유형 및 설명을 포함하여 Ultralytics 내에서 조정 가능한 설정에 대한 개요를 보여줍니다.

이름예시 값데이터 유형설명
settings_version'0.0.6'strUltralytics settings version (distinct from the Ultralytics pip version)
datasets_dir'/path/to/datasets'str데이터셋이 저장되는 디렉토리
weights_dir'/path/to/weights'str모델 가중치가 저장되는 디렉토리
runs_dir'/path/to/runs'str실험 실행 결과가 저장되는 디렉토리
uuid'a1b2c3d4'str현재 설정에 대한 고유 식별자
syncTrueboolOption to sync analytics and crashes to Ultralytics Platform
api_key''strUltralytics Platform API Key
clearmlTrueboolOption to use ClearML logging
cometTrueboolOption to use Comet ML for experiment tracking and visualization
dvcTrueboolOption to use DVC for experiment tracking and version control
hubTrueboolOption to use Ultralytics Platform integration
mlflowTrueboolOption to use MLFlow for experiment tracking
neptuneTrueboolOption to use Neptune for experiment tracking
raytuneTrueboolOption to use Ray Tune for hyperparameter tuning
tensorboardFalseboolOption to use TensorBoard for visualization
wandbFalseboolOption to use Weights & Biases logging
vscode_msgTrueboolWhen a VS Code terminal is detected, enables a prompt to download the Ultralytics-Snippets extension.

프로젝트나 실험을 진행하면서 최적의 구성을 보장하기 위해 이 설정들을 다시 검토하십시오.

Link to this sectionFAQ#

Link to this sectionpip를 사용하여 Ultralytics를 어떻게 설치합니까?#

다음 명령어를 사용하여 pip로 Ultralytics를 설치하십시오:

pip install -U ultralytics

This installs the latest stable release of the ultralytics package from PyPI. To install the development version directly from GitHub:

pip install git+https://github.com/ultralytics/ultralytics.git

시스템에 Git 명령줄 도구가 설치되어 있는지 확인하십시오.

Link to this sectionconda를 사용하여 Ultralytics YOLO를 설치할 수 있습니까?#

네, 다음을 사용하여 conda로 Ultralytics YOLO를 설치할 수 있습니다:

conda install -c conda-forge ultralytics

이 방법은 pip에 대한 훌륭한 대안이며 다른 패키지와의 호환성을 보장합니다. CUDA 환경의 경우 충돌을 해결하기 위해 ultralytics, pytorch, pytorch-cuda를 함께 설치하십시오:

conda install -c pytorch -c nvidia -c conda-forge pytorch torchvision pytorch-cuda=11.8 ultralytics

더 자세한 지침은 Conda quickstart guide를 참조하십시오.

Link to this sectionDocker를 사용하여 Ultralytics YOLO를 실행하면 어떤 장점이 있습니까?#

Docker는 Ultralytics YOLO를 위해 격리된 일관된 환경을 제공하여 시스템 간 원활한 성능을 보장하고 로컬 설치의 복잡성을 피할 수 있게 합니다. 공식 Docker 이미지는 Docker Hub에서 GPU, CPU, ARM64, NVIDIA Jetson, Conda 버전을 사용할 수 있습니다. 최신 이미지를 가져와 실행하려면 다음을 사용하십시오:

# Pull the latest ultralytics image from Docker Hub
sudo docker pull ultralytics/ultralytics:latest

# Run the ultralytics image in a container with GPU support
sudo docker run -it --ipc=host --runtime=nvidia --gpus all ultralytics/ultralytics:latest

자세한 Docker 지침은 Docker quickstart guide를 참조하십시오.

Link to this section개발을 위해 Ultralytics 저장소를 어떻게 복제(clone)합니까?#

다음 명령어를 통해 Ultralytics 저장소를 복제하고 개발 환경을 설정하십시오:

# Clone the ultralytics repository
git clone https://github.com/ultralytics/ultralytics

# Navigate to the cloned directory
cd ultralytics

# Install the package in editable mode for development
pip install -e .

이를 통해 프로젝트에 기여하거나 최신 소스 코드로 실험할 수 있습니다. 자세한 내용은 Ultralytics GitHub repository를 방문하십시오.

Link to this sectionUltralytics YOLO CLI를 사용해야 하는 이유는 무엇입니까?#

Ultralytics YOLO CLI는 Python 코드 없이 객체 탐지 작업을 실행할 수 있게 하여 터미널에서 직접 학습, 검증, 예측을 위한 한 줄 명령어를 지원합니다. 기본 구문은 다음과 같습니다:

yolo TASK MODE ARGS

예를 들어, 탐지 모델을 학습하려면 다음을 사용하십시오:

yolo train data=coco8.yaml model=yolo26n.pt epochs=10 lr0=0.01

더 많은 명령어와 사용 예시는 전체 CLI Guide에서 확인하십시오.

댓글