毕业设计GeoYolo-SLAM
This commit is contained in:
parent
af142160bf
commit
a273064db4
96
ultralytics/.github/ISSUE_TEMPLATE/bug-report.yml
vendored
Executable file
96
ultralytics/.github/ISSUE_TEMPLATE/bug-report.yml
vendored
Executable file
@ -0,0 +1,96 @@
|
||||
name: 🐛 Bug Report
|
||||
# title: " "
|
||||
description: Problems with YOLOv8
|
||||
labels: [bug, triage]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thank you for submitting a YOLOv8 🐛 Bug Report!
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Search before asking
|
||||
description: >
|
||||
Please search the Ultralytics [Docs](https://docs.ultralytics.com) and [issues](https://github.com/ultralytics/ultralytics/issues) to see if a similar bug report already exists.
|
||||
options:
|
||||
- label: >
|
||||
I have searched the YOLOv8 [issues](https://github.com/ultralytics/ultralytics/issues) and found no similar bug report.
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: YOLOv8 Component
|
||||
description: |
|
||||
Please select the part of YOLOv8 where you found the bug.
|
||||
multiple: true
|
||||
options:
|
||||
- "Install"
|
||||
- "Train"
|
||||
- "Val"
|
||||
- "Predict"
|
||||
- "Export"
|
||||
- "Multi-GPU"
|
||||
- "Augmentation"
|
||||
- "Hyperparameter Tuning"
|
||||
- "Integrations"
|
||||
- "Other"
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Bug
|
||||
description: Provide console output with error messages and/or screenshots of the bug.
|
||||
placeholder: |
|
||||
💡 ProTip! Include as much information as possible (screenshots, logs, tracebacks etc.) to receive the most helpful response.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Environment
|
||||
description: Please specify the software and hardware you used to produce the bug.
|
||||
placeholder: |
|
||||
Paste output of `yolo checks` or `ultralytics.checks()` command, i.e.:
|
||||
```
|
||||
Ultralytics YOLOv8.0.181 🚀 Python-3.11.2 torch-2.0.1 CPU (Apple M2)
|
||||
Setup complete ✅ (8 CPUs, 16.0 GB RAM, 266.5/460.4 GB disk)
|
||||
|
||||
OS macOS-13.5.2
|
||||
Environment Jupyter
|
||||
Python 3.11.2
|
||||
Install git
|
||||
RAM 16.00 GB
|
||||
CPU Apple M2
|
||||
CUDA None
|
||||
```
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Minimal Reproducible Example
|
||||
description: >
|
||||
When asking a question, people will be better able to provide help if you provide code that they can easily understand and use to **reproduce** the problem.
|
||||
This is referred to by community members as creating a [minimal reproducible example](https://docs.ultralytics.com/help/minimum_reproducible_example/).
|
||||
placeholder: |
|
||||
```
|
||||
# Code to reproduce your issue here
|
||||
```
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional
|
||||
description: Anything else you would like to share?
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Are you willing to submit a PR?
|
||||
description: >
|
||||
(Optional) We encourage you to submit a [Pull Request](https://github.com/ultralytics/ultralytics/pulls) (PR) to help improve YOLOv8 for everyone, especially if you have a good understanding of how to implement a fix or feature.
|
||||
See the YOLOv8 [Contributing Guide](https://docs.ultralytics.com/help/contributing) to get started.
|
||||
options:
|
||||
- label: Yes I'd like to help by submitting a PR!
|
2
ultralytics/.github/ISSUE_TEMPLATE/bug-report.yml:Zone.Identifier
vendored
Executable file
2
ultralytics/.github/ISSUE_TEMPLATE/bug-report.yml:Zone.Identifier
vendored
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
11
ultralytics/.github/ISSUE_TEMPLATE/config.yml
vendored
Executable file
11
ultralytics/.github/ISSUE_TEMPLATE/config.yml
vendored
Executable file
@ -0,0 +1,11 @@
|
||||
blank_issues_enabled: true
|
||||
contact_links:
|
||||
- name: 📄 Docs
|
||||
url: https://docs.ultralytics.com/
|
||||
about: Full Ultralytics YOLOv8 Documentation
|
||||
- name: 💬 Forum
|
||||
url: https://community.ultralytics.com/
|
||||
about: Ask on Ultralytics Community Forum
|
||||
- name: 🎧 Discord
|
||||
url: https://ultralytics.com/discord
|
||||
about: Ask on Ultralytics Discord
|
2
ultralytics/.github/ISSUE_TEMPLATE/config.yml:Zone.Identifier
vendored
Executable file
2
ultralytics/.github/ISSUE_TEMPLATE/config.yml:Zone.Identifier
vendored
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
50
ultralytics/.github/ISSUE_TEMPLATE/feature-request.yml
vendored
Executable file
50
ultralytics/.github/ISSUE_TEMPLATE/feature-request.yml
vendored
Executable file
@ -0,0 +1,50 @@
|
||||
name: 🚀 Feature Request
|
||||
description: Suggest a YOLOv8 idea
|
||||
# title: " "
|
||||
labels: [enhancement]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thank you for submitting a YOLOv8 🚀 Feature Request!
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Search before asking
|
||||
description: >
|
||||
Please search the Ultralytics [Docs](https://docs.ultralytics.com) and [issues](https://github.com/ultralytics/ultralytics/issues) to see if a similar feature request already exists.
|
||||
options:
|
||||
- label: >
|
||||
I have searched the YOLOv8 [issues](https://github.com/ultralytics/ultralytics/issues) and found no similar feature requests.
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Description
|
||||
description: A short description of your feature.
|
||||
placeholder: |
|
||||
What new feature would you like to see in YOLOv8?
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Use case
|
||||
description: |
|
||||
Describe the use case of your feature request. It will help us understand and prioritize the feature request.
|
||||
placeholder: |
|
||||
How would this feature be used, and who would use it?
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional
|
||||
description: Anything else you would like to share?
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Are you willing to submit a PR?
|
||||
description: >
|
||||
(Optional) We encourage you to submit a [Pull Request](https://github.com/ultralytics/ultralytics/pulls) (PR) to help improve YOLOv8 for everyone, especially if you have a good understanding of how to implement a fix or feature.
|
||||
See the YOLOv8 [Contributing Guide](https://docs.ultralytics.com/help/contributing) to get started.
|
||||
options:
|
||||
- label: Yes I'd like to help by submitting a PR!
|
2
ultralytics/.github/ISSUE_TEMPLATE/feature-request.yml:Zone.Identifier
vendored
Executable file
2
ultralytics/.github/ISSUE_TEMPLATE/feature-request.yml:Zone.Identifier
vendored
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
33
ultralytics/.github/ISSUE_TEMPLATE/question.yml
vendored
Executable file
33
ultralytics/.github/ISSUE_TEMPLATE/question.yml
vendored
Executable file
@ -0,0 +1,33 @@
|
||||
name: ❓ Question
|
||||
description: Ask a YOLOv8 question
|
||||
# title: " "
|
||||
labels: [question]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thank you for asking a YOLOv8 ❓ Question!
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Search before asking
|
||||
description: >
|
||||
Please search the Ultralytics [Docs](https://docs.ultralytics.com), [issues](https://github.com/ultralytics/ultralytics/issues) and [discussions](https://github.com/ultralytics/ultralytics/discussions) to see if a similar question already exists.
|
||||
options:
|
||||
- label: >
|
||||
I have searched the YOLOv8 [issues](https://github.com/ultralytics/ultralytics/issues) and [discussions](https://github.com/ultralytics/ultralytics/discussions) and found no similar questions.
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Question
|
||||
description: What is your question?
|
||||
placeholder: |
|
||||
💡 ProTip! Include as much information as possible (screenshots, logs, tracebacks etc.) to receive the most helpful response.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional
|
||||
description: Anything else you would like to share?
|
2
ultralytics/.github/ISSUE_TEMPLATE/question.yml:Zone.Identifier
vendored
Executable file
2
ultralytics/.github/ISSUE_TEMPLATE/question.yml:Zone.Identifier
vendored
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
27
ultralytics/.github/dependabot.yml
vendored
Executable file
27
ultralytics/.github/dependabot.yml
vendored
Executable file
@ -0,0 +1,27 @@
|
||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
# Dependabot for package version updates
|
||||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: pip
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: weekly
|
||||
time: "04:00"
|
||||
open-pull-requests-limit: 10
|
||||
reviewers:
|
||||
- glenn-jocher
|
||||
labels:
|
||||
- dependencies
|
||||
|
||||
- package-ecosystem: github-actions
|
||||
directory: "/.github/workflows"
|
||||
schedule:
|
||||
interval: weekly
|
||||
time: "04:00"
|
||||
open-pull-requests-limit: 5
|
||||
reviewers:
|
||||
- glenn-jocher
|
||||
labels:
|
||||
- dependencies
|
2
ultralytics/.github/dependabot.yml:Zone.Identifier
vendored
Executable file
2
ultralytics/.github/dependabot.yml:Zone.Identifier
vendored
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
280
ultralytics/.github/workflows/ci.yaml
vendored
Executable file
280
ultralytics/.github/workflows/ci.yaml
vendored
Executable file
@ -0,0 +1,280 @@
|
||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
# YOLO Continuous Integration (CI) GitHub Actions tests
|
||||
|
||||
name: Ultralytics CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
schedule:
|
||||
- cron: '0 0 * * *' # runs at 00:00 UTC every day
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
hub:
|
||||
description: 'Run HUB'
|
||||
default: false
|
||||
type: boolean
|
||||
benchmarks:
|
||||
description: 'Run Benchmarks'
|
||||
default: false
|
||||
type: boolean
|
||||
tests:
|
||||
description: 'Run Tests'
|
||||
default: false
|
||||
type: boolean
|
||||
gpu:
|
||||
description: 'Run GPU'
|
||||
default: false
|
||||
type: boolean
|
||||
conda:
|
||||
description: 'Run Conda'
|
||||
default: false
|
||||
type: boolean
|
||||
|
||||
jobs:
|
||||
HUB:
|
||||
if: github.repository == 'ultralytics/ultralytics' && (github.event_name == 'schedule' || github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.hub == 'true'))
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
python-version: ['3.11']
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
cache: 'pip' # caching pip dependencies
|
||||
- name: Install requirements
|
||||
shell: bash # for Windows compatibility
|
||||
run: |
|
||||
python -m pip install --upgrade pip wheel
|
||||
pip install -e . --extra-index-url https://download.pytorch.org/whl/cpu
|
||||
- name: Check environment
|
||||
run: |
|
||||
yolo checks
|
||||
pip list
|
||||
- name: Test HUB training
|
||||
shell: python
|
||||
env:
|
||||
API_KEY: ${{ secrets.ULTRALYTICS_HUB_API_KEY }}
|
||||
MODEL_ID: ${{ secrets.ULTRALYTICS_HUB_MODEL_ID }}
|
||||
run: |
|
||||
import os
|
||||
from ultralytics import YOLO, hub
|
||||
api_key, model_id = os.environ['API_KEY'], os.environ['MODEL_ID']
|
||||
hub.login(api_key)
|
||||
hub.reset_model(model_id)
|
||||
model = YOLO('https://hub.ultralytics.com/models/' + model_id)
|
||||
model.train()
|
||||
- name: Test HUB inference API
|
||||
shell: python
|
||||
env:
|
||||
API_KEY: ${{ secrets.ULTRALYTICS_HUB_API_KEY }}
|
||||
MODEL_ID: ${{ secrets.ULTRALYTICS_HUB_MODEL_ID }}
|
||||
run: |
|
||||
import os
|
||||
import requests
|
||||
import json
|
||||
api_key, model_id = os.environ['API_KEY'], os.environ['MODEL_ID']
|
||||
url = f"https://api.ultralytics.com/v1/predict/{model_id}"
|
||||
headers = {"x-api-key": api_key}
|
||||
data = {"size": 320, "confidence": 0.25, "iou": 0.45}
|
||||
with open("ultralytics/assets/zidane.jpg", "rb") as f:
|
||||
response = requests.post(url, headers=headers, data=data, files={"image": f})
|
||||
assert response.status_code == 200, f'Status code {response.status_code}, Reason {response.reason}'
|
||||
print(json.dumps(response.json(), indent=2))
|
||||
|
||||
Benchmarks:
|
||||
if: github.event_name != 'workflow_dispatch' || github.event.inputs.benchmarks == 'true'
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
python-version: ['3.10']
|
||||
model: [yolov8n]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
cache: 'pip' # caching pip dependencies
|
||||
- name: Install requirements
|
||||
shell: bash # for Windows compatibility
|
||||
run: |
|
||||
python -m pip install --upgrade pip wheel
|
||||
pip install -e ".[export]" coverage --extra-index-url https://download.pytorch.org/whl/cpu
|
||||
# Fix SavedModel issue "partially initialized module 'jax' has no attribute 'version' (most likely due to a circular import)" in https://github.com/google/jax/discussions/14036
|
||||
# pip install -U 'jax!=0.4.15' 'jaxlib!=0.4.15'
|
||||
yolo export format=tflite imgsz=32 || true
|
||||
- name: Check environment
|
||||
run: |
|
||||
yolo checks
|
||||
pip list
|
||||
# - name: Benchmark DetectionModel
|
||||
# shell: bash
|
||||
# run: coverage run -a --source=ultralytics -m ultralytics.cfg.__init__ benchmark model='path with spaces/${{ matrix.model }}.pt' imgsz=160 verbose=0.318
|
||||
- name: Benchmark SegmentationModel
|
||||
shell: bash
|
||||
run: coverage run -a --source=ultralytics -m ultralytics.cfg.__init__ benchmark model='path with spaces/${{ matrix.model }}-seg.pt' imgsz=160 verbose=0.286
|
||||
- name: Benchmark ClassificationModel
|
||||
shell: bash
|
||||
run: coverage run -a --source=ultralytics -m ultralytics.cfg.__init__ benchmark model='path with spaces/${{ matrix.model }}-cls.pt' imgsz=160 verbose=0.166
|
||||
- name: Benchmark PoseModel
|
||||
shell: bash
|
||||
run: coverage run -a --source=ultralytics -m ultralytics.cfg.__init__ benchmark model='path with spaces/${{ matrix.model }}-pose.pt' imgsz=160 verbose=0.185
|
||||
- name: Merge Coverage Reports
|
||||
run: |
|
||||
coverage xml -o coverage-benchmarks.xml
|
||||
- name: Upload Coverage Reports to CodeCov
|
||||
if: github.repository == 'ultralytics/ultralytics'
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
flags: Benchmarks
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
- name: Benchmark Summary
|
||||
run: |
|
||||
cat benchmarks.log
|
||||
echo "$(cat benchmarks.log)" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
Tests:
|
||||
if: github.event_name != 'workflow_dispatch' || github.event.inputs.tests == 'true'
|
||||
timeout-minutes: 60
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
python-version: ['3.11']
|
||||
torch: [latest]
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
python-version: '3.8' # torch 1.8.0 requires python >=3.6, <=3.8
|
||||
torch: '1.8.0' # min torch version CI https://pypi.org/project/torchvision/
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
cache: 'pip' # caching pip dependencies
|
||||
- name: Install requirements
|
||||
shell: bash # for Windows compatibility
|
||||
run: | # CoreML must be installed before export due to protobuf error from AutoInstall
|
||||
python -m pip install --upgrade pip wheel
|
||||
torch=""
|
||||
if [ "${{ matrix.torch }}" == "1.8.0" ]; then
|
||||
torch="torch==1.8.0 torchvision==0.9.0"
|
||||
fi
|
||||
pip install -e . $torch pytest-cov "coremltools>=7.0" --extra-index-url https://download.pytorch.org/whl/cpu
|
||||
- name: Check environment
|
||||
run: |
|
||||
yolo checks
|
||||
pip list
|
||||
- name: Pytest tests
|
||||
shell: bash # for Windows compatibility
|
||||
run: |
|
||||
slow=""
|
||||
if [[ "${{ github.event_name }}" == "schedule" ]] || [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
|
||||
pip install mlflow pycocotools 'ray[tune]'
|
||||
slow="--slow"
|
||||
fi
|
||||
pytest $slow --cov=ultralytics/ --cov-report xml tests/
|
||||
- name: Upload Coverage Reports to CodeCov
|
||||
if: github.repository == 'ultralytics/ultralytics' # && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
flags: Tests
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
GPU:
|
||||
if: github.repository == 'ultralytics/ultralytics' && (github.event_name != 'workflow_dispatch' || github.event.inputs.gpu == 'true')
|
||||
timeout-minutes: 60
|
||||
runs-on: gpu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install requirements
|
||||
run: pip install -e .
|
||||
- name: Check environment
|
||||
run: |
|
||||
yolo checks
|
||||
pip list
|
||||
- name: Pytest tests
|
||||
run: pytest --cov=ultralytics/ --cov-report xml tests/test_cuda.py
|
||||
- name: Upload Coverage Reports to CodeCov
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
flags: GPU
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
Conda:
|
||||
if: github.repository == 'ultralytics/ultralytics' && (github.event_name == 'schedule_disabled' || github.event.inputs.conda == 'true')
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
python-version: ['3.11']
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -el {0}
|
||||
steps:
|
||||
- uses: conda-incubator/setup-miniconda@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
mamba-version: "*"
|
||||
channels: conda-forge,defaults
|
||||
channel-priority: true
|
||||
activate-environment: anaconda-client-env
|
||||
- name: Install Libmamba
|
||||
run: |
|
||||
conda config --set solver libmamba
|
||||
- name: Install Ultralytics package from conda-forge
|
||||
run: |
|
||||
conda install -c pytorch -c conda-forge pytorch torchvision ultralytics openvino
|
||||
- name: Install pip packages
|
||||
run: |
|
||||
pip install pytest 'coremltools>=7.0'
|
||||
- name: Check environment
|
||||
run: |
|
||||
conda list
|
||||
- name: Test CLI
|
||||
run: |
|
||||
yolo predict model=yolov8n.pt imgsz=320
|
||||
yolo train model=yolov8n.pt data=coco8.yaml epochs=1 imgsz=32
|
||||
yolo val model=yolov8n.pt data=coco8.yaml imgsz=32
|
||||
yolo export model=yolov8n.pt format=torchscript imgsz=160
|
||||
- name: Test Python
|
||||
run: |
|
||||
python -c "
|
||||
from ultralytics import YOLO
|
||||
model = YOLO('yolov8n.pt')
|
||||
results = model.train(data='coco8.yaml', epochs=3, imgsz=160)
|
||||
results = model.val(imgsz=160)
|
||||
results = model.predict(imgsz=160)
|
||||
results = model.export(format='onnx', imgsz=160)
|
||||
"
|
||||
- name: PyTest
|
||||
run: |
|
||||
git clone https://github.com/ultralytics/ultralytics
|
||||
pytest ultralytics/tests
|
||||
|
||||
Summary:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [HUB, Benchmarks, Tests, GPU, Conda] # Add job names that you want to check for failure
|
||||
if: always() # This ensures the job runs even if previous jobs fail
|
||||
steps:
|
||||
- name: Check for failure and notify
|
||||
if: (needs.HUB.result == 'failure' || needs.Benchmarks.result == 'failure' || needs.Tests.result == 'failure' || needs.GPU.result == 'failure' || needs.Conda.result == 'failure') && github.repository == 'ultralytics/ultralytics' && (github.event_name == 'schedule' || github.event_name == 'push')
|
||||
uses: slackapi/slack-github-action@v1.24.0
|
||||
with:
|
||||
payload: |
|
||||
{"text": "<!channel> GitHub Actions error for ${{ github.workflow }} ❌\n\n\n*Repository:* https://github.com/${{ github.repository }}\n*Action:* https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\n*Author:* ${{ github.actor }}\n*Event:* ${{ github.event_name }}\n"}
|
||||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_YOLO }}
|
2
ultralytics/.github/workflows/ci.yaml:Zone.Identifier
vendored
Executable file
2
ultralytics/.github/workflows/ci.yaml:Zone.Identifier
vendored
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
37
ultralytics/.github/workflows/cla.yml
vendored
Executable file
37
ultralytics/.github/workflows/cla.yml
vendored
Executable file
@ -0,0 +1,37 @@
|
||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
|
||||
name: CLA Assistant
|
||||
on:
|
||||
issue_comment:
|
||||
types:
|
||||
- created
|
||||
pull_request_target:
|
||||
types:
|
||||
- reopened
|
||||
- opened
|
||||
- synchronize
|
||||
|
||||
jobs:
|
||||
CLA:
|
||||
if: github.repository == 'ultralytics/ultralytics'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: CLA Assistant
|
||||
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I sign the CLA') || github.event_name == 'pull_request_target'
|
||||
uses: contributor-assistant/github-action@v2.3.1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# must be repository secret token
|
||||
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
|
||||
with:
|
||||
path-to-signatures: 'signatures/version1/cla.json'
|
||||
path-to-document: 'https://docs.ultralytics.com/help/CLA' # CLA document
|
||||
# branch should not be protected
|
||||
branch: 'main'
|
||||
allowlist: dependabot[bot],github-actions,[pre-commit*,pre-commit*,bot*
|
||||
|
||||
remote-organization-name: ultralytics
|
||||
remote-repository-name: cla
|
||||
custom-pr-sign-comment: 'I have read the CLA Document and I sign the CLA'
|
||||
custom-allsigned-prcomment: All Contributors have signed the CLA. ✅
|
||||
#custom-notsigned-prcomment: 'pull request comment with Introductory message to ask new contributors to sign'
|
2
ultralytics/.github/workflows/cla.yml:Zone.Identifier
vendored
Executable file
2
ultralytics/.github/workflows/cla.yml:Zone.Identifier
vendored
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
42
ultralytics/.github/workflows/codeql.yaml
vendored
Executable file
42
ultralytics/.github/workflows/codeql.yaml
vendored
Executable file
@ -0,0 +1,42 @@
|
||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 1 * *'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ${{ 'ubuntu-latest' }}
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: ['python']
|
||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
# queries: security-extended,security-and-quality
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v3
|
||||
with:
|
||||
category: "/language:${{matrix.language}}"
|
2
ultralytics/.github/workflows/codeql.yaml:Zone.Identifier
vendored
Executable file
2
ultralytics/.github/workflows/codeql.yaml:Zone.Identifier
vendored
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
148
ultralytics/.github/workflows/docker.yaml
vendored
Executable file
148
ultralytics/.github/workflows/docker.yaml
vendored
Executable file
@ -0,0 +1,148 @@
|
||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
# Builds ultralytics/ultralytics:latest images on DockerHub https://hub.docker.com/r/ultralytics
|
||||
|
||||
name: Publish Docker Images
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
Dockerfile:
|
||||
type: boolean
|
||||
description: Use Dockerfile
|
||||
default: true
|
||||
Dockerfile-cpu:
|
||||
type: boolean
|
||||
description: Use Dockerfile-cpu
|
||||
Dockerfile-arm64:
|
||||
type: boolean
|
||||
description: Use Dockerfile-arm64
|
||||
Dockerfile-jetson:
|
||||
type: boolean
|
||||
description: Use Dockerfile-jetson
|
||||
Dockerfile-python:
|
||||
type: boolean
|
||||
description: Use Dockerfile-python
|
||||
Dockerfile-conda:
|
||||
type: boolean
|
||||
description: Use Dockerfile-conda
|
||||
push:
|
||||
type: boolean
|
||||
description: Push images to Docker Hub
|
||||
default: true
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
if: github.repository == 'ultralytics/ultralytics'
|
||||
name: Push
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 6
|
||||
matrix:
|
||||
include:
|
||||
- dockerfile: "Dockerfile"
|
||||
tags: "latest"
|
||||
platforms: "linux/amd64"
|
||||
- dockerfile: "Dockerfile-cpu"
|
||||
tags: "latest-cpu"
|
||||
platforms: "linux/amd64"
|
||||
- dockerfile: "Dockerfile-arm64"
|
||||
tags: "latest-arm64"
|
||||
platforms: "linux/arm64"
|
||||
- dockerfile: "Dockerfile-jetson"
|
||||
tags: "latest-jetson"
|
||||
platforms: "linux/arm64"
|
||||
- dockerfile: "Dockerfile-python"
|
||||
tags: "latest-python"
|
||||
platforms: "linux/amd64"
|
||||
# - dockerfile: "Dockerfile-conda"
|
||||
# tags: "latest-conda"
|
||||
# platforms: "linux/amd64"
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # copy full .git directory to access full git history in Docker images
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Retrieve Ultralytics version
|
||||
id: get_version
|
||||
run: |
|
||||
VERSION=$(grep "^__version__ =" ultralytics/__init__.py | awk -F"'" '{print $2}')
|
||||
echo "Retrieved Ultralytics version: $VERSION"
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
VERSION_TAG=$(echo "${{ matrix.tags }}" | sed "s/latest/${VERSION}/")
|
||||
echo "Intended version tag: $VERSION_TAG"
|
||||
echo "version_tag=$VERSION_TAG" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Check if version tag exists on DockerHub
|
||||
id: check_tag
|
||||
run: |
|
||||
RESPONSE=$(curl -s https://hub.docker.com/v2/repositories/ultralytics/ultralytics/tags/$VERSION_TAG)
|
||||
MESSAGE=$(echo $RESPONSE | jq -r '.message')
|
||||
if [[ "$MESSAGE" == "null" ]]; then
|
||||
echo "Tag $VERSION_TAG already exists on DockerHub."
|
||||
echo "exists=true" >> $GITHUB_OUTPUT
|
||||
elif [[ "$MESSAGE" == *"404"* ]]; then
|
||||
echo "Tag $VERSION_TAG does not exist on DockerHub."
|
||||
echo "exists=false" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "Unexpected response from DockerHub. Please check manually."
|
||||
echo "exists=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
env:
|
||||
VERSION_TAG: ${{ steps.get_version.outputs.version_tag }}
|
||||
|
||||
- name: Build Image
|
||||
if: github.event_name == 'push' || github.event.inputs[matrix.dockerfile] == 'true'
|
||||
run: |
|
||||
docker build --platform ${{ matrix.platforms }} -f docker/${{ matrix.dockerfile }} \
|
||||
-t ultralytics/ultralytics:${{ matrix.tags }} \
|
||||
-t ultralytics/ultralytics:${{ steps.get_version.outputs.version_tag }} .
|
||||
|
||||
- name: Run Tests
|
||||
if: (github.event_name == 'push' || github.event.inputs[matrix.dockerfile] == 'true') && matrix.platforms == 'linux/amd64' && matrix.dockerfile != 'Dockerfile-conda' # arm64 images not supported on GitHub CI runners
|
||||
run: docker run ultralytics/ultralytics:${{ matrix.tags }} /bin/bash -c "pip install pytest && pytest tests"
|
||||
|
||||
- name: Run Benchmarks
|
||||
# WARNING: Dockerfile (GPU) error on TF.js export 'module 'numpy' has no attribute 'object'.
|
||||
if: (github.event_name == 'push' || github.event.inputs[matrix.dockerfile] == 'true') && matrix.platforms == 'linux/amd64' && matrix.dockerfile != 'Dockerfile' && matrix.dockerfile != 'Dockerfile-conda' # arm64 images not supported on GitHub CI runners
|
||||
run: docker run ultralytics/ultralytics:${{ matrix.tags }} yolo benchmark model=yolov8n.pt imgsz=160 verbose=0.318
|
||||
|
||||
- name: Push Docker Image with Ultralytics version tag
|
||||
if: (github.event_name == 'push' || (github.event.inputs[matrix.dockerfile] == 'true' && github.event.inputs.push == 'true')) && steps.check_tag.outputs.exists == 'false' && matrix.dockerfile != 'Dockerfile-conda'
|
||||
run: |
|
||||
docker push ultralytics/ultralytics:${{ steps.get_version.outputs.version_tag }}
|
||||
|
||||
- name: Push Docker Image with latest tag
|
||||
if: github.event_name == 'push' || (github.event.inputs[matrix.dockerfile] == 'true' && github.event.inputs.push == 'true')
|
||||
run: |
|
||||
docker push ultralytics/ultralytics:${{ matrix.tags }}
|
||||
if [[ "${{ matrix.tags }}" == "latest" ]]; then
|
||||
t=ultralytics/ultralytics:latest-runner
|
||||
docker build -f docker/Dockerfile-runner -t $t .
|
||||
docker push $t
|
||||
fi
|
||||
|
||||
- name: Notify on failure
|
||||
if: github.event_name == 'push' && failure() # do not notify on cancelled() as cancelling is performed by hand
|
||||
uses: slackapi/slack-github-action@v1.24.0
|
||||
with:
|
||||
payload: |
|
||||
{"text": "<!channel> GitHub Actions error for ${{ github.workflow }} ❌\n\n\n*Repository:* https://github.com/${{ github.repository }}\n*Action:* https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\n*Author:* ${{ github.actor }}\n*Event:* ${{ github.event_name }}\n"}
|
||||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_YOLO }}
|
2
ultralytics/.github/workflows/docker.yaml:Zone.Identifier
vendored
Executable file
2
ultralytics/.github/workflows/docker.yaml:Zone.Identifier
vendored
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
58
ultralytics/.github/workflows/greetings.yml
vendored
Executable file
58
ultralytics/.github/workflows/greetings.yml
vendored
Executable file
@ -0,0 +1,58 @@
|
||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
|
||||
name: Greetings
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened]
|
||||
issues:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
greeting:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/first-interaction@v1
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
pr-message: |
|
||||
👋 Hello @${{ github.actor }}, thank you for submitting an Ultralytics YOLOv8 🚀 PR! To allow your work to be integrated as seamlessly as possible, we advise you to:
|
||||
|
||||
- ✅ Verify your PR is **up-to-date** with `ultralytics/ultralytics` `main` branch. If your PR is behind you can update your code by clicking the 'Update branch' button or by running `git pull` and `git merge main` locally.
|
||||
- ✅ Verify all YOLOv8 Continuous Integration (CI) **checks are passing**.
|
||||
- ✅ Update YOLOv8 [Docs](https://docs.ultralytics.com) for any new or updated features.
|
||||
- ✅ Reduce changes to the absolute **minimum** required for your bug fix or feature addition. _"It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is."_ — Bruce Lee
|
||||
|
||||
See our [Contributing Guide](https://docs.ultralytics.com/help/contributing) for details and let us know if you have any questions!
|
||||
|
||||
issue-message: |
|
||||
👋 Hello @${{ github.actor }}, thank you for your interest in Ultralytics YOLOv8 🚀! We recommend a visit to the [Docs](https://docs.ultralytics.com) for new users where you can find many [Python](https://docs.ultralytics.com/usage/python/) and [CLI](https://docs.ultralytics.com/usage/cli/) usage examples and where many of the most common questions may already be answered.
|
||||
|
||||
If this is a 🐛 Bug Report, please provide a [minimum reproducible example](https://docs.ultralytics.com/help/minimum_reproducible_example/) to help us debug it.
|
||||
|
||||
If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our [Tips for Best Training Results](https://docs.ultralytics.com/yolov5/tutorials/tips_for_best_training_results/).
|
||||
|
||||
Join the vibrant [Ultralytics Discord](https://ultralytics.com/discord) 🎧 community for real-time conversations and collaborations. This platform offers a perfect space to inquire, showcase your work, and connect with fellow Ultralytics users.
|
||||
|
||||
## Install
|
||||
|
||||
Pip install the `ultralytics` package including all [requirements](https://github.com/ultralytics/ultralytics/blob/main/requirements.txt) in a [**Python>=3.8**](https://www.python.org/) environment with [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/).
|
||||
|
||||
```bash
|
||||
pip install ultralytics
|
||||
```
|
||||
|
||||
## Environments
|
||||
|
||||
YOLOv8 may be run in any of the following up-to-date verified environments (with all dependencies including [CUDA](https://developer.nvidia.com/cuda)/[CUDNN](https://developer.nvidia.com/cudnn), [Python](https://www.python.org/) and [PyTorch](https://pytorch.org/) preinstalled):
|
||||
|
||||
- **Notebooks** with free GPU: <a href="https://console.paperspace.com/github/ultralytics/ultralytics"><img src="https://assets.paperspace.io/img/gradient-badge.svg" alt="Run on Gradient"/></a> <a href="https://colab.research.google.com/github/ultralytics/ultralytics/blob/main/examples/tutorial.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> <a href="https://www.kaggle.com/ultralytics/yolov8"><img src="https://kaggle.com/static/images/open-in-kaggle.svg" alt="Open In Kaggle"></a>
|
||||
- **Google Cloud** Deep Learning VM. See [GCP Quickstart Guide](https://docs.ultralytics.com/yolov5/environments/google_cloud_quickstart_tutorial/)
|
||||
- **Amazon** Deep Learning AMI. See [AWS Quickstart Guide](https://docs.ultralytics.com/yolov5/environments/aws_quickstart_tutorial/)
|
||||
- **Docker Image**. See [Docker Quickstart Guide](https://docs.ultralytics.com/yolov5/environments/docker_image_quickstart_tutorial/) <a href="https://hub.docker.com/r/ultralytics/ultralytics"><img src="https://img.shields.io/docker/pulls/ultralytics/ultralytics?logo=docker" alt="Docker Pulls"></a>
|
||||
|
||||
## Status
|
||||
|
||||
<a href="https://github.com/ultralytics/ultralytics/actions/workflows/ci.yaml?query=event%3Aschedule"><img src="https://github.com/ultralytics/ultralytics/actions/workflows/ci.yaml/badge.svg" alt="Ultralytics CI"></a>
|
||||
|
||||
If this badge is green, all [Ultralytics CI](https://github.com/ultralytics/ultralytics/actions/workflows/ci.yaml?query=event%3Aschedule) tests are currently passing. CI tests verify correct operation of all YOLOv8 [Modes](https://docs.ultralytics.com/modes/) and [Tasks](https://docs.ultralytics.com/tasks/) on macOS, Windows, and Ubuntu every 24 hours and on every commit.
|
2
ultralytics/.github/workflows/greetings.yml:Zone.Identifier
vendored
Executable file
2
ultralytics/.github/workflows/greetings.yml:Zone.Identifier
vendored
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
78
ultralytics/.github/workflows/links.yml
vendored
Executable file
78
ultralytics/.github/workflows/links.yml
vendored
Executable file
@ -0,0 +1,78 @@
|
||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
# Continuous Integration (CI) GitHub Actions tests broken link checker using https://github.com/lycheeverse/lychee
|
||||
# Ignores the following status codes to reduce false positives:
|
||||
# - 403(OpenVINO, 'forbidden')
|
||||
# - 429(Instagram, 'too many requests')
|
||||
# - 500(Zenodo, 'cached')
|
||||
# - 502(Zenodo, 'bad gateway')
|
||||
# - 999(LinkedIn, 'unknown status code')
|
||||
|
||||
name: Check Broken links
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '0 0 * * *' # runs at 00:00 UTC every day
|
||||
|
||||
jobs:
|
||||
Links:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Download and install lychee
|
||||
run: |
|
||||
LYCHEE_URL=$(curl -s https://api.github.com/repos/lycheeverse/lychee/releases/latest | grep "browser_download_url" | grep "x86_64-unknown-linux-gnu.tar.gz" | cut -d '"' -f 4)
|
||||
curl -L $LYCHEE_URL -o lychee.tar.gz
|
||||
tar xzf lychee.tar.gz
|
||||
sudo mv lychee /usr/local/bin
|
||||
|
||||
- name: Test Markdown and HTML links with retry
|
||||
uses: nick-invision/retry@v2
|
||||
with:
|
||||
timeout_minutes: 5
|
||||
retry_wait_seconds: 60
|
||||
max_attempts: 3
|
||||
command: |
|
||||
lychee --accept 403,429,500,502,999 \
|
||||
--exclude-loopback \
|
||||
--exclude 'https?://(www\.)?(linkedin\.com|twitter\.com|instagram\.com|kaggle\.com|fonts\.gstatic\.com|url\.com)' \
|
||||
--exclude-path docs/zh \
|
||||
--exclude-path docs/es \
|
||||
--exclude-path docs/ru \
|
||||
--exclude-path docs/pt \
|
||||
--exclude-path docs/fr \
|
||||
--exclude-path docs/de \
|
||||
--exclude-path docs/ja \
|
||||
--exclude-path docs/ko \
|
||||
--exclude-path docs/hi \
|
||||
--exclude-path docs/ar \
|
||||
--exclude-mail \
|
||||
--github-token ${{ secrets.GITHUB_TOKEN }} \
|
||||
'./**/*.md' './**/*.html'
|
||||
|
||||
- name: Test Markdown, HTML, YAML, Python and Notebook links with retry
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
uses: nick-invision/retry@v2
|
||||
with:
|
||||
timeout_minutes: 5
|
||||
retry_wait_seconds: 60
|
||||
max_attempts: 3
|
||||
command: |
|
||||
lychee --accept 429,999 \
|
||||
--exclude-loopback \
|
||||
--exclude 'https?://(www\.)?(linkedin\.com|twitter\.com|instagram\.com|kaggle\.com|fonts\.gstatic\.com|url\.com)' \
|
||||
--exclude-path '**/ci.yaml' \
|
||||
--exclude-path docs/zh \
|
||||
--exclude-path docs/es \
|
||||
--exclude-path docs/ru \
|
||||
--exclude-path docs/pt \
|
||||
--exclude-path docs/fr \
|
||||
--exclude-path docs/de \
|
||||
--exclude-path docs/ja \
|
||||
--exclude-path docs/ko \
|
||||
--exclude-path docs/hi \
|
||||
--exclude-path docs/ar \
|
||||
--exclude-mail \
|
||||
--github-token ${{ secrets.GITHUB_TOKEN }} \
|
||||
'./**/*.md' './**/*.html' './**/*.yml' './**/*.yaml' './**/*.py' './**/*.ipynb'
|
2
ultralytics/.github/workflows/links.yml:Zone.Identifier
vendored
Executable file
2
ultralytics/.github/workflows/links.yml:Zone.Identifier
vendored
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
112
ultralytics/.github/workflows/publish.yml
vendored
Executable file
112
ultralytics/.github/workflows/publish.yml
vendored
Executable file
@ -0,0 +1,112 @@
|
||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
# Publish pip package to PyPI https://pypi.org/project/ultralytics/ and Docs to https://docs.ultralytics.com
|
||||
|
||||
name: Publish to PyPI and Deploy Docs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
pypi:
|
||||
type: boolean
|
||||
description: Publish to PyPI
|
||||
docs:
|
||||
type: boolean
|
||||
description: Deploy Docs
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
if: github.repository == 'ultralytics/ultralytics' && github.actor == 'glenn-jocher'
|
||||
name: Publish
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: "0" # pulls all commits (needed correct last updated dates in Docs)
|
||||
- name: Set up Python environment
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.10'
|
||||
cache: 'pip' # caching pip dependencies
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip wheel build twine
|
||||
pip install -e ".[dev]" --extra-index-url https://download.pytorch.org/whl/cpu
|
||||
- name: Check PyPI version
|
||||
shell: python
|
||||
run: |
|
||||
import os
|
||||
import ultralytics
|
||||
from ultralytics.utils.checks import check_latest_pypi_version
|
||||
|
||||
v_local = tuple(map(int, ultralytics.__version__.split('.')))
|
||||
v_pypi = tuple(map(int, check_latest_pypi_version().split('.')))
|
||||
print(f'Local version is {v_local}')
|
||||
print(f'PyPI version is {v_pypi}')
|
||||
d = [a - b for a, b in zip(v_local, v_pypi)] # diff
|
||||
increment = (d[0] == d[1] == 0) and (0 < d[2] < 3) # only publish if patch version increments by 1 or 2
|
||||
os.system(f'echo "increment={increment}" >> $GITHUB_OUTPUT')
|
||||
os.system(f'echo "version={ultralytics.__version__}" >> $GITHUB_OUTPUT')
|
||||
if increment:
|
||||
print('Local version is higher than PyPI version. Publishing new version to PyPI ✅.')
|
||||
id: check_pypi
|
||||
- name: Publish to PyPI
|
||||
continue-on-error: true
|
||||
if: (github.event_name == 'push' || github.event.inputs.pypi == 'true') && steps.check_pypi.outputs.increment == 'True'
|
||||
env:
|
||||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
|
||||
run: |
|
||||
python -m build
|
||||
python -m twine upload dist/* -u __token__ -p $PYPI_TOKEN
|
||||
- name: Deploy Docs
|
||||
continue-on-error: true
|
||||
if: (github.event_name == 'push' || github.event.inputs.docs == 'true') && github.repository == 'ultralytics/ultralytics' && github.actor == 'glenn-jocher'
|
||||
env:
|
||||
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
|
||||
INDEXNOW_KEY: ${{ secrets.INDEXNOW_KEY_DOCS }}
|
||||
run: |
|
||||
python docs/build_docs.py
|
||||
git config --global user.name "Glenn Jocher"
|
||||
git config --global user.email "glenn.jocher@ultralytics.com"
|
||||
git clone https://github.com/ultralytics/docs.git docs-repo
|
||||
cd docs-repo
|
||||
git checkout gh-pages || git checkout -b gh-pages
|
||||
rm -rf *
|
||||
cp -R ../site/* .
|
||||
echo "$INDEXNOW_KEY" > "$INDEXNOW_KEY.txt"
|
||||
git add .
|
||||
LATEST_HASH=$(git rev-parse --short=7 HEAD)
|
||||
git commit -m "Update Docs for 'ultralytics ${{ steps.check_pypi.outputs.version }} - $LATEST_HASH'"
|
||||
git push https://$PERSONAL_ACCESS_TOKEN@github.com/ultralytics/docs.git gh-pages
|
||||
- name: Extract PR Details
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" = "pull_request" ]; then
|
||||
PR_JSON=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }})
|
||||
PR_NUMBER=${{ github.event.pull_request.number }}
|
||||
PR_TITLE=$(echo $PR_JSON | jq -r '.title')
|
||||
else
|
||||
COMMIT_SHA=${{ github.event.after }}
|
||||
PR_JSON=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/search/issues?q=repo:${{ github.repository }}+is:pr+is:merged+sha:$COMMIT_SHA")
|
||||
PR_NUMBER=$(echo $PR_JSON | jq -r '.items[0].number')
|
||||
PR_TITLE=$(echo $PR_JSON | jq -r '.items[0].title')
|
||||
fi
|
||||
echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV
|
||||
echo "PR_TITLE=$PR_TITLE" >> $GITHUB_ENV
|
||||
- name: Notify on Slack (Success)
|
||||
if: success() && github.event_name == 'push' && steps.check_pypi.outputs.increment == 'True'
|
||||
uses: slackapi/slack-github-action@v1.24.0
|
||||
with:
|
||||
payload: |
|
||||
{"text": "<!channel> GitHub Actions success for ${{ github.workflow }} ✅\n\n\n*Repository:* https://github.com/${{ github.repository }}\n*Action:* https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\n*Author:* ${{ github.actor }}\n*Event:* NEW 'ultralytics ${{ steps.check_pypi.outputs.version }}' pip package published 😃\n*Job Status:* ${{ job.status }}\n*Pull Request:* <https://github.com/${{ github.repository }}/pull/${{ env.PR_NUMBER }}> ${{ env.PR_TITLE }}\n"}
|
||||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_YOLO }}
|
||||
- name: Notify on Slack (Failure)
|
||||
if: failure()
|
||||
uses: slackapi/slack-github-action@v1.24.0
|
||||
with:
|
||||
payload: |
|
||||
{"text": "<!channel> GitHub Actions error for ${{ github.workflow }} ❌\n\n\n*Repository:* https://github.com/${{ github.repository }}\n*Action:* https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\n*Author:* ${{ github.actor }}\n*Event:* ${{ github.event_name }}\n*Job Status:* ${{ job.status }}\n*Pull Request:* <https://github.com/${{ github.repository }}/pull/${{ env.PR_NUMBER }}> ${{ env.PR_TITLE }}\n"}
|
||||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_YOLO }}
|
2
ultralytics/.github/workflows/publish.yml:Zone.Identifier
vendored
Executable file
2
ultralytics/.github/workflows/publish.yml:Zone.Identifier
vendored
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
47
ultralytics/.github/workflows/stale.yml
vendored
Executable file
47
ultralytics/.github/workflows/stale.yml
vendored
Executable file
@ -0,0 +1,47 @@
|
||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
|
||||
name: Close stale issues
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *' # Runs at 00:00 UTC every day
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/stale@v9
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
stale-issue-message: |
|
||||
👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.
|
||||
|
||||
For additional resources and information, please see the links below:
|
||||
|
||||
- **Docs**: https://docs.ultralytics.com
|
||||
- **HUB**: https://hub.ultralytics.com
|
||||
- **Community**: https://community.ultralytics.com
|
||||
|
||||
Feel free to inform us of any other **issues** you discover or **feature requests** that come to mind in the future. Pull Requests (PRs) are also always welcomed!
|
||||
|
||||
Thank you for your contributions to YOLO 🚀 and Vision AI ⭐
|
||||
|
||||
stale-pr-message: |
|
||||
👋 Hello there! We wanted to let you know that we've decided to close this pull request due to inactivity. We appreciate the effort you put into contributing to our project, but unfortunately, not all contributions are suitable or aligned with our product roadmap.
|
||||
|
||||
We hope you understand our decision, and please don't let it discourage you from contributing to open source projects in the future. We value all of our community members and their contributions, and we encourage you to keep exploring new projects and ways to get involved.
|
||||
|
||||
For additional resources and information, please see the links below:
|
||||
|
||||
- **Docs**: https://docs.ultralytics.com
|
||||
- **HUB**: https://hub.ultralytics.com
|
||||
- **Community**: https://community.ultralytics.com
|
||||
|
||||
Thank you for your contributions to YOLO 🚀 and Vision AI ⭐
|
||||
|
||||
days-before-issue-stale: 30
|
||||
days-before-issue-close: 10
|
||||
days-before-pr-stale: 90
|
||||
days-before-pr-close: 30
|
||||
exempt-issue-labels: 'documentation,tutorial,TODO'
|
||||
operations-per-run: 300 # The maximum number of operations per run, used to control rate limiting.
|
2
ultralytics/.github/workflows/stale.yml:Zone.Identifier
vendored
Executable file
2
ultralytics/.github/workflows/stale.yml:Zone.Identifier
vendored
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
165
ultralytics/.gitignore
vendored
Executable file
165
ultralytics/.gitignore
vendored
Executable file
@ -0,0 +1,165 @@
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
# C extensions
|
||||
*.so
|
||||
|
||||
# Distribution / packaging
|
||||
.Python
|
||||
build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
downloads/
|
||||
eggs/
|
||||
.eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
var/
|
||||
wheels/
|
||||
pip-wheel-metadata/
|
||||
share/python-wheels/
|
||||
*.egg-info/
|
||||
.installed.cfg
|
||||
*.egg
|
||||
MANIFEST
|
||||
|
||||
# PyInstaller
|
||||
# Usually these files are written by a python script from a template
|
||||
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||
*.manifest
|
||||
*.spec
|
||||
|
||||
# Installer logs
|
||||
pip-log.txt
|
||||
pip-delete-this-directory.txt
|
||||
|
||||
# Unit test / coverage reports
|
||||
htmlcov/
|
||||
.tox/
|
||||
.nox/
|
||||
.coverage
|
||||
.coverage.*
|
||||
.cache
|
||||
nosetests.xml
|
||||
coverage.xml
|
||||
*.cover
|
||||
*.py,cover
|
||||
.hypothesis/
|
||||
.pytest_cache/
|
||||
|
||||
# Translations
|
||||
*.mo
|
||||
*.pot
|
||||
|
||||
# Django stuff:
|
||||
*.log
|
||||
local_settings.py
|
||||
db.sqlite3
|
||||
db.sqlite3-journal
|
||||
|
||||
# Flask stuff:
|
||||
instance/
|
||||
.webassets-cache
|
||||
|
||||
# Scrapy stuff:
|
||||
.scrapy
|
||||
|
||||
# Sphinx documentation
|
||||
docs/_build/
|
||||
|
||||
# PyBuilder
|
||||
target/
|
||||
|
||||
# Jupyter Notebook
|
||||
.ipynb_checkpoints
|
||||
|
||||
# IPython
|
||||
profile_default/
|
||||
ipython_config.py
|
||||
|
||||
# Profiling
|
||||
*.pclprof
|
||||
|
||||
# pyenv
|
||||
.python-version
|
||||
|
||||
# pipenv
|
||||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
||||
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
||||
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
||||
# install all needed dependencies.
|
||||
#Pipfile.lock
|
||||
|
||||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
||||
__pypackages__/
|
||||
|
||||
# Celery stuff
|
||||
celerybeat-schedule
|
||||
celerybeat.pid
|
||||
|
||||
# SageMath parsed files
|
||||
*.sage.py
|
||||
|
||||
# Environments
|
||||
.env
|
||||
.venv
|
||||
.idea
|
||||
env/
|
||||
venv/
|
||||
ENV/
|
||||
env.bak/
|
||||
venv.bak/
|
||||
|
||||
# Spyder project settings
|
||||
.spyderproject
|
||||
.spyproject
|
||||
|
||||
# VSCode project settings
|
||||
.vscode/
|
||||
|
||||
# Rope project settings
|
||||
.ropeproject
|
||||
|
||||
# mkdocs documentation
|
||||
/site
|
||||
mkdocs_github_authors.yaml
|
||||
|
||||
# mypy
|
||||
.mypy_cache/
|
||||
.dmypy.json
|
||||
dmypy.json
|
||||
|
||||
# Pyre type checker
|
||||
.pyre/
|
||||
|
||||
# datasets and projects
|
||||
datasets/
|
||||
runs/
|
||||
wandb/
|
||||
tests/
|
||||
.DS_Store
|
||||
|
||||
# Neural Network weights -----------------------------------------------------------------------------------------------
|
||||
weights/
|
||||
*.weights
|
||||
*.pt
|
||||
*.pb
|
||||
*.onnx
|
||||
*.engine
|
||||
*.mlmodel
|
||||
*.mlpackage
|
||||
*.torchscript
|
||||
*.tflite
|
||||
*.h5
|
||||
*_saved_model/
|
||||
*_web_model/
|
||||
*_openvino_model/
|
||||
*_paddle_model/
|
||||
pnnx*
|
||||
|
||||
# Autogenerated files for tests
|
||||
/ultralytics/assets/
|
2
ultralytics/.gitignore:Zone.Identifier
Executable file
2
ultralytics/.gitignore:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
92
ultralytics/.pre-commit-config.yaml
Executable file
92
ultralytics/.pre-commit-config.yaml
Executable file
@ -0,0 +1,92 @@
|
||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
# Pre-commit hooks. For more information see https://github.com/pre-commit/pre-commit-hooks/blob/main/README.md
|
||||
# Optionally remove from local hooks with 'rm .git/hooks/pre-commit'
|
||||
|
||||
# Define bot property if installed via https://github.com/marketplace/pre-commit-ci
|
||||
ci:
|
||||
autofix_prs: true
|
||||
autoupdate_commit_msg: '[pre-commit.ci] pre-commit suggestions'
|
||||
autoupdate_schedule: monthly
|
||||
submodules: true
|
||||
|
||||
# Exclude directories (optional)
|
||||
# exclude: 'docs/'
|
||||
|
||||
# Define repos to run
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.5.0
|
||||
hooks:
|
||||
- id: end-of-file-fixer
|
||||
- id: trailing-whitespace
|
||||
- id: check-case-conflict
|
||||
# - id: check-yaml
|
||||
- id: check-docstring-first
|
||||
- id: double-quote-string-fixer
|
||||
- id: detect-private-key
|
||||
|
||||
- repo: https://github.com/asottile/pyupgrade
|
||||
rev: v3.15.0
|
||||
hooks:
|
||||
- id: pyupgrade
|
||||
name: Upgrade code
|
||||
|
||||
- repo: https://github.com/PyCQA/isort
|
||||
rev: 5.12.0
|
||||
hooks:
|
||||
- id: isort
|
||||
name: Sort imports
|
||||
|
||||
- repo: https://github.com/google/yapf
|
||||
rev: v0.40.2
|
||||
hooks:
|
||||
- id: yapf
|
||||
name: YAPF formatting
|
||||
|
||||
- repo: https://github.com/executablebooks/mdformat
|
||||
rev: 0.7.17
|
||||
hooks:
|
||||
- id: mdformat
|
||||
name: MD formatting
|
||||
additional_dependencies:
|
||||
- mdformat-gfm
|
||||
# - mdformat-black
|
||||
# - mdformat-frontmatter
|
||||
args:
|
||||
- --wrap=no
|
||||
exclude: 'docs/.*\.md'
|
||||
# exclude: "README.md|README.zh-CN.md|CONTRIBUTING.md"
|
||||
|
||||
- repo: https://github.com/PyCQA/flake8
|
||||
rev: 6.1.0
|
||||
hooks:
|
||||
- id: flake8
|
||||
name: PEP8
|
||||
|
||||
- repo: https://github.com/codespell-project/codespell
|
||||
rev: v2.2.6
|
||||
hooks:
|
||||
- id: codespell
|
||||
exclude: 'docs/de|docs/fr|docs/pt|docs/es|docs/mkdocs_de.yml'
|
||||
args:
|
||||
- --ignore-words-list=crate,nd,strack,dota,ane,segway,fo,gool,winn
|
||||
|
||||
- repo: https://github.com/PyCQA/docformatter
|
||||
rev: v1.7.5
|
||||
hooks:
|
||||
- id: docformatter
|
||||
|
||||
# - repo: https://github.com/asottile/yesqa
|
||||
# rev: v1.4.0
|
||||
# hooks:
|
||||
# - id: yesqa
|
||||
|
||||
# - repo: https://github.com/asottile/dead
|
||||
# rev: v1.5.0
|
||||
# hooks:
|
||||
# - id: dead
|
||||
|
||||
# - repo: https://github.com/ultralytics/pre-commit
|
||||
# rev: bd60a414f80a53fb8f593d3bfed4701fc47e4b23
|
||||
# hooks:
|
||||
# - id: capitalize-comments
|
2
ultralytics/.pre-commit-config.yaml:Zone.Identifier
Executable file
2
ultralytics/.pre-commit-config.yaml:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
BIN
ultralytics/1.png
Executable file
BIN
ultralytics/1.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 537 KiB |
2
ultralytics/1.png:Zone.Identifier
Executable file
2
ultralytics/1.png:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
BIN
ultralytics/2.png
Executable file
BIN
ultralytics/2.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 535 KiB |
2
ultralytics/2.png:Zone.Identifier
Executable file
2
ultralytics/2.png:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
20
ultralytics/CITATION.cff
Executable file
20
ultralytics/CITATION.cff
Executable file
@ -0,0 +1,20 @@
|
||||
cff-version: 1.2.0
|
||||
preferred-citation:
|
||||
type: software
|
||||
message: If you use this software, please cite it as below.
|
||||
authors:
|
||||
- family-names: Jocher
|
||||
given-names: Glenn
|
||||
orcid: "https://orcid.org/0000-0001-5950-6979"
|
||||
- family-names: Chaurasia
|
||||
given-names: Ayush
|
||||
orcid: "https://orcid.org/0000-0002-7603-6750"
|
||||
- family-names: Qiu
|
||||
given-names: Jing
|
||||
orcid: "https://orcid.org/0000-0003-3783-7069"
|
||||
title: "YOLO by Ultralytics"
|
||||
version: 8.0.0
|
||||
# doi: 10.5281/zenodo.3908559 # TODO
|
||||
date-released: 2023-1-10
|
||||
license: AGPL-3.0
|
||||
url: "https://github.com/ultralytics/ultralytics"
|
2
ultralytics/CITATION.cff:Zone.Identifier
Executable file
2
ultralytics/CITATION.cff:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
96
ultralytics/CONTRIBUTING.md
Executable file
96
ultralytics/CONTRIBUTING.md
Executable file
@ -0,0 +1,96 @@
|
||||
# Contributing to YOLOv8 🚀
|
||||
|
||||
We love your input! We want to make contributing to YOLOv8 as easy and transparent as possible, whether it's:
|
||||
|
||||
- Reporting a bug
|
||||
- Discussing the current state of the code
|
||||
- Submitting a fix
|
||||
- Proposing a new feature
|
||||
- Becoming a maintainer
|
||||
|
||||
YOLOv8 works so well due to our combined community effort, and for every small improvement you contribute you will be helping push the frontiers of what's possible in AI 😃!
|
||||
|
||||
## Submitting a Pull Request (PR) 🛠️
|
||||
|
||||
Submitting a PR is easy! This example shows how to submit a PR for updating `requirements.txt` in 4 steps:
|
||||
|
||||
### 1. Select File to Update
|
||||
|
||||
Select `requirements.txt` to update by clicking on it in GitHub.
|
||||
|
||||
<p align="center"><img width="800" alt="PR_step1" src="https://user-images.githubusercontent.com/26833433/122260847-08be2600-ced4-11eb-828b-8287ace4136c.png"></p>
|
||||
|
||||
### 2. Click 'Edit this file'
|
||||
|
||||
Button is in top-right corner.
|
||||
|
||||
<p align="center"><img width="800" alt="PR_step2" src="https://user-images.githubusercontent.com/26833433/122260844-06f46280-ced4-11eb-9eec-b8a24be519ca.png"></p>
|
||||
|
||||
### 3. Make Changes
|
||||
|
||||
Change `matplotlib` version from `3.2.2` to `3.3`.
|
||||
|
||||
<p align="center"><img width="800" alt="PR_step3" src="https://user-images.githubusercontent.com/26833433/122260853-0a87e980-ced4-11eb-9fd2-3650fb6e0842.png"></p>
|
||||
|
||||
### 4. Preview Changes and Submit PR
|
||||
|
||||
Click on the **Preview changes** tab to verify your updates. At the bottom of the screen select 'Create a **new branch** for this commit', assign your branch a descriptive name such as `fix/matplotlib_version` and click the green **Propose changes** button. All done, your PR is now submitted to YOLOv8 for review and approval 😃!
|
||||
|
||||
<p align="center"><img width="800" alt="PR_step4" src="https://user-images.githubusercontent.com/26833433/122260856-0b208000-ced4-11eb-8e8e-77b6151cbcc3.png"></p>
|
||||
|
||||
### PR recommendations
|
||||
|
||||
To allow your work to be integrated as seamlessly as possible, we advise you to:
|
||||
|
||||
- ✅ Verify your PR is **up-to-date** with `ultralytics/ultralytics` `main` branch. If your PR is behind you can update your code by clicking the 'Update branch' button or by running `git pull` and `git merge main` locally.
|
||||
|
||||
<p align="center"><img width="751" alt="PR recommendation 1" src="https://user-images.githubusercontent.com/26833433/187295893-50ed9f44-b2c9-4138-a614-de69bd1753d7.png"></p>
|
||||
|
||||
- ✅ Verify all YOLOv8 Continuous Integration (CI) **checks are passing**.
|
||||
|
||||
<p align="center"><img width="751" alt="PR recommendation 2" src="https://user-images.githubusercontent.com/26833433/187296922-545c5498-f64a-4d8c-8300-5fa764360da6.png"></p>
|
||||
|
||||
- ✅ Reduce changes to the absolute **minimum** required for your bug fix or feature addition. _"It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is."_ — Bruce Lee
|
||||
|
||||
### Docstrings
|
||||
|
||||
Not all functions or classes require docstrings but when they do, we follow [google-style docstrings format](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings). Here is an example:
|
||||
|
||||
```python
|
||||
"""
|
||||
What the function does. Performs NMS on given detection predictions.
|
||||
|
||||
Args:
|
||||
arg1: The description of the 1st argument
|
||||
arg2: The description of the 2nd argument
|
||||
|
||||
Returns:
|
||||
What the function returns. Empty if nothing is returned.
|
||||
|
||||
Raises:
|
||||
Exception Class: When and why this exception can be raised by the function.
|
||||
"""
|
||||
```
|
||||
|
||||
## Submitting a Bug Report 🐛
|
||||
|
||||
If you spot a problem with YOLOv8 please submit a Bug Report!
|
||||
|
||||
For us to start investigating a possible problem we need to be able to reproduce it ourselves first. We've created a few short guidelines below to help users provide what we need in order to get started.
|
||||
|
||||
When asking a question, people will be better able to provide help if you provide **code** that they can easily understand and use to **reproduce** the problem. This is referred to by community members as creating a [minimum reproducible example](https://docs.ultralytics.com/help/minimum_reproducible_example/). Your code that reproduces the problem should be:
|
||||
|
||||
- ✅ **Minimal** – Use as little code as possible that still produces the same problem
|
||||
- ✅ **Complete** – Provide **all** parts someone else needs to reproduce your problem in the question itself
|
||||
- ✅ **Reproducible** – Test the code you're about to provide to make sure it reproduces the problem
|
||||
|
||||
In addition to the above requirements, for [Ultralytics](https://ultralytics.com/) to provide assistance your code should be:
|
||||
|
||||
- ✅ **Current** – Verify that your code is up-to-date with current GitHub [main](https://github.com/ultralytics/ultralytics/tree/main) branch, and if necessary `git pull` or `git clone` a new copy to ensure your problem has not already been resolved by previous commits.
|
||||
- ✅ **Unmodified** – Your problem must be reproducible without any modifications to the codebase in this repository. [Ultralytics](https://ultralytics.com/) does not provide support for custom code ⚠️.
|
||||
|
||||
If you believe your problem meets all of the above criteria, please close this issue and raise a new one using the 🐛 **Bug Report** [template](https://github.com/ultralytics/ultralytics/issues/new/choose) and providing a [minimum reproducible example](https://docs.ultralytics.com/help/minimum_reproducible_example/) to help us better understand and diagnose your problem.
|
||||
|
||||
## License
|
||||
|
||||
By contributing, you agree that your contributions will be licensed under the [AGPL-3.0 license](https://choosealicense.com/licenses/agpl-3.0/)
|
2
ultralytics/CONTRIBUTING.md:Zone.Identifier
Executable file
2
ultralytics/CONTRIBUTING.md:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
661
ultralytics/LICENSE
Executable file
661
ultralytics/LICENSE
Executable file
@ -0,0 +1,661 @@
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
2
ultralytics/LICENSE:Zone.Identifier
Executable file
2
ultralytics/LICENSE:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
8
ultralytics/MANIFEST.in
Executable file
8
ultralytics/MANIFEST.in
Executable file
@ -0,0 +1,8 @@
|
||||
include *.md
|
||||
include requirements.txt
|
||||
include LICENSE
|
||||
include setup.py
|
||||
include ultralytics/assets/bus.jpg
|
||||
include ultralytics/assets/zidane.jpg
|
||||
include tests/*.py
|
||||
recursive-include ultralytics *.yaml
|
2
ultralytics/MANIFEST.in:Zone.Identifier
Executable file
2
ultralytics/MANIFEST.in:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
265
ultralytics/README.md
Executable file
265
ultralytics/README.md
Executable file
@ -0,0 +1,265 @@
|
||||
<div align="center">
|
||||
<p>
|
||||
<a href="https://yolovision.ultralytics.com/" target="_blank">
|
||||
<img width="100%" src="https://raw.githubusercontent.com/ultralytics/assets/main/im/banner-yolo-vision-2023.png" alt="YOLO Vision banner"></a>
|
||||
</p>
|
||||
|
||||
[中文](https://docs.ultralytics.com/zh/) | [한국어](https://docs.ultralytics.com/ko/) | [日本語](https://docs.ultralytics.com/ja/) | [Русский](https://docs.ultralytics.com/ru/) | [Deutsch](https://docs.ultralytics.com/de/) | [Français](https://docs.ultralytics.com/fr/) | [Español](https://docs.ultralytics.com/es/) | [Português](https://docs.ultralytics.com/pt/) | [हिन्दी](https://docs.ultralytics.com/hi/) | [العربية](https://docs.ultralytics.com/ar/) <br>
|
||||
|
||||
<div>
|
||||
<a href="https://github.com/ultralytics/ultralytics/actions/workflows/ci.yaml"><img src="https://github.com/ultralytics/ultralytics/actions/workflows/ci.yaml/badge.svg" alt="Ultralytics CI"></a>
|
||||
<a href="https://codecov.io/github/ultralytics/ultralytics"><img src="https://codecov.io/github/ultralytics/ultralytics/branch/main/graph/badge.svg?token=HHW7IIVFVY" alt="Ultralytics Code Coverage"></a>
|
||||
<a href="https://zenodo.org/badge/latestdoi/264818686"><img src="https://zenodo.org/badge/264818686.svg" alt="YOLOv8 Citation"></a>
|
||||
<a href="https://hub.docker.com/r/ultralytics/ultralytics"><img src="https://img.shields.io/docker/pulls/ultralytics/ultralytics?logo=docker" alt="Docker Pulls"></a>
|
||||
<a href="https://ultralytics.com/discord"><img alt="Discord" src="https://img.shields.io/discord/1089800235347353640?logo=discord&logoColor=white&label=Discord&color=blue"></a>
|
||||
<br>
|
||||
<a href="https://console.paperspace.com/github/ultralytics/ultralytics"><img src="https://assets.paperspace.io/img/gradient-badge.svg" alt="Run on Gradient"></a>
|
||||
<a href="https://colab.research.google.com/github/ultralytics/ultralytics/blob/main/examples/tutorial.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a>
|
||||
<a href="https://www.kaggle.com/ultralytics/yolov8"><img src="https://kaggle.com/static/images/open-in-kaggle.svg" alt="Open In Kaggle"></a>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
[Ultralytics](https://ultralytics.com) [YOLOv8](https://github.com/ultralytics/ultralytics) is 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 YOLOv8 <a href="https://docs.ultralytics.com/">Docs</a> for details, raise an issue on <a href="https://github.com/ultralytics/ultralytics/issues/new/choose">GitHub</a> for support, and join our <a href="https://ultralytics.com/discord">Discord</a> community for questions and discussions!
|
||||
|
||||
To request an Enterprise License please complete the form at [Ultralytics Licensing](https://ultralytics.com/license).
|
||||
|
||||
<img width="100%" src="https://raw.githubusercontent.com/ultralytics/assets/main/yolov8/yolo-comparison-plots.png" alt="YOLOv8 performance plots"></a>
|
||||
|
||||
<div align="center">
|
||||
<a href="https://github.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-github.png" width="2%" alt="Ultralytics GitHub"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%" alt="space">
|
||||
<a href="https://www.linkedin.com/company/ultralytics/"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-linkedin.png" width="2%" alt="Ultralytics LinkedIn"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%" alt="space">
|
||||
<a href="https://twitter.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-twitter.png" width="2%" alt="Ultralytics Twitter"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%" alt="space">
|
||||
<a href="https://youtube.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-youtube.png" width="2%" alt="Ultralytics YouTube"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%" alt="space">
|
||||
<a href="https://www.tiktok.com/@ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-tiktok.png" width="2%" alt="Ultralytics TikTok"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%" alt="space">
|
||||
<a href="https://www.instagram.com/ultralytics/"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-instagram.png" width="2%" alt="Ultralytics Instagram"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%" alt="space">
|
||||
<a href="https://ultralytics.com/discord"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-discord.png" width="2%" alt="Ultralytics Discord"></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
## <div align="center">Documentation</div>
|
||||
|
||||
See below for a quickstart installation and usage example, and see the [YOLOv8 Docs](https://docs.ultralytics.com) for full documentation on training, validation, prediction and deployment.
|
||||
|
||||
<details open>
|
||||
<summary>Install</summary>
|
||||
|
||||
Pip install the ultralytics package including all [requirements](https://github.com/ultralytics/ultralytics/blob/main/requirements.txt) in a [**Python>=3.8**](https://www.python.org/) environment with [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/).
|
||||
|
||||
[](https://badge.fury.io/py/ultralytics) [](https://pepy.tech/project/ultralytics)
|
||||
|
||||
```bash
|
||||
pip install ultralytics
|
||||
```
|
||||
|
||||
For alternative installation methods including [Conda](https://anaconda.org/conda-forge/ultralytics), [Docker](https://hub.docker.com/r/ultralytics/ultralytics), and Git, please refer to the [Quickstart Guide](https://docs.ultralytics.com/quickstart).
|
||||
|
||||
</details>
|
||||
|
||||
<details open>
|
||||
<summary>Usage</summary>
|
||||
|
||||
#### CLI
|
||||
|
||||
YOLOv8 may be used directly in the Command Line Interface (CLI) with a `yolo` command:
|
||||
|
||||
```bash
|
||||
yolo predict model=yolov8n.pt source='https://ultralytics.com/images/bus.jpg'
|
||||
```
|
||||
|
||||
`yolo` can be used for a variety of tasks and modes and accepts additional arguments, i.e. `imgsz=640`. See the YOLOv8 [CLI Docs](https://docs.ultralytics.com/usage/cli) for examples.
|
||||
|
||||
#### Python
|
||||
|
||||
YOLOv8 may also be used directly in a Python environment, and accepts the same [arguments](https://docs.ultralytics.com/usage/cfg/) as in the CLI example above:
|
||||
|
||||
```python
|
||||
from ultralytics import YOLO
|
||||
|
||||
# Load a model
|
||||
model = YOLO("yolov8n.yaml") # build a new model from scratch
|
||||
model = YOLO("yolov8n.pt") # load a pretrained model (recommended for training)
|
||||
|
||||
# Use the model
|
||||
model.train(data="coco128.yaml", epochs=3) # train the model
|
||||
metrics = model.val() # evaluate model performance on the validation set
|
||||
results = model("https://ultralytics.com/images/bus.jpg") # predict on an image
|
||||
path = model.export(format="onnx") # export the model to ONNX format
|
||||
```
|
||||
|
||||
See YOLOv8 [Python Docs](https://docs.ultralytics.com/usage/python) for more examples.
|
||||
|
||||
</details>
|
||||
|
||||
## <div align="center">Models</div>
|
||||
|
||||
YOLOv8 [Detect](https://docs.ultralytics.com/tasks/detect), [Segment](https://docs.ultralytics.com/tasks/segment) and [Pose](https://docs.ultralytics.com/tasks/pose) models pretrained on the [COCO](https://docs.ultralytics.com/datasets/detect/coco) dataset are available here, as well as YOLOv8 [Classify](https://docs.ultralytics.com/tasks/classify) models pretrained on the [ImageNet](https://docs.ultralytics.com/datasets/classify/imagenet) dataset. [Track](https://docs.ultralytics.com/modes/track) mode is available for all Detect, Segment and Pose models.
|
||||
|
||||
<img width="1024" src="https://raw.githubusercontent.com/ultralytics/assets/main/im/banner-tasks.png" alt="Ultralytics YOLO supported tasks">
|
||||
|
||||
All [Models](https://github.com/ultralytics/ultralytics/tree/main/ultralytics/cfg/models) download automatically from the latest Ultralytics [release](https://github.com/ultralytics/assets/releases) on first use.
|
||||
|
||||
<details open><summary>Detection (COCO)</summary>
|
||||
|
||||
See [Detection Docs](https://docs.ultralytics.com/tasks/detect/) for usage examples with these models trained on [COCO](https://docs.ultralytics.com/datasets/detect/coco/), which include 80 pre-trained classes.
|
||||
|
||||
| Model | size<br><sup>(pixels) | mAP<sup>val<br>50-95 | Speed<br><sup>CPU ONNX<br>(ms) | Speed<br><sup>A100 TensorRT<br>(ms) | params<br><sup>(M) | FLOPs<br><sup>(B) |
|
||||
| ------------------------------------------------------------------------------------ | --------------------- | -------------------- | ------------------------------ | ----------------------------------- | ------------------ | ----------------- |
|
||||
| [YOLOv8n](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n.pt) | 640 | 37.3 | 80.4 | 0.99 | 3.2 | 8.7 |
|
||||
| [YOLOv8s](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8s.pt) | 640 | 44.9 | 128.4 | 1.20 | 11.2 | 28.6 |
|
||||
| [YOLOv8m](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8m.pt) | 640 | 50.2 | 234.7 | 1.83 | 25.9 | 78.9 |
|
||||
| [YOLOv8l](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8l.pt) | 640 | 52.9 | 375.2 | 2.39 | 43.7 | 165.2 |
|
||||
| [YOLOv8x](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8x.pt) | 640 | 53.9 | 479.1 | 3.53 | 68.2 | 257.8 |
|
||||
|
||||
- **mAP<sup>val</sup>** values are for single-model single-scale on [COCO val2017](http://cocodataset.org) dataset. <br>Reproduce by `yolo val detect data=coco.yaml device=0`
|
||||
- **Speed** averaged over COCO val images using an [Amazon EC2 P4d](https://aws.amazon.com/ec2/instance-types/p4/) instance. <br>Reproduce by `yolo val detect data=coco.yaml batch=1 device=0|cpu`
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>Detection (Open Image V7)</summary>
|
||||
|
||||
See [Detection Docs](https://docs.ultralytics.com/tasks/detect/) for usage examples with these models trained on [Open Image V7](https://docs.ultralytics.com/datasets/detect/open-images-v7/), which include 600 pre-trained classes.
|
||||
|
||||
| Model | size<br><sup>(pixels) | mAP<sup>val<br>50-95 | Speed<br><sup>CPU ONNX<br>(ms) | Speed<br><sup>A100 TensorRT<br>(ms) | params<br><sup>(M) | FLOPs<br><sup>(B) |
|
||||
| ----------------------------------------------------------------------------------------- | --------------------- | -------------------- | ------------------------------ | ----------------------------------- | ------------------ | ----------------- |
|
||||
| [YOLOv8n](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n-oiv7.pt) | 640 | 18.4 | 142.4 | 1.21 | 3.5 | 10.5 |
|
||||
| [YOLOv8s](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8s-oiv7.pt) | 640 | 27.7 | 183.1 | 1.40 | 11.4 | 29.7 |
|
||||
| [YOLOv8m](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8m-oiv7.pt) | 640 | 33.6 | 408.5 | 2.26 | 26.2 | 80.6 |
|
||||
| [YOLOv8l](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8l-oiv7.pt) | 640 | 34.9 | 596.9 | 2.43 | 44.1 | 167.4 |
|
||||
| [YOLOv8x](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8x-oiv7.pt) | 640 | 36.3 | 860.6 | 3.56 | 68.7 | 260.6 |
|
||||
|
||||
- **mAP<sup>val</sup>** values are for single-model single-scale on [Open Image V7](https://docs.ultralytics.com/datasets/detect/open-images-v7/) dataset. <br>Reproduce by `yolo val detect data=open-images-v7.yaml device=0`
|
||||
- **Speed** averaged over Open Image V7 val images using an [Amazon EC2 P4d](https://aws.amazon.com/ec2/instance-types/p4/) instance. <br>Reproduce by `yolo val detect data=open-images-v7.yaml batch=1 device=0|cpu`
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>Segmentation (COCO)</summary>
|
||||
|
||||
See [Segmentation Docs](https://docs.ultralytics.com/tasks/segment/) for usage examples with these models trained on [COCO-Seg](https://docs.ultralytics.com/datasets/segment/coco/), which include 80 pre-trained classes.
|
||||
|
||||
| Model | size<br><sup>(pixels) | mAP<sup>box<br>50-95 | mAP<sup>mask<br>50-95 | Speed<br><sup>CPU ONNX<br>(ms) | Speed<br><sup>A100 TensorRT<br>(ms) | params<br><sup>(M) | FLOPs<br><sup>(B) |
|
||||
| -------------------------------------------------------------------------------------------- | --------------------- | -------------------- | --------------------- | ------------------------------ | ----------------------------------- | ------------------ | ----------------- |
|
||||
| [YOLOv8n-seg](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n-seg.pt) | 640 | 36.7 | 30.5 | 96.1 | 1.21 | 3.4 | 12.6 |
|
||||
| [YOLOv8s-seg](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8s-seg.pt) | 640 | 44.6 | 36.8 | 155.7 | 1.47 | 11.8 | 42.6 |
|
||||
| [YOLOv8m-seg](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8m-seg.pt) | 640 | 49.9 | 40.8 | 317.0 | 2.18 | 27.3 | 110.2 |
|
||||
| [YOLOv8l-seg](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8l-seg.pt) | 640 | 52.3 | 42.6 | 572.4 | 2.79 | 46.0 | 220.5 |
|
||||
| [YOLOv8x-seg](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8x-seg.pt) | 640 | 53.4 | 43.4 | 712.1 | 4.02 | 71.8 | 344.1 |
|
||||
|
||||
- **mAP<sup>val</sup>** values are for single-model single-scale on [COCO val2017](http://cocodataset.org) dataset. <br>Reproduce by `yolo val segment data=coco-seg.yaml device=0`
|
||||
- **Speed** averaged over COCO val images using an [Amazon EC2 P4d](https://aws.amazon.com/ec2/instance-types/p4/) instance. <br>Reproduce by `yolo val segment data=coco-seg.yaml batch=1 device=0|cpu`
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>Pose (COCO)</summary>
|
||||
|
||||
See [Pose Docs](https://docs.ultralytics.com/tasks/pose/) for usage examples with these models trained on [COCO-Pose](https://docs.ultralytics.com/datasets/pose/coco/), which include 1 pre-trained class, person.
|
||||
|
||||
| Model | size<br><sup>(pixels) | mAP<sup>pose<br>50-95 | mAP<sup>pose<br>50 | Speed<br><sup>CPU ONNX<br>(ms) | Speed<br><sup>A100 TensorRT<br>(ms) | params<br><sup>(M) | FLOPs<br><sup>(B) |
|
||||
| ---------------------------------------------------------------------------------------------------- | --------------------- | --------------------- | ------------------ | ------------------------------ | ----------------------------------- | ------------------ | ----------------- |
|
||||
| [YOLOv8n-pose](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n-pose.pt) | 640 | 50.4 | 80.1 | 131.8 | 1.18 | 3.3 | 9.2 |
|
||||
| [YOLOv8s-pose](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8s-pose.pt) | 640 | 60.0 | 86.2 | 233.2 | 1.42 | 11.6 | 30.2 |
|
||||
| [YOLOv8m-pose](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8m-pose.pt) | 640 | 65.0 | 88.8 | 456.3 | 2.00 | 26.4 | 81.0 |
|
||||
| [YOLOv8l-pose](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8l-pose.pt) | 640 | 67.6 | 90.0 | 784.5 | 2.59 | 44.4 | 168.6 |
|
||||
| [YOLOv8x-pose](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8x-pose.pt) | 640 | 69.2 | 90.2 | 1607.1 | 3.73 | 69.4 | 263.2 |
|
||||
| [YOLOv8x-pose-p6](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8x-pose-p6.pt) | 1280 | 71.6 | 91.2 | 4088.7 | 10.04 | 99.1 | 1066.4 |
|
||||
|
||||
- **mAP<sup>val</sup>** values are for single-model single-scale on [COCO Keypoints val2017](http://cocodataset.org) dataset. <br>Reproduce by `yolo val pose data=coco-pose.yaml device=0`
|
||||
- **Speed** averaged over COCO val images using an [Amazon EC2 P4d](https://aws.amazon.com/ec2/instance-types/p4/) instance. <br>Reproduce by `yolo val pose data=coco-pose.yaml batch=1 device=0|cpu`
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>Classification (ImageNet)</summary>
|
||||
|
||||
See [Classification Docs](https://docs.ultralytics.com/tasks/classify/) for usage examples with these models trained on [ImageNet](https://docs.ultralytics.com/datasets/classify/imagenet/), which include 1000 pretrained classes.
|
||||
|
||||
| Model | size<br><sup>(pixels) | acc<br><sup>top1 | acc<br><sup>top5 | Speed<br><sup>CPU ONNX<br>(ms) | Speed<br><sup>A100 TensorRT<br>(ms) | params<br><sup>(M) | FLOPs<br><sup>(B) at 640 |
|
||||
| -------------------------------------------------------------------------------------------- | --------------------- | ---------------- | ---------------- | ------------------------------ | ----------------------------------- | ------------------ | ------------------------ |
|
||||
| [YOLOv8n-cls](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n-cls.pt) | 224 | 66.6 | 87.0 | 12.9 | 0.31 | 2.7 | 4.3 |
|
||||
| [YOLOv8s-cls](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8s-cls.pt) | 224 | 72.3 | 91.1 | 23.4 | 0.35 | 6.4 | 13.5 |
|
||||
| [YOLOv8m-cls](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8m-cls.pt) | 224 | 76.4 | 93.2 | 85.4 | 0.62 | 17.0 | 42.7 |
|
||||
| [YOLOv8l-cls](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8l-cls.pt) | 224 | 78.0 | 94.1 | 163.0 | 0.87 | 37.5 | 99.7 |
|
||||
| [YOLOv8x-cls](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8x-cls.pt) | 224 | 78.4 | 94.3 | 232.0 | 1.01 | 57.4 | 154.8 |
|
||||
|
||||
- **acc** values are model accuracies on the [ImageNet](https://www.image-net.org/) dataset validation set. <br>Reproduce by `yolo val classify data=path/to/ImageNet device=0`
|
||||
- **Speed** averaged over ImageNet val images using an [Amazon EC2 P4d](https://aws.amazon.com/ec2/instance-types/p4/) instance. <br>Reproduce by `yolo val classify data=path/to/ImageNet batch=1 device=0|cpu`
|
||||
|
||||
</details>
|
||||
|
||||
## <div align="center">Integrations</div>
|
||||
|
||||
Our 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 with [Roboflow](https://roboflow.com/?ref=ultralytics), ClearML, [Comet](https://bit.ly/yolov8-readme-comet), Neural Magic and [OpenVINO](https://docs.ultralytics.com/integrations/openvino), can optimize your AI workflow.
|
||||
|
||||
<br>
|
||||
<a href="https://bit.ly/ultralytics_hub" target="_blank">
|
||||
<img width="100%" src="https://github.com/ultralytics/assets/raw/main/yolov8/banner-integrations.png" alt="Ultralytics active learning integrations"></a>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<div align="center">
|
||||
<a href="https://roboflow.com/?ref=ultralytics">
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/partners/logo-roboflow.png" width="10%" alt="Roboflow logo"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="15%" height="0" alt="space">
|
||||
<a href="https://cutt.ly/yolov5-readme-clearml">
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/partners/logo-clearml.png" width="10%" alt="ClearML logo"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="15%" height="0" alt="space">
|
||||
<a href="https://bit.ly/yolov8-readme-comet">
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/partners/logo-comet.png" width="10%" alt="Comet ML logo"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="15%" height="0" alt="space">
|
||||
<a href="https://bit.ly/yolov5-neuralmagic">
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/partners/logo-neuralmagic.png" width="10%" alt="NeuralMagic logo"></a>
|
||||
</div>
|
||||
|
||||
| Roboflow | ClearML ⭐ NEW | Comet ⭐ NEW | Neural Magic ⭐ NEW |
|
||||
| :--------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------: |
|
||||
| Label and export your custom datasets directly to YOLOv8 for training with [Roboflow](https://roboflow.com/?ref=ultralytics) | Automatically track, visualize and even remotely train YOLOv8 using [ClearML](https://cutt.ly/yolov5-readme-clearml) (open-source!) | Free forever, [Comet](https://bit.ly/yolov8-readme-comet) lets you save YOLOv8 models, resume training, and interactively visualize and debug predictions | Run YOLOv8 inference up to 6x faster with [Neural Magic DeepSparse](https://bit.ly/yolov5-neuralmagic) |
|
||||
|
||||
## <div align="center">Ultralytics HUB</div>
|
||||
|
||||
Experience seamless AI with [Ultralytics HUB](https://bit.ly/ultralytics_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-friendly [Ultralytics App](https://ultralytics.com/app_install). Start your journey for **Free** now!
|
||||
|
||||
<a href="https://bit.ly/ultralytics_hub" target="_blank">
|
||||
<img width="100%" src="https://github.com/ultralytics/assets/raw/main/im/ultralytics-hub.png" alt="Ultralytics HUB preview image"></a>
|
||||
|
||||
## <div align="center">Contribute</div>
|
||||
|
||||
We love your input! YOLOv5 and YOLOv8 would not be possible without help from our community. Please see our [Contributing Guide](https://docs.ultralytics.com/help/contributing) to get started, and fill out our [Survey](https://ultralytics.com/survey?utm_source=github&utm_medium=social&utm_campaign=Survey) to send us feedback on your experience. Thank you 🙏 to all our contributors!
|
||||
|
||||
<!-- SVG image from https://opencollective.com/ultralytics/contributors.svg?width=990 -->
|
||||
|
||||
<a href="https://github.com/ultralytics/yolov5/graphs/contributors">
|
||||
<img width="100%" src="https://github.com/ultralytics/assets/raw/main/im/image-contributors.png" alt="Ultralytics open-source contributors"></a>
|
||||
|
||||
## <div align="center">License</div>
|
||||
|
||||
Ultralytics offers two licensing options to accommodate diverse use cases:
|
||||
|
||||
- **AGPL-3.0 License**: This [OSI-approved](https://opensource.org/licenses/) open-source license is ideal for students and enthusiasts, promoting open collaboration and knowledge sharing. See the [LICENSE](https://github.com/ultralytics/ultralytics/blob/main/LICENSE) file 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 through [Ultralytics Licensing](https://ultralytics.com/license).
|
||||
|
||||
## <div align="center">Contact</div>
|
||||
|
||||
For Ultralytics bug reports and feature requests please visit [GitHub Issues](https://github.com/ultralytics/ultralytics/issues), and join our [Discord](https://ultralytics.com/discord) community for questions and discussions!
|
||||
|
||||
<br>
|
||||
<div align="center">
|
||||
<a href="https://github.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-github.png" width="3%" alt="Ultralytics GitHub"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
||||
<a href="https://www.linkedin.com/company/ultralytics/"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-linkedin.png" width="3%" alt="Ultralytics LinkedIn"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
||||
<a href="https://twitter.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-twitter.png" width="3%" alt="Ultralytics Twitter"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
||||
<a href="https://youtube.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-youtube.png" width="3%" alt="Ultralytics YouTube"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
||||
<a href="https://www.tiktok.com/@ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-tiktok.png" width="3%" alt="Ultralytics TikTok"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
||||
<a href="https://www.instagram.com/ultralytics/"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-instagram.png" width="3%" alt="Ultralytics Instagram"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
||||
<a href="https://ultralytics.com/discord"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-discord.png" width="3%" alt="Ultralytics Discord"></a>
|
||||
</div>
|
2
ultralytics/README.md:Zone.Identifier
Executable file
2
ultralytics/README.md:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
265
ultralytics/README.zh-CN.md
Executable file
265
ultralytics/README.zh-CN.md
Executable file
@ -0,0 +1,265 @@
|
||||
<div align="center">
|
||||
<p>
|
||||
<a href="https://yolovision.ultralytics.com/" target="_blank">
|
||||
<img width="100%" src="https://raw.githubusercontent.com/ultralytics/assets/main/im/banner-yolo-vision-2023.png" alt="YOLO Vision banner"></a>
|
||||
</p>
|
||||
|
||||
[中文](https://docs.ultralytics.com/zh/) | [한국어](https://docs.ultralytics.com/ko/) | [日本語](https://docs.ultralytics.com/ja/) | [Русский](https://docs.ultralytics.com/ru/) | [Deutsch](https://docs.ultralytics.com/de/) | [Français](https://docs.ultralytics.com/fr/) | [Español](https://docs.ultralytics.com/es/) | [Português](https://docs.ultralytics.com/pt/) | [हिन्दी](https://docs.ultralytics.com/hi/) | [العربية](https://docs.ultralytics.com/ar/) <br>
|
||||
|
||||
<div>
|
||||
<a href="https://github.com/ultralytics/ultralytics/actions/workflows/ci.yaml"><img src="https://github.com/ultralytics/ultralytics/actions/workflows/ci.yaml/badge.svg" alt="Ultralytics CI"></a>
|
||||
<a href="https://codecov.io/github/ultralytics/ultralytics"><img src="https://codecov.io/github/ultralytics/ultralytics/branch/main/graph/badge.svg?token=HHW7IIVFVY" alt="Ultralytics Code Coverage"></a>
|
||||
<a href="https://zenodo.org/badge/latestdoi/264818686"><img src="https://zenodo.org/badge/264818686.svg" alt="YOLOv8 Citation"></a>
|
||||
<a href="https://hub.docker.com/r/ultralytics/ultralytics"><img src="https://img.shields.io/docker/pulls/ultralytics/ultralytics?logo=docker" alt="Docker Pulls"></a>
|
||||
<a href="https://ultralytics.com/discord"><img alt="Discord" src="https://img.shields.io/discord/1089800235347353640?logo=discord&logoColor=white&label=Discord&color=blue"></a>
|
||||
<br>
|
||||
<a href="https://console.paperspace.com/github/ultralytics/ultralytics"><img src="https://assets.paperspace.io/img/gradient-badge.svg" alt="Run on Gradient"></a>
|
||||
<a href="https://colab.research.google.com/github/ultralytics/ultralytics/blob/main/examples/tutorial.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a>
|
||||
<a href="https://www.kaggle.com/ultralytics/yolov8"><img src="https://kaggle.com/static/images/open-in-kaggle.svg" alt="Open In Kaggle"></a>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
[Ultralytics](https://ultralytics.com) [YOLOv8](https://github.com/ultralytics/ultralytics) 是一款前沿、最先进(SOTA)的模型,基于先前 YOLO 版本的成功,引入了新功能和改进,进一步提升性能和灵活性。YOLOv8 设计快速、准确且易于使用,使其成为各种物体检测与跟踪、实例分割、图像分类和姿态估计任务的绝佳选择。
|
||||
|
||||
我们希望这里的资源能帮助您充分利用 YOLOv8。请浏览 YOLOv8 <a href="https://docs.ultralytics.com/">文档</a> 了解详细信息,在 <a href="https://github.com/ultralytics/ultralytics/issues/new/choose">GitHub</a> 上提交问题以获得支持,并加入我们的 <a href="https://ultralytics.com/discord">Discord</a> 社区进行问题和讨论!
|
||||
|
||||
如需申请企业许可,请在 [Ultralytics Licensing](https://ultralytics.com/license) 处填写表格
|
||||
|
||||
<img width="100%" src="https://raw.githubusercontent.com/ultralytics/assets/main/yolov8/yolo-comparison-plots.png" alt="YOLOv8 performance plots"></a>
|
||||
|
||||
<div align="center">
|
||||
<a href="https://github.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-github.png" width="2%" alt="Ultralytics GitHub"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%" alt="space">
|
||||
<a href="https://www.linkedin.com/company/ultralytics/"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-linkedin.png" width="2%" alt="Ultralytics LinkedIn"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%" alt="space">
|
||||
<a href="https://twitter.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-twitter.png" width="2%" alt="Ultralytics Twitter"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%" alt="space">
|
||||
<a href="https://youtube.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-youtube.png" width="2%" alt="Ultralytics YouTube"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%" alt="space">
|
||||
<a href="https://www.tiktok.com/@ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-tiktok.png" width="2%" alt="Ultralytics TikTok"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%" alt="space">
|
||||
<a href="https://www.instagram.com/ultralytics/"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-instagram.png" width="2%" alt="Ultralytics Instagram"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%" alt="space">
|
||||
<a href="https://ultralytics.com/discord"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-discord.png" width="2%" alt="Ultralytics Discord"></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
## <div align="center">文档</div>
|
||||
|
||||
请参阅下面的快速安装和使用示例,以及 [YOLOv8 文档](https://docs.ultralytics.com) 上有关训练、验证、预测和部署的完整文档。
|
||||
|
||||
<details open>
|
||||
<summary>安装</summary>
|
||||
|
||||
使用Pip在一个[**Python>=3.8**](https://www.python.org/)环境中安装`ultralytics`包,此环境还需包含[**PyTorch>=1.8**](https://pytorch.org/get-started/locally/)。这也会安装所有必要的[依赖项](https://github.com/ultralytics/ultralytics/blob/main/requirements.txt)。
|
||||
|
||||
[](https://badge.fury.io/py/ultralytics) [](https://pepy.tech/project/ultralytics)
|
||||
|
||||
```bash
|
||||
pip install ultralytics
|
||||
```
|
||||
|
||||
如需使用包括[Conda](https://anaconda.org/conda-forge/ultralytics)、[Docker](https://hub.docker.com/r/ultralytics/ultralytics)和Git在内的其他安装方法,请参考[快速入门指南](https://docs.ultralytics.com/quickstart)。
|
||||
|
||||
</details>
|
||||
|
||||
<details open>
|
||||
<summary>Usage</summary>
|
||||
|
||||
#### CLI
|
||||
|
||||
YOLOv8 可以在命令行界面(CLI)中直接使用,只需输入 `yolo` 命令:
|
||||
|
||||
```bash
|
||||
yolo predict model=yolov8n.pt source='https://ultralytics.com/images/bus.jpg'
|
||||
```
|
||||
|
||||
`yolo` 可用于各种任务和模式,并接受其他参数,例如 `imgsz=640`。查看 YOLOv8 [CLI 文档](https://docs.ultralytics.com/usage/cli)以获取示例。
|
||||
|
||||
#### Python
|
||||
|
||||
YOLOv8 也可以在 Python 环境中直接使用,并接受与上述 CLI 示例中相同的[参数](https://docs.ultralytics.com/usage/cfg/):
|
||||
|
||||
```python
|
||||
from ultralytics import YOLO
|
||||
|
||||
# 加载模型
|
||||
model = YOLO("yolov8n.yaml") # 从头开始构建新模型
|
||||
model = YOLO("yolov8n.pt") # 加载预训练模型(建议用于训练)
|
||||
|
||||
# 使用模型
|
||||
model.train(data="coco128.yaml", epochs=3) # 训练模型
|
||||
metrics = model.val() # 在验证集上评估模型性能
|
||||
results = model("https://ultralytics.com/images/bus.jpg") # 对图像进行预测
|
||||
success = model.export(format="onnx") # 将模型导出为 ONNX 格式
|
||||
```
|
||||
|
||||
查看 YOLOv8 [Python 文档](https://docs.ultralytics.com/usage/python)以获取更多示例。
|
||||
|
||||
</details>
|
||||
|
||||
## <div align="center">模型</div>
|
||||
|
||||
在[COCO](https://docs.ultralytics.com/datasets/detect/coco)数据集上预训练的YOLOv8 [检测](https://docs.ultralytics.com/tasks/detect),[分割](https://docs.ultralytics.com/tasks/segment)和[姿态](https://docs.ultralytics.com/tasks/pose)模型可以在这里找到,以及在[ImageNet](https://docs.ultralytics.com/datasets/classify/imagenet)数据集上预训练的YOLOv8 [分类](https://docs.ultralytics.com/tasks/classify)模型。所有的检测,分割和姿态模型都支持[追踪](https://docs.ultralytics.com/modes/track)模式。
|
||||
|
||||
<img width="1024" src="https://raw.githubusercontent.com/ultralytics/assets/main/im/banner-tasks.png" alt="Ultralytics YOLO supported tasks">
|
||||
|
||||
所有[模型](https://github.com/ultralytics/ultralytics/tree/main/ultralytics/cfg/models)在首次使用时会自动从最新的Ultralytics [发布版本](https://github.com/ultralytics/assets/releases)下载。
|
||||
|
||||
<details open><summary>检测 (COCO)</summary>
|
||||
|
||||
查看[检测文档](https://docs.ultralytics.com/tasks/detect/)以获取这些在[COCO](https://docs.ultralytics.com/datasets/detect/coco/)上训练的模型的使用示例,其中包括80个预训练类别。
|
||||
|
||||
| 模型 | 尺寸<br><sup>(像素) | mAP<sup>val<br>50-95 | 速度<br><sup>CPU ONNX<br>(ms) | 速度<br><sup>A100 TensorRT<br>(ms) | 参数<br><sup>(M) | FLOPs<br><sup>(B) |
|
||||
| ------------------------------------------------------------------------------------ | --------------- | -------------------- | --------------------------- | -------------------------------- | -------------- | ----------------- |
|
||||
| [YOLOv8n](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n.pt) | 640 | 37.3 | 80.4 | 0.99 | 3.2 | 8.7 |
|
||||
| [YOLOv8s](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8s.pt) | 640 | 44.9 | 128.4 | 1.20 | 11.2 | 28.6 |
|
||||
| [YOLOv8m](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8m.pt) | 640 | 50.2 | 234.7 | 1.83 | 25.9 | 78.9 |
|
||||
| [YOLOv8l](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8l.pt) | 640 | 52.9 | 375.2 | 2.39 | 43.7 | 165.2 |
|
||||
| [YOLOv8x](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8x.pt) | 640 | 53.9 | 479.1 | 3.53 | 68.2 | 257.8 |
|
||||
|
||||
- **mAP<sup>val</sup>** 值是基于单模型单尺度在 [COCO val2017](http://cocodataset.org) 数据集上的结果。 <br>通过 `yolo val detect data=coco.yaml device=0` 复现
|
||||
- **速度** 是使用 [Amazon EC2 P4d](https://aws.amazon.com/ec2/instance-types/p4/) 实例对 COCO val 图像进行平均计算的。 <br>通过 `yolo val detect data=coco.yaml batch=1 device=0|cpu` 复现
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>检测(Open Image V7)</summary>
|
||||
|
||||
查看[检测文档](https://docs.ultralytics.com/tasks/detect/)以获取这些在[Open Image V7](https://docs.ultralytics.com/datasets/detect/open-images-v7/)上训练的模型的使用示例,其中包括600个预训练类别。
|
||||
|
||||
| 模型 | 尺寸<br><sup>(像素) | mAP<sup>验证<br>50-95 | 速度<br><sup>CPU ONNX<br>(毫秒) | 速度<br><sup>A100 TensorRT<br>(毫秒) | 参数<br><sup>(M) | 浮点运算<br><sup>(B) |
|
||||
| ----------------------------------------------------------------------------------------- | --------------- | ------------------- | --------------------------- | -------------------------------- | -------------- | ---------------- |
|
||||
| [YOLOv8n](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n-oiv7.pt) | 640 | 18.4 | 142.4 | 1.21 | 3.5 | 10.5 |
|
||||
| [YOLOv8s](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8s-oiv7.pt) | 640 | 27.7 | 183.1 | 1.40 | 11.4 | 29.7 |
|
||||
| [YOLOv8m](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8m-oiv7.pt) | 640 | 33.6 | 408.5 | 2.26 | 26.2 | 80.6 |
|
||||
| [YOLOv8l](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8l-oiv7.pt) | 640 | 34.9 | 596.9 | 2.43 | 44.1 | 167.4 |
|
||||
| [YOLOv8x](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8x-oiv7.pt) | 640 | 36.3 | 860.6 | 3.56 | 68.7 | 260.6 |
|
||||
|
||||
- **mAP<sup>验证</sup>** 值适用于在[Open Image V7](https://docs.ultralytics.com/datasets/detect/open-images-v7/)数据集上的单模型单尺度。 <br>通过 `yolo val detect data=open-images-v7.yaml device=0` 以复现。
|
||||
- **速度** 在使用[Amazon EC2 P4d](https://aws.amazon.com/ec2/instance-types/p4/)实例对Open Image V7验证图像进行平均测算。 <br>通过 `yolo val detect data=open-images-v7.yaml batch=1 device=0|cpu` 以复现。
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>分割 (COCO)</summary>
|
||||
|
||||
查看[分割文档](https://docs.ultralytics.com/tasks/segment/)以获取这些在[COCO-Seg](https://docs.ultralytics.com/datasets/segment/coco/)上训练的模型的使用示例,其中包括80个预训练类别。
|
||||
|
||||
| 模型 | 尺寸<br><sup>(像素) | mAP<sup>box<br>50-95 | mAP<sup>mask<br>50-95 | 速度<br><sup>CPU ONNX<br>(ms) | 速度<br><sup>A100 TensorRT<br>(ms) | 参数<br><sup>(M) | FLOPs<br><sup>(B) |
|
||||
| -------------------------------------------------------------------------------------------- | --------------- | -------------------- | --------------------- | --------------------------- | -------------------------------- | -------------- | ----------------- |
|
||||
| [YOLOv8n-seg](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n-seg.pt) | 640 | 36.7 | 30.5 | 96.1 | 1.21 | 3.4 | 12.6 |
|
||||
| [YOLOv8s-seg](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8s-seg.pt) | 640 | 44.6 | 36.8 | 155.7 | 1.47 | 11.8 | 42.6 |
|
||||
| [YOLOv8m-seg](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8m-seg.pt) | 640 | 49.9 | 40.8 | 317.0 | 2.18 | 27.3 | 110.2 |
|
||||
| [YOLOv8l-seg](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8l-seg.pt) | 640 | 52.3 | 42.6 | 572.4 | 2.79 | 46.0 | 220.5 |
|
||||
| [YOLOv8x-seg](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8x-seg.pt) | 640 | 53.4 | 43.4 | 712.1 | 4.02 | 71.8 | 344.1 |
|
||||
|
||||
- **mAP<sup>val</sup>** 值是基于单模型单尺度在 [COCO val2017](http://cocodataset.org) 数据集上的结果。 <br>通过 `yolo val segment data=coco-seg.yaml device=0` 复现
|
||||
- **速度** 是使用 [Amazon EC2 P4d](https://aws.amazon.com/ec2/instance-types/p4/) 实例对 COCO val 图像进行平均计算的。 <br>通过 `yolo val segment data=coco-seg.yaml batch=1 device=0|cpu` 复现
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>姿态 (COCO)</summary>
|
||||
|
||||
查看[姿态文档](https://docs.ultralytics.com/tasks/pose/)以获取这些在[COCO-Pose](https://docs.ultralytics.com/datasets/pose/coco/)上训练的模型的使用示例,其中包括1个预训练类别,即人。
|
||||
|
||||
| 模型 | 尺寸<br><sup>(像素) | mAP<sup>pose<br>50-95 | mAP<sup>pose<br>50 | 速度<br><sup>CPU ONNX<br>(ms) | 速度<br><sup>A100 TensorRT<br>(ms) | 参数<br><sup>(M) | FLOPs<br><sup>(B) |
|
||||
| ---------------------------------------------------------------------------------------------------- | --------------- | --------------------- | ------------------ | --------------------------- | -------------------------------- | -------------- | ----------------- |
|
||||
| [YOLOv8n-pose](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n-pose.pt) | 640 | 50.4 | 80.1 | 131.8 | 1.18 | 3.3 | 9.2 |
|
||||
| [YOLOv8s-pose](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8s-pose.pt) | 640 | 60.0 | 86.2 | 233.2 | 1.42 | 11.6 | 30.2 |
|
||||
| [YOLOv8m-pose](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8m-pose.pt) | 640 | 65.0 | 88.8 | 456.3 | 2.00 | 26.4 | 81.0 |
|
||||
| [YOLOv8l-pose](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8l-pose.pt) | 640 | 67.6 | 90.0 | 784.5 | 2.59 | 44.4 | 168.6 |
|
||||
| [YOLOv8x-pose](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8x-pose.pt) | 640 | 69.2 | 90.2 | 1607.1 | 3.73 | 69.4 | 263.2 |
|
||||
| [YOLOv8x-pose-p6](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8x-pose-p6.pt) | 1280 | 71.6 | 91.2 | 4088.7 | 10.04 | 99.1 | 1066.4 |
|
||||
|
||||
- **mAP<sup>val</sup>** 值是基于单模型单尺度在 [COCO Keypoints val2017](http://cocodataset.org) 数据集上的结果。 <br>通过 `yolo val pose data=coco-pose.yaml device=0` 复现
|
||||
- **速度** 是使用 [Amazon EC2 P4d](https://aws.amazon.com/ec2/instance-types/p4/) 实例对 COCO val 图像进行平均计算的。 <br>通过 `yolo val pose data=coco-pose.yaml batch=1 device=0|cpu` 复现
|
||||
|
||||
</details>
|
||||
|
||||
<details><summary>分类 (ImageNet)</summary>
|
||||
|
||||
查看[分类文档](https://docs.ultralytics.com/tasks/classify/)以获取这些在[ImageNet](https://docs.ultralytics.com/datasets/classify/imagenet/)上训练的模型的使用示例,其中包括1000个预训练类别。
|
||||
|
||||
| 模型 | 尺寸<br><sup>(像素) | acc<br><sup>top1 | acc<br><sup>top5 | 速度<br><sup>CPU ONNX<br>(ms) | 速度<br><sup>A100 TensorRT<br>(ms) | 参数<br><sup>(M) | FLOPs<br><sup>(B) at 640 |
|
||||
| -------------------------------------------------------------------------------------------- | --------------- | ---------------- | ---------------- | --------------------------- | -------------------------------- | -------------- | ------------------------ |
|
||||
| [YOLOv8n-cls](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n-cls.pt) | 224 | 66.6 | 87.0 | 12.9 | 0.31 | 2.7 | 4.3 |
|
||||
| [YOLOv8s-cls](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8s-cls.pt) | 224 | 72.3 | 91.1 | 23.4 | 0.35 | 6.4 | 13.5 |
|
||||
| [YOLOv8m-cls](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8m-cls.pt) | 224 | 76.4 | 93.2 | 85.4 | 0.62 | 17.0 | 42.7 |
|
||||
| [YOLOv8l-cls](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8l-cls.pt) | 224 | 78.0 | 94.1 | 163.0 | 0.87 | 37.5 | 99.7 |
|
||||
| [YOLOv8x-cls](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8x-cls.pt) | 224 | 78.4 | 94.3 | 232.0 | 1.01 | 57.4 | 154.8 |
|
||||
|
||||
- **acc** 值是模型在 [ImageNet](https://www.image-net.org/) 数据集验证集上的准确率。 <br>通过 `yolo val classify data=path/to/ImageNet device=0` 复现
|
||||
- **速度** 是使用 [Amazon EC2 P4d](https://aws.amazon.com/ec2/instance-types/p4/) 实例对 ImageNet val 图像进行平均计算的。 <br>通过 `yolo val classify data=path/to/ImageNet batch=1 device=0|cpu` 复现
|
||||
|
||||
</details>
|
||||
|
||||
## <div align="center">集成</div>
|
||||
|
||||
我们与领先的AI平台的关键整合扩展了Ultralytics产品的功能,增强了数据集标签化、训练、可视化和模型管理等任务。探索Ultralytics如何与[Roboflow](https://roboflow.com/?ref=ultralytics)、ClearML、[Comet](https://bit.ly/yolov8-readme-comet)、Neural Magic以及[OpenVINO](https://docs.ultralytics.com/integrations/openvino)合作,优化您的AI工作流程。
|
||||
|
||||
<br>
|
||||
<a href="https://bit.ly/ultralytics_hub" target="_blank">
|
||||
<img width="100%" src="https://github.com/ultralytics/assets/raw/main/yolov8/banner-integrations.png" alt="Ultralytics active learning integrations"></a>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<div align="center">
|
||||
<a href="https://roboflow.com/?ref=ultralytics">
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/partners/logo-roboflow.png" width="10%" alt="Roboflow logo"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="15%" height="0" alt="space">
|
||||
<a href="https://cutt.ly/yolov5-readme-clearml">
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/partners/logo-clearml.png" width="10%" alt="ClearML logo"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="15%" height="0" alt="space">
|
||||
<a href="https://bit.ly/yolov8-readme-comet">
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/partners/logo-comet.png" width="10%" alt="Comet ML logo"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="15%" height="0" alt="space">
|
||||
<a href="https://bit.ly/yolov5-neuralmagic">
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/partners/logo-neuralmagic.png" width="10%" alt="NeuralMagic logo"></a>
|
||||
</div>
|
||||
|
||||
| Roboflow | ClearML ⭐ NEW | Comet ⭐ NEW | Neural Magic ⭐ NEW |
|
||||
| :--------------------------------------------------------------------------------: | :----------------------------------------------------------------------------: | :----------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------: |
|
||||
| 使用 [Roboflow](https://roboflow.com/?ref=ultralytics) 将您的自定义数据集直接标记并导出至 YOLOv8 进行训练 | 使用 [ClearML](https://cutt.ly/yolov5-readme-clearml)(开源!)自动跟踪、可视化,甚至远程训练 YOLOv8 | 免费且永久,[Comet](https://bit.ly/yolov8-readme-comet) 让您保存 YOLOv8 模型、恢复训练,并以交互式方式查看和调试预测 | 使用 [Neural Magic DeepSparse](https://bit.ly/yolov5-neuralmagic) 使 YOLOv8 推理速度提高多达 6 倍 |
|
||||
|
||||
## <div align="center">Ultralytics HUB</div>
|
||||
|
||||
体验 [Ultralytics HUB](https://bit.ly/ultralytics_hub) ⭐ 带来的无缝 AI,这是一个一体化解决方案,用于数据可视化、YOLOv5 和即将推出的 YOLOv8 🚀 模型训练和部署,无需任何编码。通过我们先进的平台和用户友好的 [Ultralytics 应用程序](https://ultralytics.com/app_install),轻松将图像转化为可操作的见解,并实现您的 AI 愿景。现在就开始您的**免费**之旅!
|
||||
|
||||
<a href="https://bit.ly/ultralytics_hub" target="_blank">
|
||||
<img width="100%" src="https://github.com/ultralytics/assets/raw/main/im/ultralytics-hub.png" alt="Ultralytics HUB preview image"></a>
|
||||
|
||||
## <div align="center">贡献</div>
|
||||
|
||||
我们喜欢您的参与!没有社区的帮助,YOLOv5 和 YOLOv8 将无法实现。请参阅我们的[贡献指南](https://docs.ultralytics.com/help/contributing)以开始使用,并填写我们的[调查问卷](https://ultralytics.com/survey?utm_source=github&utm_medium=social&utm_campaign=Survey)向我们提供您的使用体验反馈。感谢所有贡献者的支持!🙏
|
||||
|
||||
<!-- SVG image from https://opencollective.com/ultralytics/contributors.svg?width=990 -->
|
||||
|
||||
<a href="https://github.com/ultralytics/yolov5/graphs/contributors">
|
||||
<img width="100%" src="https://github.com/ultralytics/assets/raw/main/im/image-contributors.png" alt="Ultralytics open-source contributors"></a>
|
||||
|
||||
## <div align="center">许可证</div>
|
||||
|
||||
Ultralytics 提供两种许可证选项以适应各种使用场景:
|
||||
|
||||
- **AGPL-3.0 许可证**:这个[OSI 批准](https://opensource.org/licenses/)的开源许可证非常适合学生和爱好者,可以推动开放的协作和知识分享。请查看[LICENSE](https://github.com/ultralytics/ultralytics/blob/main/LICENSE) 文件以了解更多细节。
|
||||
- **企业许可证**:专为商业用途设计,该许可证允许将 Ultralytics 的软件和 AI 模型无缝集成到商业产品和服务中,从而绕过 AGPL-3.0 的开源要求。如果您的场景涉及将我们的解决方案嵌入到商业产品中,请通过 [Ultralytics Licensing](https://ultralytics.com/license)与我们联系。
|
||||
|
||||
## <div align="center">联系方式</div>
|
||||
|
||||
对于 Ultralytics 的错误报告和功能请求,请访问 [GitHub Issues](https://github.com/ultralytics/ultralytics/issues),并加入我们的 [Discord](https://ultralytics.com/discord) 社区进行问题和讨论!
|
||||
|
||||
<br>
|
||||
<div align="center">
|
||||
<a href="https://github.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-github.png" width="3%" alt="Ultralytics GitHub"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
||||
<a href="https://www.linkedin.com/company/ultralytics/"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-linkedin.png" width="3%" alt="Ultralytics LinkedIn"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
||||
<a href="https://twitter.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-twitter.png" width="3%" alt="Ultralytics Twitter"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
||||
<a href="https://youtube.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-youtube.png" width="3%" alt="Ultralytics YouTube"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
||||
<a href="https://www.tiktok.com/@ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-tiktok.png" width="3%" alt="Ultralytics TikTok"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
||||
<a href="https://www.instagram.com/ultralytics/"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-instagram.png" width="3%" alt="Ultralytics Instagram"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
||||
<a href="https://ultralytics.com/discord"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-discord.png" width="3%" alt="Ultralytics Discord"></a>
|
||||
</div>
|
2
ultralytics/README.zh-CN.md:Zone.Identifier
Executable file
2
ultralytics/README.zh-CN.md:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
BIN
ultralytics/bus.jpg
Executable file
BIN
ultralytics/bus.jpg
Executable file
Binary file not shown.
After Width: | Height: | Size: 476 KiB |
2
ultralytics/bus.jpg:Zone.Identifier
Executable file
2
ultralytics/bus.jpg:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
82
ultralytics/docker/Dockerfile
Executable file
82
ultralytics/docker/Dockerfile
Executable file
@ -0,0 +1,82 @@
|
||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
# Builds ultralytics/ultralytics:latest image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
||||
# Image is CUDA-optimized for YOLOv8 single/multi-GPU training and inference
|
||||
|
||||
# Start FROM PyTorch image https://hub.docker.com/r/pytorch/pytorch or nvcr.io/nvidia/pytorch:23.03-py3
|
||||
FROM pytorch/pytorch:2.1.0-cuda12.1-cudnn8-runtime
|
||||
RUN pip install --no-cache nvidia-tensorrt --index-url https://pypi.ngc.nvidia.com
|
||||
|
||||
# Downloads to user config dir
|
||||
ADD https://ultralytics.com/assets/Arial.ttf https://ultralytics.com/assets/Arial.Unicode.ttf /root/.config/Ultralytics/
|
||||
|
||||
# Install linux packages
|
||||
# g++ required to build 'tflite_support' and 'lap' packages, libusb-1.0-0 required for 'tflite_support' package
|
||||
RUN apt update \
|
||||
&& apt install --no-install-recommends -y gcc git zip curl htop libgl1 libglib2.0-0 libpython3-dev gnupg g++ libusb-1.0-0
|
||||
|
||||
# Security updates
|
||||
# https://security.snyk.io/vuln/SNYK-UBUNTU1804-OPENSSL-3314796
|
||||
RUN apt upgrade --no-install-recommends -y openssl tar
|
||||
|
||||
# Create working directory
|
||||
WORKDIR /usr/src/ultralytics
|
||||
|
||||
# Copy contents
|
||||
# COPY . /usr/src/ultralytics # git permission issues inside container
|
||||
RUN git clone https://github.com/ultralytics/ultralytics -b main /usr/src/ultralytics
|
||||
ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n.pt /usr/src/ultralytics/
|
||||
|
||||
# Install pip packages
|
||||
RUN python3 -m pip install --upgrade pip wheel
|
||||
RUN pip install --no-cache -e ".[export]" albumentations comet pycocotools pytest-cov
|
||||
|
||||
# Run exports to AutoInstall packages
|
||||
RUN yolo export model=tmp/yolov8n.pt format=edgetpu imgsz=32
|
||||
RUN yolo export model=tmp/yolov8n.pt format=ncnn imgsz=32
|
||||
# Requires <= Python 3.10, bug with paddlepaddle==2.5.0 https://github.com/PaddlePaddle/X2Paddle/issues/991
|
||||
RUN pip install --no-cache paddlepaddle==2.4.2 x2paddle
|
||||
# Fix error: `np.bool` was a deprecated alias for the builtin `bool` segmentation error in Tests
|
||||
RUN pip install --no-cache numpy==1.23.5
|
||||
# Remove exported models
|
||||
RUN rm -rf tmp
|
||||
|
||||
# Set environment variables
|
||||
ENV OMP_NUM_THREADS=1
|
||||
# Avoid DDP error "MKL_THREADING_LAYER=INTEL is incompatible with libgomp.so.1 library" https://github.com/pytorch/pytorch/issues/37377
|
||||
ENV MKL_THREADING_LAYER=GNU
|
||||
|
||||
|
||||
# Usage Examples -------------------------------------------------------------------------------------------------------
|
||||
|
||||
# Build and Push
|
||||
# t=ultralytics/ultralytics:latest && sudo docker build -f docker/Dockerfile -t $t . && sudo docker push $t
|
||||
|
||||
# Pull and Run with access to all GPUs
|
||||
# t=ultralytics/ultralytics:latest && sudo docker pull $t && sudo docker run -it --ipc=host --gpus all $t
|
||||
|
||||
# Pull and Run with access to GPUs 2 and 3 (inside container CUDA devices will appear as 0 and 1)
|
||||
# t=ultralytics/ultralytics:latest && sudo docker pull $t && sudo docker run -it --ipc=host --gpus '"device=2,3"' $t
|
||||
|
||||
# Pull and Run with local directory access
|
||||
# t=ultralytics/ultralytics:latest && sudo docker pull $t && sudo docker run -it --ipc=host --gpus all -v "$(pwd)"/datasets:/usr/src/datasets $t
|
||||
|
||||
# Kill all
|
||||
# sudo docker kill $(sudo docker ps -q)
|
||||
|
||||
# Kill all image-based
|
||||
# sudo docker kill $(sudo docker ps -qa --filter ancestor=ultralytics/ultralytics:latest)
|
||||
|
||||
# DockerHub tag update
|
||||
# t=ultralytics/ultralytics:latest tnew=ultralytics/ultralytics:v6.2 && sudo docker pull $t && sudo docker tag $t $tnew && sudo docker push $tnew
|
||||
|
||||
# Clean up
|
||||
# sudo docker system prune -a --volumes
|
||||
|
||||
# Update Ubuntu drivers
|
||||
# https://www.maketecheasier.com/install-nvidia-drivers-ubuntu/
|
||||
|
||||
# DDP test
|
||||
# python -m torch.distributed.run --nproc_per_node 2 --master_port 1 train.py --epochs 3
|
||||
|
||||
# GCP VM from Image
|
||||
# docker.io/ultralytics/ultralytics:latest
|
44
ultralytics/docker/Dockerfile-arm64
Executable file
44
ultralytics/docker/Dockerfile-arm64
Executable file
@ -0,0 +1,44 @@
|
||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
# Builds ultralytics/ultralytics:latest-arm64 image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
||||
# Image is aarch64-compatible for Apple M1 and other ARM architectures i.e. Jetson Nano and Raspberry Pi
|
||||
|
||||
# Start FROM Ubuntu image https://hub.docker.com/_/ubuntu
|
||||
FROM arm64v8/ubuntu:22.04
|
||||
|
||||
# Downloads to user config dir
|
||||
ADD https://ultralytics.com/assets/Arial.ttf https://ultralytics.com/assets/Arial.Unicode.ttf /root/.config/Ultralytics/
|
||||
|
||||
# Install linux packages
|
||||
# g++ required to build 'tflite_support' and 'lap' packages, libusb-1.0-0 required for 'tflite_support' package
|
||||
RUN apt update \
|
||||
&& apt install --no-install-recommends -y python3-pip git zip curl htop gcc libgl1 libglib2.0-0 libpython3-dev gnupg g++ libusb-1.0-0
|
||||
|
||||
# Create working directory
|
||||
WORKDIR /usr/src/ultralytics
|
||||
|
||||
# Copy contents
|
||||
# COPY . /usr/src/ultralytics # git permission issues inside container
|
||||
RUN git clone https://github.com/ultralytics/ultralytics -b main /usr/src/ultralytics
|
||||
ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n.pt /usr/src/ultralytics/
|
||||
|
||||
# Install pip packages
|
||||
RUN python3 -m pip install --upgrade pip wheel
|
||||
RUN pip install --no-cache -e .
|
||||
|
||||
# Creates a symbolic link to make 'python' point to 'python3'
|
||||
RUN ln -sf /usr/bin/python3 /usr/bin/python
|
||||
|
||||
|
||||
# Usage Examples -------------------------------------------------------------------------------------------------------
|
||||
|
||||
# Build and Push
|
||||
# t=ultralytics/ultralytics:latest-arm64 && sudo docker build --platform linux/arm64 -f docker/Dockerfile-arm64 -t $t . && sudo docker push $t
|
||||
|
||||
# Run
|
||||
# t=ultralytics/ultralytics:latest-arm64 && sudo docker run -it --ipc=host $t
|
||||
|
||||
# Pull and Run
|
||||
# t=ultralytics/ultralytics:latest-arm64 && sudo docker pull $t && sudo docker run -it --ipc=host $t
|
||||
|
||||
# Pull and Run with local volume mounted
|
||||
# t=ultralytics/ultralytics:latest-arm64 && sudo docker pull $t && sudo docker run -it --ipc=host -v "$(pwd)"/datasets:/usr/src/datasets $t
|
2
ultralytics/docker/Dockerfile-arm64:Zone.Identifier
Executable file
2
ultralytics/docker/Dockerfile-arm64:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
38
ultralytics/docker/Dockerfile-conda
Executable file
38
ultralytics/docker/Dockerfile-conda
Executable file
@ -0,0 +1,38 @@
|
||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
# Builds ultralytics/ultralytics:latest-conda image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
||||
# Image is optimized for Ultralytics Anaconda (https://anaconda.org/conda-forge/ultralytics) installation and usage
|
||||
|
||||
# Start FROM miniconda3 image https://hub.docker.com/r/continuumio/miniconda3
|
||||
FROM continuumio/miniconda3:latest
|
||||
|
||||
# Downloads to user config dir
|
||||
ADD https://ultralytics.com/assets/Arial.ttf https://ultralytics.com/assets/Arial.Unicode.ttf /root/.config/Ultralytics/
|
||||
|
||||
# Install linux packages
|
||||
RUN apt update \
|
||||
&& apt install --no-install-recommends -y libgl1
|
||||
|
||||
# Copy contents
|
||||
ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n.pt .
|
||||
|
||||
# Install conda packages
|
||||
# mkl required to fix 'OSError: libmkl_intel_lp64.so.2: cannot open shared object file: No such file or directory'
|
||||
RUN conda config --set solver libmamba && \
|
||||
conda install pytorch torchvision pytorch-cuda=11.8 -c pytorch -c nvidia && \
|
||||
conda install -c conda-forge ultralytics mkl
|
||||
# conda install -c pytorch -c nvidia -c conda-forge pytorch torchvision pytorch-cuda=11.8 ultralytics mkl
|
||||
|
||||
|
||||
# Usage Examples -------------------------------------------------------------------------------------------------------
|
||||
|
||||
# Build and Push
|
||||
# t=ultralytics/ultralytics:latest-conda && sudo docker build -f docker/Dockerfile-cpu -t $t . && sudo docker push $t
|
||||
|
||||
# Run
|
||||
# t=ultralytics/ultralytics:latest-conda && sudo docker run -it --ipc=host $t
|
||||
|
||||
# Pull and Run
|
||||
# t=ultralytics/ultralytics:latest-conda && sudo docker pull $t && sudo docker run -it --ipc=host $t
|
||||
|
||||
# Pull and Run with local volume mounted
|
||||
# t=ultralytics/ultralytics:latest-conda && sudo docker pull $t && sudo docker run -it --ipc=host -v "$(pwd)"/datasets:/usr/src/datasets $t
|
2
ultralytics/docker/Dockerfile-conda:Zone.Identifier
Executable file
2
ultralytics/docker/Dockerfile-conda:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
55
ultralytics/docker/Dockerfile-cpu
Executable file
55
ultralytics/docker/Dockerfile-cpu
Executable file
@ -0,0 +1,55 @@
|
||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
# Builds ultralytics/ultralytics:latest-cpu image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
||||
# Image is CPU-optimized for ONNX, OpenVINO and PyTorch YOLOv8 deployments
|
||||
|
||||
# Start FROM Ubuntu image https://hub.docker.com/_/ubuntu
|
||||
FROM ubuntu:23.10
|
||||
|
||||
# Downloads to user config dir
|
||||
ADD https://ultralytics.com/assets/Arial.ttf https://ultralytics.com/assets/Arial.Unicode.ttf /root/.config/Ultralytics/
|
||||
|
||||
# Install linux packages
|
||||
# g++ required to build 'tflite_support' and 'lap' packages, libusb-1.0-0 required for 'tflite_support' package
|
||||
RUN apt update \
|
||||
&& apt install --no-install-recommends -y python3-pip git zip curl htop libgl1 libglib2.0-0 libpython3-dev gnupg g++ libusb-1.0-0
|
||||
|
||||
# Create working directory
|
||||
WORKDIR /usr/src/ultralytics
|
||||
|
||||
# Copy contents
|
||||
# COPY . /usr/src/ultralytics # git permission issues inside container
|
||||
RUN git clone https://github.com/ultralytics/ultralytics -b main /usr/src/ultralytics
|
||||
ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n.pt /usr/src/ultralytics/
|
||||
|
||||
# Remove python3.11/EXTERNALLY-MANAGED or use 'pip install --break-system-packages' avoid 'externally-managed-environment' Ubuntu nightly error
|
||||
RUN rm -rf /usr/lib/python3.11/EXTERNALLY-MANAGED
|
||||
|
||||
# Install pip packages
|
||||
RUN python3 -m pip install --upgrade pip wheel
|
||||
RUN pip install --no-cache -e ".[export]" --extra-index-url https://download.pytorch.org/whl/cpu
|
||||
|
||||
# Run exports to AutoInstall packages
|
||||
RUN yolo export model=tmp/yolov8n.pt format=edgetpu imgsz=32
|
||||
RUN yolo export model=tmp/yolov8n.pt format=ncnn imgsz=32
|
||||
# Requires <= Python 3.10, bug with paddlepaddle==2.5.0 https://github.com/PaddlePaddle/X2Paddle/issues/991
|
||||
# RUN pip install --no-cache paddlepaddle==2.4.2 x2paddle
|
||||
# Remove exported models
|
||||
RUN rm -rf tmp
|
||||
|
||||
# Creates a symbolic link to make 'python' point to 'python3'
|
||||
RUN ln -sf /usr/bin/python3 /usr/bin/python
|
||||
|
||||
|
||||
# Usage Examples -------------------------------------------------------------------------------------------------------
|
||||
|
||||
# Build and Push
|
||||
# t=ultralytics/ultralytics:latest-cpu && sudo docker build -f docker/Dockerfile-cpu -t $t . && sudo docker push $t
|
||||
|
||||
# Run
|
||||
# t=ultralytics/ultralytics:latest-cpu && sudo docker run -it --ipc=host $t
|
||||
|
||||
# Pull and Run
|
||||
# t=ultralytics/ultralytics:latest-cpu && sudo docker pull $t && sudo docker run -it --ipc=host $t
|
||||
|
||||
# Pull and Run with local volume mounted
|
||||
# t=ultralytics/ultralytics:latest-cpu && sudo docker pull $t && sudo docker run -it --ipc=host -v "$(pwd)"/datasets:/usr/src/datasets $t
|
2
ultralytics/docker/Dockerfile-cpu:Zone.Identifier
Executable file
2
ultralytics/docker/Dockerfile-cpu:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
48
ultralytics/docker/Dockerfile-jetson
Executable file
48
ultralytics/docker/Dockerfile-jetson
Executable file
@ -0,0 +1,48 @@
|
||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
# Builds ultralytics/ultralytics:jetson image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
||||
# Supports JetPack for YOLOv8 on Jetson Nano, TX1/TX2, Xavier NX, AGX Xavier, AGX Orin, and Orin NX
|
||||
|
||||
# Start FROM https://catalog.ngc.nvidia.com/orgs/nvidia/containers/l4t-pytorch
|
||||
FROM nvcr.io/nvidia/l4t-pytorch:r35.2.1-pth2.0-py3
|
||||
|
||||
# Downloads to user config dir
|
||||
ADD https://ultralytics.com/assets/Arial.ttf https://ultralytics.com/assets/Arial.Unicode.ttf /root/.config/Ultralytics/
|
||||
|
||||
# Install linux packages
|
||||
# g++ required to build 'tflite_support' and 'lap' packages, libusb-1.0-0 required for 'tflite_support' package
|
||||
RUN apt update \
|
||||
&& apt install --no-install-recommends -y gcc git zip curl htop libgl1 libglib2.0-0 libpython3-dev gnupg g++ libusb-1.0-0
|
||||
|
||||
# Create working directory
|
||||
WORKDIR /usr/src/ultralytics
|
||||
|
||||
# Copy contents
|
||||
# COPY . /usr/src/ultralytics # git permission issues inside container
|
||||
RUN git clone https://github.com/ultralytics/ultralytics -b main /usr/src/ultralytics
|
||||
ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n.pt /usr/src/ultralytics/
|
||||
|
||||
# Remove opencv-python from requirements.txt as it conflicts with opencv-python installed in base image
|
||||
RUN grep -v '^opencv-python' requirements.txt > tmp.txt && mv tmp.txt requirements.txt
|
||||
|
||||
# Install pip packages manually for TensorRT compatibility https://github.com/NVIDIA/TensorRT/issues/2567
|
||||
RUN python3 -m pip install --upgrade pip wheel
|
||||
RUN pip install --no-cache tqdm matplotlib pyyaml psutil pandas onnx "numpy==1.23"
|
||||
RUN pip install --no-cache -e .
|
||||
|
||||
# Set environment variables
|
||||
ENV OMP_NUM_THREADS=1
|
||||
|
||||
|
||||
# Usage Examples -------------------------------------------------------------------------------------------------------
|
||||
|
||||
# Build and Push
|
||||
# t=ultralytics/ultralytics:latest-jetson && sudo docker build --platform linux/arm64 -f docker/Dockerfile-jetson -t $t . && sudo docker push $t
|
||||
|
||||
# Run
|
||||
# t=ultralytics/ultralytics:latest-jetson && sudo docker run -it --ipc=host $t
|
||||
|
||||
# Pull and Run
|
||||
# t=ultralytics/ultralytics:latest-jetson && sudo docker pull $t && sudo docker run -it --ipc=host $t
|
||||
|
||||
# Pull and Run with NVIDIA runtime
|
||||
# t=ultralytics/ultralytics:latest-jetson && sudo docker pull $t && sudo docker run -it --ipc=host --runtime=nvidia $t
|
2
ultralytics/docker/Dockerfile-jetson:Zone.Identifier
Executable file
2
ultralytics/docker/Dockerfile-jetson:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
52
ultralytics/docker/Dockerfile-python
Executable file
52
ultralytics/docker/Dockerfile-python
Executable file
@ -0,0 +1,52 @@
|
||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
# Builds ultralytics/ultralytics:latest-cpu image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
||||
# Image is CPU-optimized for ONNX, OpenVINO and PyTorch YOLOv8 deployments
|
||||
|
||||
# Use the official Python 3.10 slim-bookworm as base image
|
||||
FROM python:3.10-slim-bookworm
|
||||
|
||||
# Downloads to user config dir
|
||||
ADD https://ultralytics.com/assets/Arial.ttf https://ultralytics.com/assets/Arial.Unicode.ttf /root/.config/Ultralytics/
|
||||
|
||||
# Install linux packages
|
||||
# g++ required to build 'tflite_support' and 'lap' packages, libusb-1.0-0 required for 'tflite_support' package
|
||||
RUN apt update \
|
||||
&& apt install --no-install-recommends -y python3-pip git zip curl htop libgl1 libglib2.0-0 libpython3-dev gnupg g++ libusb-1.0-0
|
||||
|
||||
# Create working directory
|
||||
WORKDIR /usr/src/ultralytics
|
||||
|
||||
# Copy contents
|
||||
# COPY . /usr/src/ultralytics # git permission issues inside container
|
||||
RUN git clone https://github.com/ultralytics/ultralytics -b main /usr/src/ultralytics
|
||||
ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n.pt /usr/src/ultralytics/
|
||||
|
||||
# Remove python3.11/EXTERNALLY-MANAGED or use 'pip install --break-system-packages' avoid 'externally-managed-environment' Ubuntu nightly error
|
||||
# RUN rm -rf /usr/lib/python3.11/EXTERNALLY-MANAGED
|
||||
|
||||
# Install pip packages
|
||||
RUN python3 -m pip install --upgrade pip wheel
|
||||
RUN pip install --no-cache -e ".[export]" --extra-index-url https://download.pytorch.org/whl/cpu
|
||||
|
||||
# Run exports to AutoInstall packages
|
||||
RUN yolo export model=tmp/yolov8n.pt format=edgetpu imgsz=32
|
||||
RUN yolo export model=tmp/yolov8n.pt format=ncnn imgsz=32
|
||||
# Requires <= Python 3.10, bug with paddlepaddle==2.5.0 https://github.com/PaddlePaddle/X2Paddle/issues/991
|
||||
RUN pip install --no-cache paddlepaddle==2.4.2 x2paddle
|
||||
# Remove exported models
|
||||
RUN rm -rf tmp
|
||||
|
||||
|
||||
# Usage Examples -------------------------------------------------------------------------------------------------------
|
||||
|
||||
# Build and Push
|
||||
# t=ultralytics/ultralytics:latest-python && sudo docker build -f docker/Dockerfile-python -t $t . && sudo docker push $t
|
||||
|
||||
# Run
|
||||
# t=ultralytics/ultralytics:latest-python && sudo docker run -it --ipc=host $t
|
||||
|
||||
# Pull and Run
|
||||
# t=ultralytics/ultralytics:latest-python && sudo docker pull $t && sudo docker run -it --ipc=host $t
|
||||
|
||||
# Pull and Run with local volume mounted
|
||||
# t=ultralytics/ultralytics:latest-python && sudo docker pull $t && sudo docker run -it --ipc=host -v "$(pwd)"/datasets:/usr/src/datasets $t
|
2
ultralytics/docker/Dockerfile-python:Zone.Identifier
Executable file
2
ultralytics/docker/Dockerfile-python:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
38
ultralytics/docker/Dockerfile-runner
Executable file
38
ultralytics/docker/Dockerfile-runner
Executable file
@ -0,0 +1,38 @@
|
||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
# Builds GitHub actions CI runner image for deployment to DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
||||
# Image is CUDA-optimized for YOLOv8 single/multi-GPU training and inference tests
|
||||
|
||||
# Start FROM Ultralytics GPU image
|
||||
FROM ultralytics/ultralytics:latest
|
||||
|
||||
# Set the working directory
|
||||
WORKDIR /actions-runner
|
||||
|
||||
# Download and unpack the latest runner from https://github.com/actions/runner
|
||||
RUN FILENAME=actions-runner-linux-x64-2.309.0.tar.gz && \
|
||||
curl -o $FILENAME -L https://github.com/actions/runner/releases/download/v2.309.0/$FILENAME && \
|
||||
tar xzf $FILENAME && \
|
||||
rm $FILENAME
|
||||
|
||||
# Install runner dependencies
|
||||
ENV RUNNER_ALLOW_RUNASROOT=1
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
RUN ./bin/installdependencies.sh && \
|
||||
apt-get -y install libicu-dev
|
||||
|
||||
# Inline ENTRYPOINT command to configure and start runner with default TOKEN and NAME
|
||||
ENTRYPOINT sh -c './config.sh --url https://github.com/ultralytics/ultralytics \
|
||||
--token ${GITHUB_RUNNER_TOKEN:-TOKEN} \
|
||||
--name ${GITHUB_RUNNER_NAME:-NAME} \
|
||||
--labels gpu-latest \
|
||||
--replace && \
|
||||
./run.sh'
|
||||
|
||||
|
||||
# Usage Examples -------------------------------------------------------------------------------------------------------
|
||||
|
||||
# Build and Push
|
||||
# t=ultralytics/ultralytics:latest-runner && sudo docker build -f docker/Dockerfile-runner -t $t . && sudo docker push $t
|
||||
|
||||
# Pull and Run in detached mode with access to GPUs 0 and 1
|
||||
# t=ultralytics/ultralytics:latest-runner && sudo docker run -d -e GITHUB_RUNNER_TOKEN=TOKEN -e GITHUB_RUNNER_NAME=NAME --ipc=host --gpus '"device=0,1"' $t
|
2
ultralytics/docker/Dockerfile-runner:Zone.Identifier
Executable file
2
ultralytics/docker/Dockerfile-runner:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
2
ultralytics/docker/Dockerfile:Zone.Identifier
Executable file
2
ultralytics/docker/Dockerfile:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
102
ultralytics/docs/README.md
Executable file
102
ultralytics/docs/README.md
Executable file
@ -0,0 +1,102 @@
|
||||
# Ultralytics Docs
|
||||
|
||||
Ultralytics Docs are deployed to [https://docs.ultralytics.com](https://docs.ultralytics.com).
|
||||
|
||||
[](https://github.com/ultralytics/docs/actions/workflows/pages/pages-build-deployment) [](https://github.com/ultralytics/docs/actions/workflows/links.yml)
|
||||
|
||||
## Install Ultralytics package
|
||||
|
||||
[](https://badge.fury.io/py/ultralytics) [](https://pepy.tech/project/ultralytics)
|
||||
|
||||
To install the ultralytics package in developer mode, you will need to have Git and Python 3 installed on your system. Then, follow these steps:
|
||||
|
||||
1. Clone the ultralytics repository to your local machine using Git:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/ultralytics/ultralytics.git
|
||||
```
|
||||
|
||||
2. Navigate to the root directory of the repository:
|
||||
|
||||
```bash
|
||||
cd ultralytics
|
||||
```
|
||||
|
||||
3. Install the package in developer mode using pip:
|
||||
|
||||
```bash
|
||||
pip install -e '.[dev]'
|
||||
```
|
||||
|
||||
This will install the ultralytics package and its dependencies in developer mode, allowing you to make changes to the package code and have them reflected immediately in your Python environment.
|
||||
|
||||
Note that you may need to use the pip3 command instead of pip if you have multiple versions of Python installed on your system.
|
||||
|
||||
## Building and Serving Locally
|
||||
|
||||
The `mkdocs serve` command is used to build and serve a local version of the MkDocs documentation site. It is typically used during the development and testing phase of a documentation project.
|
||||
|
||||
```bash
|
||||
mkdocs serve
|
||||
```
|
||||
|
||||
Here is a breakdown of what this command does:
|
||||
|
||||
- `mkdocs`: This is the command-line interface (CLI) for the MkDocs static site generator. It is used to build and serve MkDocs sites.
|
||||
- `serve`: This is a subcommand of the `mkdocs` CLI that tells it to build and serve the documentation site locally.
|
||||
- `-a`: This flag specifies the hostname and port number to bind the server to. The default value is `localhost:8000`.
|
||||
- `-t`: This flag specifies the theme to use for the documentation site. The default value is `mkdocs`.
|
||||
- `-s`: This flag tells the `serve` command to serve the site in silent mode, which means it will not display any log messages or progress updates. When you run the `mkdocs serve` command, it will build the documentation site using the files in the `docs/` directory and serve it at the specified hostname and port number. You can then view the site by going to the URL in your web browser.
|
||||
|
||||
While the site is being served, you can make changes to the documentation files and see them reflected in the live site immediately. This is useful for testing and debugging your documentation before deploying it to a live server.
|
||||
|
||||
To stop the serve command and terminate the local server, you can use the `CTRL+C` keyboard shortcut.
|
||||
|
||||
## Building and Serving Multi-Language
|
||||
|
||||
For multi-language MkDocs sites use the following additional steps:
|
||||
|
||||
1. Add all new language *.md files to git commit: `git add docs/**/*.md -f`
|
||||
2. Build all languages to the `/site` directory. Verify that the top-level `/site` directory contains `CNAME`, `robots.txt` and `sitemap.xml` files, if applicable.
|
||||
|
||||
```bash
|
||||
# Remove existing /site directory
|
||||
rm -rf site
|
||||
|
||||
# Loop through all *.yml files in the docs directory
|
||||
mkdocs build -f docs/mkdocs.yml
|
||||
for file in docs/mkdocs_*.yml; do
|
||||
echo "Building MkDocs site with configuration file: $file"
|
||||
mkdocs build -f "$file"
|
||||
done
|
||||
```
|
||||
|
||||
3. Preview in web browser with:
|
||||
|
||||
```bash
|
||||
cd site
|
||||
python -m http.server
|
||||
open http://localhost:8000 # on macOS
|
||||
```
|
||||
|
||||
Note the above steps are combined into the Ultralytics [build_docs.py](https://github.com/ultralytics/ultralytics/blob/main/docs/build_docs.py) script.
|
||||
|
||||
## Deploying Your Documentation Site
|
||||
|
||||
To deploy your MkDocs documentation site, you will need to choose a hosting provider and a deployment method. Some popular options include GitHub Pages, GitLab Pages, and Amazon S3.
|
||||
|
||||
Before you can deploy your site, you will need to configure your `mkdocs.yml` file to specify the remote host and any other necessary deployment settings.
|
||||
|
||||
Once you have configured your `mkdocs.yml` file, you can use the `mkdocs deploy` command to build and deploy your site. This command will build the documentation site using the files in the `docs/` directory and the specified configuration file and theme, and then deploy the site to the specified remote host.
|
||||
|
||||
For example, to deploy your site to GitHub Pages using the gh-deploy plugin, you can use the following command:
|
||||
|
||||
```bash
|
||||
mkdocs gh-deploy
|
||||
```
|
||||
|
||||
If you are using GitHub Pages, you can set a custom domain for your documentation site by going to the "Settings" page for your repository and updating the "Custom domain" field in the "GitHub Pages" section.
|
||||
|
||||

|
||||
|
||||
For more information on deploying your MkDocs documentation site, see the [MkDocs documentation](https://www.mkdocs.org/user-guide/deploying-your-docs/).
|
2
ultralytics/docs/README.md:Zone.Identifier
Executable file
2
ultralytics/docs/README.md:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
83
ultralytics/docs/ar/index.md
Executable file
83
ultralytics/docs/ar/index.md
Executable file
@ -0,0 +1,83 @@
|
||||
---
|
||||
comments: true
|
||||
description: استكشف دليل كامل لـ Ultralytics YOLOv8 ، نموذج كشف الكائنات وتجزئة الصور ذو السرعة العالية والدقة العالية. تثبيت المحررة ، والتنبؤ ، والتدريب والمزيد.
|
||||
keywords: Ultralytics، YOLOv8، كشف الكائنات، تجزئة الصور، التعلم الآلي، التعلم العميق، الرؤية الحاسوبية، YOLOv8 installation، YOLOv8 prediction، YOLOv8 training، تاريخ YOLO، تراخيص YOLO
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<p>
|
||||
<a href="https://yolovision.ultralytics.com" target="_blank">
|
||||
<img width="1024" src="https://raw.githubusercontent.com/ultralytics/assets/main/yolov8/banner-yolov8.png" alt="Ultralytics YOLO banner"></a>
|
||||
</p>
|
||||
<a href="https://github.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-github.png" width="3%" alt="Ultralytics GitHub"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
||||
<a href="https://www.linkedin.com/company/ultralytics/"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-linkedin.png" width="3%" alt="Ultralytics LinkedIn"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
||||
<a href="https://twitter.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-twitter.png" width="3%" alt="Ultralytics Twitter"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
||||
<a href="https://youtube.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-youtube.png" width="3%" alt="Ultralytics YouTube"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
||||
<a href="https://www.tiktok.com/@ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-tiktok.png" width="3%" alt="Ultralytics TikTok"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
||||
<a href="https://www.instagram.com/ultralytics/"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-instagram.png" width="3%" alt="Ultralytics Instagram"></a>
|
||||
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
||||
<a href="https://ultralytics.com/discord"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-discord.png" width="3%" alt="Ultralytics Discord"></a>
|
||||
<br>
|
||||
<br>
|
||||
<a href="https://github.com/ultralytics/ultralytics/actions/workflows/ci.yaml"><img src="https://github.com/ultralytics/ultralytics/actions/workflows/ci.yaml/badge.svg" alt="Ultralytics CI"></a>
|
||||
<a href="https://codecov.io/github/ultralytics/ultralytics"><img src="https://codecov.io/github/ultralytics/ultralytics/branch/main/graph/badge.svg?token=HHW7IIVFVY" alt="Ultralytics Code Coverage"></a>
|
||||
<a href="https://zenodo.org/badge/latestdoi/264818686"><img src="https://zenodo.org/badge/264818686.svg" alt="YOLOv8 Citation"></a>
|
||||
<a href="https://hub.docker.com/r/ultralytics/ultralytics"><img src="https://img.shields.io/docker/pulls/ultralytics/ultralytics?logo=docker" alt="Docker Pulls"></a>
|
||||
<a href="https://ultralytics.com/discord"><img alt="Discord" src="https://img.shields.io/discord/1089800235347353640?logo=discord&logoColor=white&label=Discord&color=blue"></a>
|
||||
<br>
|
||||
<a href="https://console.paperspace.com/github/ultralytics/ultralytics"><img src="https://assets.paperspace.io/img/gradient-badge.svg" alt="Run on Gradient"></a>
|
||||
<a href="https://colab.research.google.com/github/ultralytics/ultralytics/blob/main/examples/tutorial.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a>
|
||||
<a href="https://www.kaggle.com/ultralytics/yolov8"><img src="https://kaggle.com/static/images/open-in-kaggle.svg" alt="Open In Kaggle"></a>
|
||||
</div>
|
||||
|
||||
يتم تقديم [Ultralytics](https://ultralytics.com) [YOLOv8](https://github.com/ultralytics/ultralytics) ، أحدث إصدار من نموذج كشف الكائنات وتجزئة الصور المشهورة للوقت الفعلي. يعتمد YOLOv8 على التطورات المتقدمة في التعلم العميق والرؤية الحاسوبية ، ويقدم أداءً فائقًا من حيث السرعة والدقة. يجعل التصميم البسيط له مناسبًا لمختلف التطبيقات وقابلًا للتكيف بسهولة مع منصات الأجهزة المختلفة ، من الأجهزة الحافة إلى واجهات برمجة التطبيقات في السحابة.
|
||||
|
||||
استكشف أدلة YOLOv8 ، وهي مورد شامل يهدف إلى مساعدتك في فهم واستخدام ميزاته وقدراته. سواء كنت ممارسًا في مجال التعلم الآلي من ذوي الخبرة أو جديدًا في هذا المجال ، فإن الهدف من هذا المركز هو تحقيق الحد الأقصى لإمكانات YOLOv8 في مشاريعك.
|
||||
|
||||
!!! Note "ملاحظة"
|
||||
|
||||
🚧 تم تطوير وثائقنا متعددة اللغات حاليًا ، ونعمل بجد لتحسينها. شكراً لصبرك! 🙏
|
||||
|
||||
## من أين أبدأ
|
||||
|
||||
- **تثبيت** `ultralytics` بواسطة pip والبدء في العمل في دقائق [:material-clock-fast: ابدأ الآن](quickstart.md){ .md-button }
|
||||
- **توقع** الصور ومقاطع الفيديو الجديدة بواسطة YOLOv8 [:octicons-image-16: توقع على الصور](modes/predict.md){ .md-button }
|
||||
- **تدريب** نموذج YOLOv8 الجديد على مجموعة البيانات المخصصة الخاصة بك [:fontawesome-solid-brain: قم بتدريب نموذج](modes/train.md){ .md-button }
|
||||
- **استكشاف** مهام YOLOv8 مثل التجزئة والتصنيف والوضع والتتبع [:material-magnify-expand: استكشاف المهام](tasks/index.md){ .md-button }
|
||||
|
||||
<p align="center">
|
||||
<br>
|
||||
<iframe width="720" height="405" src="https://www.youtube.com/embed/LNwODJXcvt4?si=7n1UvGRLSd9p5wKs"
|
||||
title="مشغل فيديو يوتيوب" frameborder="0"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||
allowfullscreen>
|
||||
</iframe>
|
||||
<br>
|
||||
<strong> مشاهدة: </strong> كيفية تدريب نموذج YOLOv8 على مجموعة بيانات مخصصة في <a href="https://colab.research.google.com/github/ultralytics/ultralytics/blob/main/examples/tutorial.ipynb" target="_blank">جوجل كولاب</a>.
|
||||
</p>
|
||||
|
||||
## YOLO: نبذة تاريخية
|
||||
|
||||
تم تطوير [YOLO](https://arxiv.org/abs/1506.02640) (You Only Look Once) ، نموذج شهير لكشف الكائنات وتجزئة الصور ، من قبل جوزيف ريدمون وعلي فرهادي في جامعة واشنطن. في عام 2015 ، حققت YOLO شهرة سريعة بفضل سرعتها العالية ودقتها.
|
||||
|
||||
- [YOLOv2](https://arxiv.org/abs/1612.08242) ، الذي تم إصداره في عام 2016 ، قام بتحسين النموذج الأصلي من خلال دمج التطبيع التشغيلي ، ومربعات الربط ، ومجموعات الأبعاد.
|
||||
- [YOLOv3](https://pjreddie.com/media/files/papers/YOLOv3.pdf) ، الذي تم إطلاقه في عام 2018 ، قدم تحسينات إضافية لأداء النموذج باستخدام شبكة ظهر أكثر كفاءة ومرشحات متعددة وتجميع هرم المساحة.
|
||||
- تم إصدار [YOLOv4](https://arxiv.org/abs/2004.10934) في عام 2020 ، وقدم ابتكارات مثل زيادة المساعدات في البيانات ، ورأس جديد للكشف غير المرتبط بالمرابط ، ووظيفة فقدان جديدة.
|
||||
- [YOLOv5](https://github.com/ultralytics/yolov5) قام بتحسين أداء النموذج وأضاف ميزات جديدة مثل تحسين ثوابت النموذج ، وتعقب التجارب المتكامل والتصدير التلقائي إلى تنسيقات التصدير الشهيرة.
|
||||
- [YOLOv6](https://github.com/meituan/YOLOv6) تم تَوْزيعه على [Meituan](https://about.meituan.com/) في عام 2022 وهو قيد الاستخدام في العديد من روبوتات التسليم الذاتي للشركة.
|
||||
- [YOLOv7](https://github.com/WongKinYiu/yolov7) أضاف مهمات إضافية مثل تقدير الوضع على مجموعة بيانات نقاط COCO الرئيسية.
|
||||
- [YOLOv8](https://github.com/ultralytics/ultralytics) هو أحدث إصدار من YOLO بواسطة Ultralytics. باعتباره نموذجًا حديثًا وفريدًا من نوعه ، فإن YOLOv8 يبني على نجاح الإصدارات السابقة ، ويقدم ميزات وتحسينات جديدة لتحسين الأداء والمرونة والكفاءة. يدعم YOLOv8 مجموعة كاملة من مهام الذكاء الصناعي للرؤية ، بما في ذلك [الكشف](tasks/detect.md) ، [التجزئة](tasks/segment.md) ، [تقدير الوضع](tasks/pose.md) ، [التتبع](modes/track.md) ، و [التصنيف](tasks/classify.md). تتيح هذه القابلية للتكيف للمستخدمين استغلال قدرات YOLOv8 في تطبيقات ومجالات متنوعة.
|
||||
|
||||
## تراخيص YOLO: كيف يتم ترخيص Ultralytics YOLO؟
|
||||
|
||||
يوفر Ultralytics خيارين للترخيص لاستيعاب الحالات الاستخدام المتنوعة:
|
||||
|
||||
- **ترخيص AGPL-3.0**: هذا الترخيص مفتوح المصدر والمعتمد من [OSI](https://opensource.org/licenses/) وهو مثالي للطلاب والهواة ، ويشجع على التعاون المفتوح ومشاركة المعرفة. راجع ملف [LICENSE](https://github.com/ultralytics/ultralytics/blob/main/LICENSE) لمزيد من التفاصيل.
|
||||
- **ترخيص المؤسسة**: صمم للاستخدام التجاري ، يسمح هذا الترخيص بدمج سلس للبرمجيات ونماذج AI الخاصة بشركة Ultralytics في السلع والخدمات التجارية ، وتفادي متطلبات المصدر المفتوح لـ AGPL-3.0. إذا تشمل سيناريو الخاص بك تضمين حلولنا في عرض تجاري ، فيرجى التواصل من خلال [Ultralytics Licensing](https://ultralytics.com/license).
|
||||
|
||||
تم تصميم استراتيجية الترخيص الخاصة بنا لضمان أن أي تحسينات على مشاريعنا مفتوحة المصدر يتم إرجاعها إلى المجتمع. نحمل مبادئ المصدر المفتوح قريبة من قلوبنا ❤️ ، ومهمتنا هي ضمان أن يمكن استخدام وتوسيع مساهماتنا بطرق تعود بالنفع على الجميع.
|
2
ultralytics/docs/ar/index.md:Zone.Identifier
Executable file
2
ultralytics/docs/ar/index.md:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
191
ultralytics/docs/ar/models/fast-sam.md
Executable file
191
ultralytics/docs/ar/models/fast-sam.md
Executable file
@ -0,0 +1,191 @@
|
||||
---
|
||||
comments: true
|
||||
description: استكشف FastSAM ، وهو حلاً مبنيًا على الشبكات العصبية السريعة لتجزئة الكائنات في الوقت الحقيقي في الصور. تفاعل المستخدم المحسّن ، والكفاءة الحسابية ، والقابلية للتكيف في مهام الرؤية المختلفة.
|
||||
keywords: FastSAM ، التعلم الآلي ، حلاً مبنيًا على الشبكات العصبية السريعة ، قسيمة الكائنات ، حلاً في الوقت الحقيقي ، Ultralytics ، مهام الرؤية ، معالجة الصور ، تطبيقات صناعية ، تفاعل المستخدم
|
||||
---
|
||||
|
||||
# نموذج تجزئة أي شيء بسرعة عالية (FastSAM)
|
||||
|
||||
نموذج تجزئة أي شيء بسرعة عالية (FastSAM) هو حلاً مبتكرًا للعصب الشبكي يعمل بالزمن الحقيقي لمهمة تجزئة أي كائن داخل صورة ما. تم تصميم هذه المهمة لتجزئة أي كائن داخل صورة بناءً على إشارات تفاعل المستخدم المختلفة الممكنة. يقلل الـ FastSAM من الاحتياجات الحسابية بشكل كبير مع الحفاظ على أداء تنافسي ، مما يجعله خيارًا عمليًا لمجموعة متنوعة من مهام الرؤية.
|
||||
|
||||

|
||||
|
||||
## نظرة عامة
|
||||
|
||||
تم تصميم FastSAM للتغلب على القيود الموجودة في [نموذج تجزئة ما شيء (SAM)](sam.md) ، وهو نموذج تحويل ثقيل يتطلب موارد حسابية كبيرة. يفصل FastSAM عملية تجزئة أي شيء إلى مرحلتين متسلسلتين: تجزئة جميع الأمثلة واختيار موجه بناءً على التعليمات. تستخدم المرحلة الأولى [YOLOv8-seg](../tasks/segment.md) لإنتاج قناع التجزئة لجميع الأمثلة في الصورة. في المرحلة الثانية ، يتم إخراج منطقة الاهتمام المتعلقة بالتعليمة.
|
||||
|
||||
## المميزات الرئيسية
|
||||
|
||||
1. **حلاً في الوقت الحقيقي**: من خلال استغلال كفاءة الشبكات العصبية الحاسوبية ، يوفر FastSAM حلاً في الوقت الحقيقي لمهمة تجزئة أي شيء ، مما يجعله قيمًا للتطبيقات الصناعية التي تتطلب نتائج سريعة.
|
||||
|
||||
2. **كفاءة وأداء**: يقدم FastSAM تقليل كبير في الاحتياجات الحسابية واستخدام الموارد دون التنازل عن جودة الأداء. يحقق أداءً قابلاً للمقارنة مع SAM ولكن بموارد حسابية مخفضة بشكل كبير ، مما يمكن من تطبيقه في الوقت الحقيقي.
|
||||
|
||||
3. **تجزئة يستند إلى الموجه**: يمكن لـ FastSAM تجزئة أي كائن داخل صورة ترشده مختلف إشارات تفاعل المستخدم الممكنة ، مما يوفر مرونة وقابلية للتكيف في سيناريوهات مختلفة.
|
||||
|
||||
4. **يستند إلى YOLOv8-seg**: يستند FastSAM إلى [YOLOv8-seg](../tasks/segment.md) ، وهو كاشف كائنات مجهز بفرع تجزئة المثيلات. يمكنه بشكل فعال إنتاج قناع التجزئة لجميع الأمثلة في صورة.
|
||||
|
||||
5. **نتائج تنافسية في الاختبارات التحضيرية**: في مهمة اقتراح الكائن على MS COCO ، يحقق FastSAM درجات عالية بسرعة أسرع بكثير من [SAM](sam.md) على بطاقة NVIDIA RTX 3090 واحدة ، مما يدل على كفاءته وقدرته.
|
||||
|
||||
6. **تطبيقات عملية**: توفر الطريقة المقترحة حلاً جديدًا وعمليًا لعدد كبير من مهام الرؤية بسرعة عالية حقًا ، بمعدلات سرعة عشرات أو مئات المرات أسرع من الطرق الحالية.
|
||||
|
||||
7. **جدوى ضغط النموذج**: يظهر FastSAM إمكانية تقليل الجهد الحسابي بشكل كبير من خلال إدخال سابق اصطناعي للهيكل ، مما يفتح إمكانيات جديدة لهندسة هيكل النموذج الكبير لمهام الرؤية العامة.
|
||||
|
||||
## النماذج المتاحة ، المهام المدعومة ، وأوضاع التشغيل
|
||||
|
||||
يعرض هذا الجدول النماذج المتاحة مع أوزانها المحددة ، والمهام التي تدعمها ، ومدى توافقها مع أوضاع التشغيل المختلفة مثل [الاستنتاج](../modes/predict.md) ، [التحقق](../modes/val.md) ، [التدريب](../modes/train.md) ، و[التصدير](../modes/export.md) ، مشار إليها برموز الـ✅ للأوضاع المدعومة والرموز ❌ للأوضاع غير المدعومة.
|
||||
|
||||
| نوع النموذج | أوزان تم تدريبها مسبقًا | المهام المدعومة | الاستنتاج | التحقق | التدريب | التصدير |
|
||||
|-------------|-------------------------|---------------------------------------|-----------|--------|---------|---------|
|
||||
| FastSAM-s | `FastSAM-s.pt` | [تجزئة المثيلات](../tasks/segment.md) | ✅ | ❌ | ❌ | ✅ |
|
||||
| FastSAM-x | `FastSAM-x.pt` | [تجزئة المثيلات](../tasks/segment.md) | ✅ | ❌ | ❌ | ✅ |
|
||||
|
||||
## أمثلة الاستخدام
|
||||
|
||||
يسهل دمج نماذج FastSAM في تطبيقات Python الخاصة بك. يوفر Ultralytics واجهة برمجة تطبيقات Python سهلة الاستخدام وأوامر CLI لتسهيل التطوير.
|
||||
|
||||
### استخدام التوقعات
|
||||
|
||||
للقيام بكشف الكائنات في صورة ، استخدم طريقة `predict` كما هو موضح أدناه:
|
||||
|
||||
!!! Example "مثال"
|
||||
|
||||
=== "بايثون"
|
||||
```python
|
||||
from ultralytics import FastSAM
|
||||
from ultralytics.models.fastsam import FastSAMPrompt
|
||||
|
||||
# حدد مصدر التوقع
|
||||
source = 'path/to/bus.jpg'
|
||||
|
||||
# قم بإنشاء نموذج FastSAM
|
||||
model = FastSAM('FastSAM-s.pt') # or FastSAM-x.pt
|
||||
|
||||
# تنفيذ توقعات على صورة
|
||||
everything_results = model(source, device='cpu', retina_masks=True, imgsz=1024, conf=0.4, iou=0.9)
|
||||
|
||||
# قم بتجهيز كائن معالج مع قواعد التوقع
|
||||
prompt_process = FastSAMPrompt(source, everything_results, device='cpu')
|
||||
|
||||
# التوقع باستخدام كل شيء
|
||||
ann = prompt_process.everything_prompt()
|
||||
|
||||
# bbox الشكل الافتراضي [0،0،0،0] -> [x1،y1،x2،y2]
|
||||
ann = prompt_process.box_prompt(bbox=[200، 200، 300، 300])
|
||||
|
||||
# التوقع النصي
|
||||
ann = prompt_process.text_prompt(text='صورة لكلب')
|
||||
|
||||
# التوقع النقطي
|
||||
ann = prompt_process.point_prompt(points=[[200، 200]]، pointlabel=[1])
|
||||
prompt_process.plot(annotations=ann، output='./')
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
```bash
|
||||
# قم بتحميل نموذج FastSAM وتجزئة كل شيء به
|
||||
yolo segment predict model=FastSAM-s.pt source=path/to/bus.jpg imgsz=640
|
||||
```
|
||||
|
||||
توضح هذه المقاطع البساطة في تحميل نموذج مدرب مسبقًا وتنفيذ توقع على صورة.
|
||||
|
||||
### استخدام مهام التحقق
|
||||
|
||||
يمكن تنفيذ التحقق من النموذج على مجموعة بيانات على النحو التالي:
|
||||
|
||||
!!! Example "مثال"
|
||||
|
||||
=== "بايثون"
|
||||
```python
|
||||
from ultralytics import FastSAM
|
||||
|
||||
# قم بإنشاء نموذج FastSAM
|
||||
model = FastSAM('FastSAM-s.pt') # or FastSAM-x.pt
|
||||
|
||||
# قم بتنفيذ التحقق من النموذج
|
||||
results = model.val(data='coco8-seg.yaml')
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
```bash
|
||||
# قم بتحميل نموذج FastSAM وأجرِ التحقق منه بخصوص مجموعة البيانات مثال كوكو 8 بحجم صورة 640
|
||||
yolo segment val model=FastSAM-s.pt data=coco8.yaml imgsz=640
|
||||
```
|
||||
|
||||
يرجى ملاحظة أن الـ FastSAM يدعم فقط الكشف والتجزئة لفئة واحدة من الكائن. هذا يعني أنه سيتعرف ويجزء جميع الكائنات على أنها نفس الفئة. لذلك ، عند إعداد مجموعة البيانات ، يجب تحويل جميع معرفات فئة الكائن إلى 0.
|
||||
|
||||
## استخدام FastSAM الرسمي
|
||||
|
||||
يتوفر نموذج FastSAM مباشرةً من مستودع [https://github.com/CASIA-IVA-Lab/FastSAM](https://github.com/CASIA-IVA-Lab/FastSAM). فيما يلي نظرة عامة موجزة على الخطوات التقليدية التي قد تتخذها لاستخدام FastSAM:
|
||||
|
||||
### التثبيت
|
||||
|
||||
1. استنسخ مستودع FastSAM:
|
||||
```shell
|
||||
git clone https://github.com/CASIA-IVA-Lab/FastSAM.git
|
||||
```
|
||||
|
||||
2. أنشئ بيئة Conda وفعّلها بـ Python 3.9:
|
||||
```shell
|
||||
conda create -n FastSAM python=3.9
|
||||
conda activate FastSAM
|
||||
```
|
||||
|
||||
3. انتقل إلى المستودع المنسخ وقم بتثبيت الحزم المطلوبة:
|
||||
```shell
|
||||
cd FastSAM
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
4. قم بتثبيت نموذج CLIP:
|
||||
```shell
|
||||
pip install git+https://github.com/openai/CLIP.git
|
||||
```
|
||||
|
||||
### مثال الاستخدام
|
||||
|
||||
1. قم بتنزيل [تفويض نموذج](https://drive.google.com/file/d/1m1sjY4ihXBU1fZXdQ-Xdj-mDltW-2Rqv/view?usp=sharing).
|
||||
|
||||
2. استخدم FastSAM للتوقع. أمثلة الأوامر:
|
||||
|
||||
- تجزئة كل شيء في صورة:
|
||||
```shell
|
||||
python Inference.py --model_path ./weights/FastSAM.pt --img_path ./images/dogs.jpg
|
||||
```
|
||||
|
||||
- تجزئة كائنات محددة باستخدام تعليمات النص:
|
||||
```shell
|
||||
python Inference.py --model_path ./weights/FastSAM.pt --img_path ./images/dogs.jpg --text_prompt "الكلب الأصفر"
|
||||
```
|
||||
|
||||
- تجزئة كائنات داخل مربع محدد (تقديم إحداثيات الصندوق في تنسيق xywh):
|
||||
```shell
|
||||
python Inference.py --model_path ./weights/FastSAM.pt --img_path ./images/dogs.jpg --box_prompt "[570,200,230,400]"
|
||||
```
|
||||
|
||||
- تجزئة كائنات قرب النقاط المحددة:
|
||||
```shell
|
||||
python Inference.py --model_path ./weights/FastSAM.pt --img_path ./images/dogs.jpg --point_prompt "[[520,360],[620,300]]" --point_label "[1,0]"
|
||||
```
|
||||
|
||||
بالإضافة إلى ذلك ، يمكنك تجربة FastSAM من خلال [Colab demo](https://colab.research.google.com/drive/1oX14f6IneGGw612WgVlAiy91UHwFAvr9?usp=sharing) أو على [HuggingFace web demo](https://huggingface.co/spaces/An-619/FastSAM) لتجربة بصرية.
|
||||
|
||||
## الاقتباسات والشكر
|
||||
|
||||
نود أن نشكر أباء FastSAM على مساهماتهم الهامة في مجال تجزئة المثيلات في الوقت الحقيقي:
|
||||
|
||||
!!! Quote ""
|
||||
|
||||
=== "بيب تيكس"
|
||||
|
||||
```bibtex
|
||||
@misc{zhao2023fast,
|
||||
title={Fast Segment Anything},
|
||||
author={Xu Zhao and Wenchao Ding and Yongqi An and Yinglong Du and Tao Yu and Min Li and Ming Tang and Jinqiao Wang},
|
||||
year={2023},
|
||||
eprint={2306.12156},
|
||||
archivePrefix={arXiv},
|
||||
primaryClass={cs.CV}
|
||||
}
|
||||
```
|
||||
|
||||
يمكن العثور على ورقة FastSAM الأصلية على [arXiv](https://arxiv.org/abs/2306.12156). قام الأباء بجعل أعمالهم متاحة للجمهور ، ويمكن الوصول إلى قاعدة الكود على [GitHub](https://github.com/CASIA-IVA-Lab/FastSAM). نقدر جهودهم في تطوير المجال وجعل أعمالهم متاحة للمجتمع الأوسع.
|
2
ultralytics/docs/ar/models/fast-sam.md:Zone.Identifier
Executable file
2
ultralytics/docs/ar/models/fast-sam.md:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
98
ultralytics/docs/ar/models/index.md
Executable file
98
ultralytics/docs/ar/models/index.md
Executable file
@ -0,0 +1,98 @@
|
||||
---
|
||||
comments: true
|
||||
description: استكشف مجموعة متنوعة من عائلة YOLO، ونماذج SAM وMobileSAM وFastSAM وYOLO-NAS وRT-DETR المدعومة من Ultralytics. ابدأ بأمثلة لكل من استخدام واجهة الأوامر وPython.
|
||||
keywords: Ultralytics, documentation, YOLO, SAM, MobileSAM, FastSAM, YOLO-NAS, RT-DETR, models, architectures, Python, CLI
|
||||
---
|
||||
|
||||
# النماذج المدعومة من Ultralytics
|
||||
|
||||
أهلاً بك في وثائق نماذج Ultralytics! نحن نقدم الدعم لمجموعة واسعة من النماذج، كل منها مُصمم لمهام محددة مثل [الكشف عن الأجسام](../tasks/detect.md)، [تقطيع الحالات](../tasks/segment.md)، [تصنيف الصور](../tasks/classify.md)، [تقدير الوضعيات](../tasks/pose.md)، و[تتبع الأجسام المتعددة](../modes/track.md). إذا كنت مهتمًا بالمساهمة في هندسة نموذجك مع Ultralytics، راجع دليل [المساهمة](../../help/contributing.md).
|
||||
|
||||
!!! Note "ملاحظة"
|
||||
|
||||
🚧 تحت الإنشاء: وثائقنا بلغات متعددة قيد الإنشاء حاليًا، ونحن نعمل بجد لتحسينها. شكرًا لصبرك! 🙏
|
||||
|
||||
## النماذج المميزة
|
||||
|
||||
إليك بعض النماذج الرئيسية المدعومة:
|
||||
|
||||
1. **[YOLOv3](yolov3.md)**: الإصدار الثالث من عائلة نموذج YOLO، الذي أنشأه أصلاً Joseph Redmon، والمعروف بقدراته الفعالة في الكشف عن الأجسام في الوقت الفعلي.
|
||||
2. **[YOLOv4](yolov4.md)**: تحديث محلي لـ YOLOv3، تم إصداره بواسطة Alexey Bochkovskiy في 2020.
|
||||
3. **[YOLOv5](yolov5.md)**: نسخة مُحسنة من هندسة YOLO من قبل Ultralytics، توفر أداءً أفضل وتوازن في السرعة مقارنة بالإصدارات السابقة.
|
||||
4. **[YOLOv6](yolov6.md)**: أُصدرت بواسطة [Meituan](https://about.meituan.com/) في 2022، ويُستخدم في العديد من روبوتات التوصيل الذاتية للشركة.
|
||||
5. **[YOLOv7](yolov7.md)**: تم إصدار نماذج YOLO المحدثة في 2022 بواسطة مؤلفي YOLOv4.
|
||||
6. **[YOLOv8](yolov8.md) جديد 🚀**: الإصدار الأحدث من عائلة YOLO، يتميز بقدرات مُعززة مثل تقطيع الحالات، تقدير الوضعيات/النقاط الرئيسية، والتصنيف.
|
||||
7. **[Segment Anything Model (SAM)](sam.md)**: نموذج Segment Anything Model (SAM) من Meta.
|
||||
8. **[Mobile Segment Anything Model (MobileSAM)](mobile-sam.md)**: نموذج MobileSAM للتطبيقات المحمولة، من جامعة Kyung Hee.
|
||||
9. **[Fast Segment Anything Model (FastSAM)](fast-sam.md)**: نموذج FastSAM من مجموعة تحليل الصور والفيديو، والمعهد الصيني للأتمتة، وأكاديمية العلوم الصينية.
|
||||
10. **[YOLO-NAS](yolo-nas.md)**: نماذج YOLO Neural Architecture Search (NAS).
|
||||
11. **[Realtime Detection Transformers (RT-DETR)](rtdetr.md)**: نماذج Realtime Detection Transformer (RT-DETR) من PaddlePaddle التابعة لشركة Baidu.
|
||||
|
||||
<p align="center">
|
||||
<br>
|
||||
<iframe width="720" height="405" src="https://www.youtube.com/embed/MWq1UxqTClU?si=nHAW-lYDzrz68jR0"
|
||||
title="مشغل فيديو YouTube" frameborder="0"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||
allowfullscreen>
|
||||
</iframe>
|
||||
<br>
|
||||
<strong>شاهد:</strong> تشغيل نماذج YOLO من Ultralytics في بضعة أسطر من الكود فقط.
|
||||
</p>
|
||||
|
||||
## البدء في الاستخدام: أمثلة على الاستخدام
|
||||
|
||||
يوفر هذا المثال أمثلة مبسطة على التدريب والاستدلال باستخدام YOLO. للحصول على الوثائق الكاملة عن هذه وغيرها من [الأوضاع](../modes/index.md), انظر صفحات وثائق [التنبؤ](../modes/predict.md)، و[التدريب](../modes/train.md)، و[التقييم](../modes/val.md) و[التصدير](../modes/export.md).
|
||||
|
||||
لاحظ أن المثال أدناه هو لنماذج [Detect](../tasks/detect.md) YOLOv8 لكشف الأجسام. للاطلاع على المهام الإضافية المدعومة، راجع وثائق [Segment](../tasks/segment.md)، و[Classify](../tasks/classify.md) و[Pose](../tasks/pose.md).
|
||||
|
||||
!!! Example "مثال"
|
||||
|
||||
=== "Python"
|
||||
|
||||
نماذج `*.pt` المُدربة مسبقًا وملفات الإعداد `*.yaml` يمكن أن تُمرر إلى فئات `YOLO()`, `SAM()`, `NAS()` و `RTDETR()` لإنشاء مثال نموذج في Python:
|
||||
|
||||
```python
|
||||
من ultralytics استيراد YOLO
|
||||
|
||||
# تحميل نموذج YOLOv8n المُدرب مسبقًا على COCO
|
||||
النموذج = YOLO('yolov8n.pt')
|
||||
|
||||
# عرض معلومات النموذج (اختياري)
|
||||
model.info()
|
||||
|
||||
# تدريب النموذج على مجموعة البيانات المثالية COCO8 لمدة 100 عصر
|
||||
النتائج = model.train(data='coco8.yaml', epochs=100, imgsz=640)
|
||||
|
||||
# تشغيل الاستدلال بنموذج YOLOv8n على صورة 'bus.jpg'
|
||||
النتائج = model('path/to/bus.jpg')
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
|
||||
الأوامر CLI متاحة لتشغيل النماذج مباشرة:
|
||||
|
||||
```bash
|
||||
# تحميل نموذج YOLOv8n المُدرب مسبقًا على COCO وتدريبه على مجموعة البيانات المثالية COCO8 لمدة 100 عصر
|
||||
yolo train model=yolov8n.pt data=coco8.yaml epochs=100 imgsz=640
|
||||
|
||||
# تحميل نموذج YOLOv8n المُدرب مسبقًا على COCO وتشغيل الاستدلال على صورة 'bus.jpg'
|
||||
yolo predict model=yolov8n.pt source=path/to/bus.jpg
|
||||
```
|
||||
|
||||
## المساهمة بنماذج جديدة
|
||||
|
||||
هل أنت مهتم بالمساهمة بنموذجك في Ultralytics؟ رائع! نحن دائمًا منفتحون على توسيع محفظة النماذج لدينا.
|
||||
|
||||
1. **احفظ نسخة عن المستودع**: ابدأ بحفظ نسخة عن [مستودع Ultralytics على GitHub](https://github.com/ultralytics/ultralytics).
|
||||
|
||||
2. **استنسخ نسختك**: انسخ نسختك إلى جهازك المحلي وأنشئ فرعًا جديدًا للعمل عليه.
|
||||
|
||||
3. **طبق نموذجك**: أضف نموذجك متبعًا معايير وإرشادات البرمجة الموفرة في دليل [المساهمة](../../help/contributing.md) لدينا.
|
||||
|
||||
4. **اختبر بدقة**: تأكد من اختبار نموذجك بشكل مكثف، سواء بشكل منفصل أو كجزء من المسار البرمجي.
|
||||
|
||||
5. **أنشئ Pull Request**: بمجرد أن تكون راضًيا عن نموذجك، قم بإنشاء طلب سحب إلى المستودع الرئيسي للمراجعة.
|
||||
|
||||
6. **مراجعة الكود والدمج**: بعد المراجعة، إذا كان نموذجك يلبي معاييرنا، سيتم دمجه في المستودع الرئيسي.
|
||||
|
||||
للخطوات التفصيلية، يرجى الرجوع إلى دليل [المساهمة](../../help/contributing.md).
|
2
ultralytics/docs/ar/models/index.md:Zone.Identifier
Executable file
2
ultralytics/docs/ar/models/index.md:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
116
ultralytics/docs/ar/models/mobile-sam.md
Executable file
116
ultralytics/docs/ar/models/mobile-sam.md
Executable file
@ -0,0 +1,116 @@
|
||||
---
|
||||
comments: true
|
||||
description: تعرّف على MobileSAM وتطبيقه، وقارنه مع SAM الأصلي، وكيفية تنزيله واختباره في إطار Ultralytics. قم بتحسين تطبيقاتك المحمولة اليوم.
|
||||
keywords: MobileSAM، Ultralytics، SAM، التطبيقات المحمولة، Arxiv، GPU، API، مُشفّر الصورة، فك تشفير القناع، تنزيل النموذج، طريقة الاختبار
|
||||
---
|
||||
|
||||

|
||||
|
||||
# التمييز المحمول لأي شيء (MobileSAM)
|
||||
|
||||
الآن يمكنك الاطّلاع على ورقة MobileSAM في [arXiv](https://arxiv.org/pdf/2306.14289.pdf).
|
||||
|
||||
يمكن الوصول إلى عرض مباشر لـ MobileSAM يعمل على وحدة المعالجة المركزية CPU من [هنا](https://huggingface.co/spaces/dhkim2810/MobileSAM). يستغرق الأداء على وحدة المعالجة المركزية Mac i5 تقريبًا 3 ثوانٍ. في عرض الواجهة التفاعلية الخاص بهنغ فيس، تؤدي واجهة المستخدم ووحدات المعالجة المركزية ذات الأداء المنخفض إلى استجابة أبطأ، لكنها تواصل العمل بفعالية.
|
||||
|
||||
تم تنفيذ MobileSAM في عدة مشاريع بما في ذلك [Grounding-SAM](https://github.com/IDEA-Research/Grounded-Segment-Anything) و [AnyLabeling](https://github.com/vietanhdev/anylabeling) و [Segment Anything in 3D](https://github.com/Jumpat/SegmentAnythingin3D).
|
||||
|
||||
تم تدريب MobileSAM على وحدة المعالجة الرسومية (GPU) الواحدة باستخدام مجموعة بيانات تحتوي على 100000 صورة (1% من الصور الأصلية) في أقل من يوم واحد. سيتم توفير الشفرة المصدرية لعملية التدريب هذه في المستقبل.
|
||||
|
||||
## النماذج المتاحة، المهام المدعومة، وأوضاع التشغيل
|
||||
|
||||
يُعرض في هذا الجدول النماذج المتاحة مع وزنها المدرب مسبقًا، والمهام التي تدعمها، وتوافقها مع أوضاع التشغيل المختلفة مثل [الاستدلال](../modes/predict.md)، [التحقق](../modes/val.md)، [التدريب](../modes/train.md)، و [التصدير](../modes/export.md)، حيث يُشير إيموجي ✅ للأوضاع المدعومة وإيموجي ❌ للأوضاع غير المدعومة.
|
||||
|
||||
| نوع النموذج | الأوزان المدربة مسبقًا | المهام المدعومة | الاستدلال | التحقق | التدريب | التصدير |
|
||||
|-------------|------------------------|--------------------------------------|-----------|--------|---------|---------|
|
||||
| MobileSAM | `mobile_sam.pt` | [تجزئة العناصر](../tasks/segment.md) | ✅ | ❌ | ❌ | ✅ |
|
||||
|
||||
## التحويل من SAM إلى MobileSAM
|
||||
|
||||
نظرًا لأن MobileSAM يحتفظ بنفس سير العمل لـ SAM الأصلي، قمنا بدمج التجهيزات المسبقة والتجهيزات اللاحقة للنموذج الأصلي وجميع الواجهات الأخرى. نتيجة لذلك، يمكن لأولئك الذين يستخدمون حاليًا SAM الأصلي الانتقال إلى MobileSAM بقدر أدنى من الجهد.
|
||||
|
||||
يؤدي MobileSAM بشكل مقارب لـ SAM الأصلي ويحتفظ بنفس سير العمل باستثناء تغيير في مُشفر الصورة. على وحدة المعالجة الرسومية (GPU) الواحدة، يعمل MobileSAM بمعدل 12 مللي ثانية لكل صورة: 8 مللي ثانية لمُشفر الصورة و4 مللي ثانية لفك تشفير القناع.
|
||||
|
||||
يوفر الجدول التالي مقارنة بين مُشفرات الصور القائمة على ViT:
|
||||
|
||||
| مُشفّر الصورة | SAM الأصلي | MobileSAM |
|
||||
|---------------|----------------|--------------|
|
||||
| العوامل | 611 مليون | 5 مليون |
|
||||
| السرعة | 452 مللي ثانية | 8 مللي ثانية |
|
||||
|
||||
يستخدم SَM الأصلي و MobileSAM نفس فك تشفير القناع الذي يعتمد على التوجيه بواسطة الرموز:
|
||||
|
||||
| فك تشفير القناع | SAM الأصلي | MobileSAM |
|
||||
|-----------------|--------------|--------------|
|
||||
| العوامل | 3.876 مليون | 3.876 مليون |
|
||||
| السرعة | 4 مللي ثانية | 4 مللي ثانية |
|
||||
|
||||
فيما يلي مقارنة لكامل سير العمل:
|
||||
|
||||
| السير الكامل (التشفير+الفك) | SAM الأصلي | MobileSAM |
|
||||
|-----------------------------|----------------|---------------|
|
||||
| العوامل | 615 مليون | 9.66 مليون |
|
||||
| السرعة | 456 مللي ثانية | 12 مللي ثانية |
|
||||
|
||||
يتم عرض أداء MobileSAM و SAM الأصلي باستخدام كل من النقطة ومربع كلمة المحفز.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
بفضل أدائه المتفوق، يكون MobileSAM أصغر بحوالي 5 أضعاف وأسرع بحوالي 7 أضعاف من FastSAM الحالي. يتوفر مزيد من التفاصيل على [صفحة مشروع MobileSAM](https://github.com/ChaoningZhang/MobileSAM).
|
||||
|
||||
## اختبار MobileSAM في Ultralytics
|
||||
|
||||
مثل SAM الأصلي، نقدم طريقة اختبار مبسّطة في Ultralytics، بما في ذلك وضعي النقطة والصندوق.
|
||||
|
||||
### تنزيل النموذج
|
||||
|
||||
يمكنك تنزيل النموذج [هنا](https://github.com/ChaoningZhang/MobileSAM/blob/master/weights/mobile_sam.pt).
|
||||
|
||||
### النقطة ككلمة محفز
|
||||
|
||||
!!! Example "مثال"
|
||||
|
||||
=== "Python"
|
||||
```python
|
||||
from ultralytics import SAM
|
||||
|
||||
# تحميل النموذج
|
||||
model = SAM('mobile_sam.pt')
|
||||
|
||||
# توقع جزء بناءً على نقطة محفز
|
||||
model.predict('ultralytics/assets/zidane.jpg', points=[900, 370], labels=[1])
|
||||
```
|
||||
|
||||
### الصندوق ككلمة محفز
|
||||
|
||||
!!! Example "مثال"
|
||||
|
||||
=== "Python"
|
||||
```python
|
||||
from ultralytics import SAM
|
||||
|
||||
# تحميل النموذج
|
||||
model = SAM('mobile_sam.pt')
|
||||
|
||||
# توقع جزء بناءً على صندوق محفز
|
||||
model.predict('ultralytics/assets/zidane.jpg', bboxes=[439, 437, 524, 709])
|
||||
```
|
||||
|
||||
لقد قمنا بتنفيذ "MobileSAM" و "SAM" باستخدام نفس API. لمزيد من معلومات الاستخدام، يُرجى الاطّلاع على [صفحة SAM](sam.md).
|
||||
|
||||
## الاقتباس والشكر
|
||||
|
||||
إذا وجدت MobileSAM مفيدًا في أبحاثك أو عملك التطويري، يُرجى النظر في استشهاد ورقتنا:
|
||||
|
||||
!!! Quote ""
|
||||
|
||||
=== "BibTeX"
|
||||
|
||||
```bibtex
|
||||
@article{mobile_sam,
|
||||
title={Faster Segment Anything: Towards Lightweight SAM for Mobile Applications},
|
||||
author={Zhang, Chaoning and Han, Dongshen and Qiao, Yu and Kim, Jung Uk and Bae, Sung Ho and Lee, Seungkyu and Hong, Choong Seon},
|
||||
journal={arXiv preprint arXiv:2306.14289},
|
||||
year={2023}
|
||||
}
|
2
ultralytics/docs/ar/models/mobile-sam.md:Zone.Identifier
Executable file
2
ultralytics/docs/ar/models/mobile-sam.md:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
93
ultralytics/docs/ar/models/rtdetr.md
Executable file
93
ultralytics/docs/ar/models/rtdetr.md
Executable file
@ -0,0 +1,93 @@
|
||||
---
|
||||
comments: true
|
||||
description: اكتشف ميزات وفوائد RT-DETR من Baidu، وهو كاشف كائنات فعال وقابل للتكيف في الوقت الفعلي يعتمد على Vision Transformers، بما في ذلك النماذج المدربة مسبقًا.
|
||||
keywords: RT-DETR, Baidu, Vision Transformers, كشف كائنات, أداء فوري, CUDA, TensorRT, اختيار الاستعلام المرتبط بـ IoU, Ultralytics, واجهة برمجة التطبيقات الخاصة بلغة Python, PaddlePaddle
|
||||
---
|
||||
|
||||
# RT-DETR من Baidu: اكتشاف كائنات في الوقت الفعلي يعتمد على Vision Transformer
|
||||
|
||||
## النظرة العامة
|
||||
|
||||
Real-Time Detection Transformer (RT-DETR)، المطور من قبل Baidu، هو كاشف حديث الطراز يوفر أداءً فعليًا في الوقت الفعلي مع الحفاظ على دقة عالية. يستفيد من قوة Vision Transformers (ViT) في معالجة الميزات متعددة المقياس عن طريق فصل التفاعلات داخل المقياس ودمج التفاعلات بين المقاييس المختلفة. يتكيف RT-DETR بشكل كبير ويدعم ضبط سرعة الاستعلام باستخدام طبقات مختلفة في المفكرة بدون إعادة التدريب. يتفوق هذا النموذج على العديد من كاشفات الكائنات في الوقت الفعلي الأخرى، ويستفيد من المنصات القوية مثل CUDA مع TensorRT.
|
||||
|
||||

|
||||
**نظرة عامة على RT-DETR من Baidu.** يعرض مخطط معمارية نموذج RT-DETR مراحل الظهر الثلاث الأخيرة {S3، S4، S5} كإدخال للمشفر. يحول المشفر الهجين الفعال الميزات متعددة المقياس إلى تسلسل من ميزات الصورة من خلال تفاعل الميزات داخل المقياس (AIFI) ووحدة دمج الميزات بين المقاييس المختلفة (CCFM). يتم استخدام اختيار الاستعلام المرتبط بـ IoU لاختيار عدد ثابت من ميزات الصورة لتكون استعلامات الكائن الأولية لفك الترميز. أخيرًا، يحسن فك الترميز مع رؤوس التنبؤ الإضافية الاستعلامات الكائنية لتوليد المربعات وتقييمات الثقة ([المصدر](https://arxiv.org/pdf/2304.08069.pdf)).
|
||||
|
||||
### الميزات الرئيسية
|
||||
|
||||
- **مشفر هجين فعال:** يستخدم RT-DETR من Baidu مشفر هجين فعال يعمل على معالجة الميزات متعددة المقياس من خلال فصل التفاعلات داخل المقياس ودمج التفاعلات بين المقاييس المختلفة. يقلل هذا التصميم الفريد القائم على Vision Transformers من تكاليف الحسابات ويتيح الكشف عن الكائنات في الوقت الفعلي.
|
||||
- **اختيار الاستعلام المرتبط بـ IoU:** يعمل RT-DETR من Baidu على تحسين بدء استعلام الكائنات من خلال استخدام اختيار الاستعلام المرتبط بـ IoU. يتيح هذا للنموذج التركيز على الكائنات الأكثر صلة في السيناريو، مما يعزز دقة الكشف.
|
||||
- **سرعة الاستنتاج قابلة للتكيف:** يدعم RT-DETR من Baidu ضبط سرعة الاستنتاج بشكل مرن باستخدام طبقات مختلفة في المفكرة دون الحاجة لإعادة التدريب. يسهل هذا التكيف التطبيق العملي في العديد من سيناريوهات كشف الكائنات في الوقت الفعلي.
|
||||
|
||||
## النماذج المدربة مسبقًا
|
||||
|
||||
تقدم واجهة برمجة التطبيقات الخاصة بلغة Python في Ultralytics نماذج PaddlePaddle RT-DETR مدربة مسبقًا بمقاييس مختلفة:
|
||||
|
||||
- RT-DETR-L: 53.0% AP على COCO val2017، 114 FPS على GPU T4
|
||||
- RT-DETR-X: 54.8% AP على COCO val2017، 74 FPS على GPU T4
|
||||
|
||||
## أمثلة الاستخدام
|
||||
|
||||
يوفر هذا المثال أمثلة بسيطة لتدريب واختبار RT-DETRR. للحصول على وثائق كاملة حول هذه الأمثلة وأوضاع أخرى [انقر هنا](../modes/index.md) للاطلاع على صفحات الوثائق [التنبؤ](../modes/predict.md)، [التدريب](../modes/train.md)، [التصحيح](../modes/val.md) و [التصدير](../modes/export.md).
|
||||
|
||||
!!! Example "مثال"
|
||||
|
||||
=== "Python"
|
||||
|
||||
```python
|
||||
from ultralytics import RTDETR
|
||||
|
||||
# تحميل نموذج RT-DETR-l محمي بواسطة COCO مسبقًا
|
||||
model = RTDETR('rtdetr-l.pt')
|
||||
|
||||
# عرض معلومات النموذج (اختياري)
|
||||
model.info()
|
||||
|
||||
# تدريب النموذج على مجموعة بيانات المثال COCO8 لـ 100 دورة
|
||||
results = model.train(data='coco8.yaml', epochs=100, imgsz=640)
|
||||
|
||||
# تشغيل الاستدلال باستخدام النموذج RT-DETR-l على صورة 'bus.jpg'
|
||||
results = model('path/to/bus.jpg')
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
|
||||
```bash
|
||||
# تحميل نموذج RT-DETR-l محمي بواسطة COCO مسبقًا وتدريبه على مجموعة بيانات المثال COCO8 لـ 100 دورة
|
||||
yolo train model=rtdetr-l.pt data=coco8.yaml epochs=100 imgsz=640
|
||||
|
||||
# تحميل نموذج RT-DETR-l محمي بواسطة COCO مسبقًا وتشغيل الاستدلال على صورة 'bus.jpg'
|
||||
yolo predict model=rtdetr-l.pt source=path/to/bus.jpg
|
||||
```
|
||||
|
||||
## المهام والأوضاع المدعومة
|
||||
|
||||
يقدم هذا الجدول أنواع النماذج والأوزان المدربة مسبقًا المحددة والمهام المدعومة بواسطة كل نموذج، والأوضاع المختلفة ([التدريب](../modes/train.md)، [التصحيح](../modes/val.md)، [التنبؤ](../modes/predict.md)، [التصدير](../modes/export.md)) التي يتم دعمها، ممثلة برموز الـ ✅.
|
||||
|
||||
| نوع النموذج | الأوزان المدربة مسبقًا | المهام المدعومة | استنتاج | تحقق صحة | تدريب | استيراد |
|
||||
|-----------------------|------------------------|----------------------------------|---------|----------|-------|---------|
|
||||
| RT-DETR الكبير | `rtdetr-l.pt` | [كشف كائنات](../tasks/detect.md) | ✅ | ✅ | ✅ | ✅ |
|
||||
| RT-DETR الكبير الزائد | `rtdetr-x.pt` | [كشف كائنات](../tasks/detect.md) | ✅ | ✅ | ✅ | ✅ |
|
||||
|
||||
## الاستشهادات والتقديرات
|
||||
|
||||
إذا استخدمت RT-DETR من Baidu في أعمال البحث أو التطوير الخاصة بك، يرجى الاستشهاد بـ [الورقة الأصلية](https://arxiv.org/abs/2304.08069):
|
||||
|
||||
!!! Quote ""
|
||||
|
||||
=== "BibTeX"
|
||||
|
||||
```bibtex
|
||||
@misc{lv2023detrs,
|
||||
title={DETRs Beat YOLOs on Real-time Object Detection},
|
||||
author={Wenyu Lv and Shangliang Xu and Yian Zhao and Guanzhong Wang and Jinman Wei and Cheng Cui and Yuning Du and Qingqing Dang and Yi Liu},
|
||||
year={2023},
|
||||
eprint={2304.08069},
|
||||
archivePrefix={arXiv},
|
||||
primaryClass={cs.CV}
|
||||
}
|
||||
```
|
||||
|
||||
نحن نود أن نعرب عن امتناننا لـ Baidu وفريق [PaddlePaddle](https://github.com/PaddlePaddle/PaddleDetection) لإنشاء وصيانة هذ المورد القيم لمجتمع الرؤية الحاسوبية. نقدر تفاعلهم مع المجال من خلال تطوير كاشف الكائنات الحقيقي في الوقت الفعلي القائم على Vision Transformers، RT-DETR.
|
||||
|
||||
*keywords: RT-DETR، الناقل، Vision Transformers، Baidu RT-DETR، PaddlePaddle، Paddle Paddle RT-DETR، كشف كائنات في الوقت الفعلي، كشف كائنات قائم على Vision Transformers، نماذج PaddlePaddle RT-DETR مدربة مسبقًا، استخدام Baidu's RT-DETR، واجهة برمجة التطبيقات الخاصة بلغة Python في Ultralytics*
|
2
ultralytics/docs/ar/models/rtdetr.md:Zone.Identifier
Executable file
2
ultralytics/docs/ar/models/rtdetr.md:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
225
ultralytics/docs/ar/models/sam.md
Executable file
225
ultralytics/docs/ar/models/sam.md
Executable file
@ -0,0 +1,225 @@
|
||||
---
|
||||
comments: true
|
||||
description: استكشف النموذج القاطع للشيء أيا كان (SAM) الحديث من Ultralytics الذي يتيح الت segment تشفير صور الوقت الحقيقي. تعرف على مرونته في مجال الت segment، وأداء نقل انيفورم زيرو شوت، وكيفية استخدامه.
|
||||
keywords: Ultralytics, قسيمة الصور, Segment Anything Model, SAM, سلسلة بيانات SA-1B, مرونة الصور في الوقت الحقيقي, نقل الانيفورم زيرو شوت, الكشف عن الكائنات, تحليل الصور, التعلم الآلي
|
||||
---
|
||||
|
||||
# نموذج القطعة شيء ما (SAM)
|
||||
|
||||
مرحبًا بك في الجبهة الأولى لقطع الصور مع نموذج القطعة شيء ما ، أو SAM. هذا النموذج الثوري قد غير اللعبة من خلال إدخال التشفير القراءة للصور مع أداء في الوقت الحقيقي، وتحديد معايير جديدة في هذا المجال.
|
||||
|
||||
## مقدمة إلى SAM: القطعة شيء ما نموذج
|
||||
|
||||
نموذج القطعة شيء ما ، أو SAM، هو نموذج شفاف اول في فصل الصور الرقمية التي تتيح قدرة شهير على التشفير، توفر مرونة فريدة من نوعها في مهام التحليل اللازمة للصور. نموذج SAM هو أساس مشروع 'أي شيء في شيء' الابتكاري و هو مشروع يقدم نموذجا جديدا ، مهمة وسلسلة بيانات مبتكرة للفصل البصري.
|
||||
|
||||
يتيح تصميم SAM المتقدم له التكيف مع توزيعات صور جديدة ومهام جديدة دون الحاجة إلى معرفة مسبقة، وهذه الميزة تعرف بالكفاءة المطلوبة. حيث يتم تدريبه على سلسلة البيانات الواسعة [سلسلة SA-1B](https://ai.facebook.com/datasets/segment-anything/)، التي تحتوي على أكثر من ملياري قناع معروض على 11 مليون صورة تمت المحافظة عليها بعناية، وقد عرض SAM أداء مثير للإعجاب مع نقل انيفورم زيرو شوت فاق النتائج المراقبة السابقة بالتدريب الكامل في العديد من الحالات.
|
||||
|
||||

|
||||
صور مثالية مع قناع محاط بها من سلسلة البيانات التي قدمناها حديثًا ، SA-1B. يحتوي سلسلة SA-1B على 11 مليون صورة متنوعة ، عالية الدقة ، مرخصة وتحمي الخصوصية و 1.1 مليار قناع فصل جودة عالية. تم توجيه هذه القناع تمامًا بتقويم آلي من قبل SAM وتم التحقق من جودتها وتنوعها من خلال تصنيفات بشرية وتجارب عديدة. يتم تجميع الصور حسب عدد الأقنعة في كل صورة للتصوير (هناك حوالي 100 قناع في الصورة في المتوسط).
|
||||
|
||||
## السمات الرئيسية لنموذج القطعة شيء ما (SAM)
|
||||
|
||||
- **مهمة التشفير القضائية:** تم تصميم SAM بهدف مهمة التشفير القابلة للتشفير ، مما يتيح له إنشاء قناع تشفير صالح من أي تلميح معين ، مثل الدلائل المكانية أو النصية التي تحدد الكائن.
|
||||
- **بنية متقدمة:** يستخدم نموذج القطعة شيء ما مُشفر صورة قوي ، مشفر تشفير ومُشفر بسهولة الويغورة. تمكن هذه البنية الفريدة من فتح المجال للتشفير المرن ، وحساب القناع في الوقت الحقيقي ، والاستعداد للغموض في مهام التشفير.
|
||||
- **سلسلة البيانات SA-1B:** التي قدمها مشروع أي شيء في شيء، تعرض سلسلة البيانات SA-1B أكثر من ملياري قناع على 11 مليون صورة. كأكبر سلسلة بيانات للفصل حتى الآن، توفر نموذج SAM مصدر تدريب ضخم ومتنوع.
|
||||
- **أداء نقل الانيفورم زيرو شوت:** يعرض نموذج SAM أداء رائع في نقل الانيفورم زيرو شوت في مهام القطع المختلفة، مما يجعله أداة قوية جاهزة للاستخدام في تطبيقات متنوعة مع حاجة قليلة جدًا لهندسة التشفير الخاصة.
|
||||
|
||||
للحصول على نظرة شاملة على نموذج القطعة شيء ما وسلسلة SA-1B، يرجى زيارة [موقع أي شيء في شيء](https://segment-anything.com) واطلع على بحث [أي شيء في شيء](https://arxiv.org/abs/2304.02643).
|
||||
|
||||
## النماذج المتاحة والمهام المدعومة ووضعيات العمل
|
||||
|
||||
تقدم هذه الجدول النماذج المتاحة مع أوزان محددة مسبقًا والمهام التي يدعمونها وتوافقهم مع وضعيات العمل المختلفة مثل [قراءة الصورة](../modes/predict.md)، [التحقق](../modes/val.md)، [التدريب](../modes/train.md)، و [التصدير](../modes/export.md) ، مما يشير إلى ✅ رموز الدعم و ❌ للوضعيات غير المدعومة.
|
||||
|
||||
| نوع النموذج | الأوزان المدربة مسبقًا | المهام المدعومة | قراءة الصورة | التحقق | التدريب | التصدير |
|
||||
|-------------|------------------------|------------------------------------|--------------|--------|---------|---------|
|
||||
| SAM الأساسي | `sam_b.pt` | [تجزئة النسخ](../tasks/segment.md) | ✅ | ❌ | ❌ | ✅ |
|
||||
| SAM الكبير | `sam_l.pt` | [تجزئة النسخ](../tasks/segment.md) | ✅ | ❌ | ❌ | ✅ |
|
||||
|
||||
## كيفية استخدام SAM: مرونة وقوة في تجزئة الصورة
|
||||
|
||||
يمكن استخدام نموذج القطعة شيء من أجل العديد من المهام التابعة إلى تدريبه. يشمل ذلك الكشف عن الحافة، إنشاء ترشيح للكائنات، تجزئة نسخة وتوقع نص مبدئي للتشفير. مع التشفير المهني ، يمكن لـ SAM التكيف بسرعة مع المهمات وتوزيعات البيانات الجديدة بطريقة transfer zero-shot، وبالتالي يعتبر أداة متعددة الاستخدامات وفعالة لجميع احتياجات تجزئة الصورة.
|
||||
|
||||
### مثال لدمج SAM
|
||||
|
||||
!!! Example "القسم بالاشارات"
|
||||
|
||||
تقسيم الصورة مع الإشارات المعطاة.
|
||||
|
||||
=== "البايثون"
|
||||
|
||||
```python
|
||||
from ultralytics import SAM
|
||||
|
||||
# تحميل النموذج
|
||||
model = SAM('sam_b.pt')
|
||||
|
||||
# عرض معلومات النموذج (اختياري)
|
||||
model.info()
|
||||
|
||||
# تشغيل التنبوء بواسطة الدلائل
|
||||
model('ultralytics/assets/zidane.jpg', bboxes=[439, 437, 524, 709])
|
||||
|
||||
# تشغيل التنبوء بواسطة نقاط الإشارة
|
||||
model('ultralytics/assets/zidane.jpg', points=[900, 370], labels=[1])
|
||||
```
|
||||
|
||||
!!! Example "قطع كل الشيء"
|
||||
|
||||
قم بتجزئة الصورة بأكملها.
|
||||
|
||||
=== "البايثون"
|
||||
|
||||
```python
|
||||
from ultralytics import SAM
|
||||
|
||||
# تحميل النموذج
|
||||
model = SAM('sam_b.pt')
|
||||
|
||||
# عرض معلومات النموذج (اختياري)
|
||||
model.info()
|
||||
|
||||
# تشغيل التنبوء
|
||||
model('مسار/إلى/صورة.jpg')
|
||||
```
|
||||
|
||||
=== "صفيحة"
|
||||
|
||||
```البايش
|
||||
# تشغيل التنبوء بنموذج SAM
|
||||
yolo predict model=sam_b.pt source=path/to/image.jpg
|
||||
```
|
||||
|
||||
- المنطق هنا هو تجزئة الصورة كلها إذا لم تمر عبر أي إشارات (bboxes/ points / masks).
|
||||
|
||||
!!! Example "مثال على SAMPredictor"
|
||||
|
||||
بواسطة هذا الطريق ، يمكنك تعيين الصورة مرة واحدة وتشغيل الإشارات مرارًا وتكرارًا دون تشغيل مشفر الصورة مرة أخرى.
|
||||
|
||||
=== "التنبؤ بالإشارة"
|
||||
|
||||
```البايثون
|
||||
from ultralytics.models.sam import Predictor as SAMPredictor
|
||||
|
||||
# إنشاء SAMPredictor
|
||||
الأعلى = dict (الثقة = 0.25، task ='segment'، النمط = 'تنبؤ'، imgsz = 1024، نموذج = "mobile_sam.pt")
|
||||
predictor = SAMPredictor (overrides = التجاوز الأعلى)
|
||||
|
||||
# تعيين الصورة
|
||||
predictor.set_image("ultralytics/assets/zidane.jpg") # تعيين بواسطة ملف صورة
|
||||
predictor.set_image(cv2.imread("ultralytics/assets/zidane.jpg")) # تعيين مع np.ndarray
|
||||
results = predictor(bboxes=[439, 437, 524, 709])
|
||||
results = predictor(points=[900, 370], labels=[1])
|
||||
|
||||
# إعادة تعيين الصورة
|
||||
predictor.reset_image()
|
||||
```
|
||||
|
||||
قطع كل شيء مع وجود معطيات اختيارية.
|
||||
|
||||
=== "تقطيع كل شيء"
|
||||
|
||||
```البايثون
|
||||
from ultralytics.models.sam import Predictor as SAMPredictor
|
||||
|
||||
# إنشاء SAMPredictor
|
||||
الأعلى = dict (الثقة = 0.25، task ='segment'، النمط = 'تنبؤ'، imgsz = 1024، نموذج = "mobile_sam.pt")
|
||||
predictor = SAMPredictor (overrides = التجاوز الأعلى)
|
||||
|
||||
# تجزئة مع بيانات إضافية
|
||||
results = predictor(source="ultralytics/assets/zidane.jpg"، crop_n_layers=1، points_stride=64)
|
||||
```
|
||||
|
||||
- المزيد args إضافي للتقطيع كل شيء شاهد التوثيق مرجع [`السلبي/تقديم` مرجع](../../../reference/models/sam/predict.md).
|
||||
|
||||
## مقارنة SAM مقابل YOLOv8
|
||||
|
||||
في هذا المكان نقارن نموذج SAM الأصغر سام، SAM-b ، مع نموذج التجزئة YOLOv8 الصغيرة Ultralytics، [YOLOv8n-seg](../tasks/segment.md):
|
||||
|
||||
| النموذج | الحجم | المعلمات | السرعة (المعالج) |
|
||||
|----------------------------------------------|----------------------------|-----------------------|--------------------------|
|
||||
| سام SAM-b | 358 م.بايت | 94.7 M | 51096 ms/im |
|
||||
| [MobileSAM](mobile-sam.md) | 40.7 MB | 10.1 M | 46122 ms/im |
|
||||
| [FastSAM-s](fast-sam.md) with YOLOv8 حافظة | 23.7 MB | 11.8 M | 115 ms/im |
|
||||
| [YOLOv8n-seg](../tasks/segment.md) ل Ultraly | **6.7 MB** (53.4 مرة أصغر) | **3.4 M** (27.9x أقل) | **59 ms/im** (866x أسرع) |
|
||||
|
||||
هذه المقارنة تظهر الاختلافات في أمر المقدار والسرعة بين النماذج. في حين يقدم SAM قدرات فريدة للتجزئة التلقائية ، إلا أنه ليس منافسًا مباشرًا لنماذج التجزئة YOLOv8 ، حيث تكون أصغر وأسرع وأكثر كفاءة.
|
||||
|
||||
اكتنزات التجريب على ماكينة Apple M2 Macbook 2023 مع 16GB من الذاكرة. لإعادة إنتاج هذا الاختبار:
|
||||
|
||||
!!! Example "مثال"
|
||||
|
||||
=== "البايثون"
|
||||
```البايثون
|
||||
from ultralytics import FastSAM, SAM, YOLO
|
||||
|
||||
# تحليل يام-b
|
||||
model = SAM('sam_b.pt')
|
||||
model.info()
|
||||
model('ultralytics/assets')
|
||||
|
||||
# تحليل MobileSAM
|
||||
model = SAM('mobile_sam.pt')
|
||||
model.info()
|
||||
model('ultralytics/assets')
|
||||
|
||||
# تحليل FastSAM-s
|
||||
model = FastSAM('FastSAM-s.pt')
|
||||
model.info()
|
||||
model('ultralytics/assets')
|
||||
|
||||
# تحليل YOLOv8n-seg
|
||||
model = YOLO('yolov8n-seg.pt')
|
||||
model.info()
|
||||
model('ultralytics/assets')
|
||||
```
|
||||
|
||||
## تعلم تلقائي: مسار سريع إلى سلاسل البيانات الخاصة بالتجزئة
|
||||
|
||||
التعلم التلقائي هو ميزة رئيسية لـ SAM، حيث يسمح للمستخدمين بإنشاء [سلاسل بيانات تجزئة](https://docs.ultralytics.com/datasets/segment) باستخدام نموذج الكشف الجاهز. يتيح هذا الميزة إنشاء وتحديث سريع ودقيق لعدد كبير من الصور بدون الحاجة إلى عملية التسمية اليدوية البطيئة.
|
||||
|
||||
### إنشاء سلاسل البيانات الخاصة بالتجزئة باستخدام نموذج الكشف
|
||||
|
||||
للتعليم التلقائي لسلاسل البيانات الخاصة بالتجزئة باستخدام إطار العمل Ultralytics ، استخدم وظيفة 'auto_annotate' كما هو موضح أدناه:
|
||||
|
||||
!!! Example "مثال"
|
||||
|
||||
=== "البايثون"
|
||||
```البايثون
|
||||
from ultralytics.data.annotator import auto_annotate
|
||||
|
||||
auto_annotate(data="مسار/إلى/صور", det_model="yolov8x.pt", sam_model='sam_b.pt')
|
||||
```
|
||||
|
||||
| الوسيطة | النوع | الوصف | الافتراضي |
|
||||
|------------|------------------------|---------------------------------------------------------------------------------------------------------------------------|--------------|
|
||||
| البيانات | سلسلة | المسار إلى المجلد الذي يحتوي على الصور التي سيتم الإشارة إليها. | |
|
||||
| det_model | سلسلة، اختياري | نموذج الكشف المدرب المسبق لـ YOLO. الافتراضي هو 'yolov8x.pt'. | 'yolov8x.pt' |
|
||||
| sam_model | سلسلة، اختياري | نموذج القطعة أيا شيء من Ultralytics. الافتراضي هو 'sam_b.pt'. | 'sam_b.pt' |
|
||||
| device | سلسلة، اختياري | الجهاز الذي يتم تشغيل النماذج عليه. الافتراضي هو سلسلة فارغة (وحدة المعالجة المركزية أو وحدة معالجة الرسومات إذا توافرت). | |
|
||||
| output_dir | سلسلة، لا شيء، اختياري | الدليل لحفظ النتائج المرئية. الافتراضي هو مجلد 'التسميات' في نفس دليل 'البيانات'. | لا شيء |
|
||||
|
||||
يأخذ تابع 'auto_annotate' المسار إلى الصور الخاصة بك مع وسيطات اختيارية لتحديد نموذج الكشف المدرب مسبقًا ونموذج التجزئة SAM والجهاز الذي سيتم تشغيل النماذج به والدليل الخروج لحفظ النتائج المرئية.
|
||||
|
||||
تعلم تلقائيًا باستخدام نماذج مدربة مسبقًا يمكن أن يقلل بشكل كبير من الوقت والجهد المطلوب لإنشاء سلاسل بيانات تجزئة عالية الجودة. يكون هذا الأمر مفيدًا خصوصًا للباحثين والمطورين الذين يتعاملون مع مجموعات صور كبيرة ، حيث يتيح لهم التركيز على تطوير النماذج وتقييمها بدلاً من التسمية اليدوية البطيئة.
|
||||
|
||||
## الاقتباسات والتقديرات
|
||||
|
||||
إذا وجدت SAM مفيدًا في البحث أو العمل التطويري الخاص بك ، يرجى النظر في استشهاد بحثنا:
|
||||
|
||||
!!! Quote ""
|
||||
|
||||
=== "البيبتيكس"
|
||||
```البيبتيكس
|
||||
@misc{kirillov2023segment,
|
||||
title={Segment Anything},
|
||||
author={Alexander Kirillov and Eric Mintun and Nikhila Ravi and Hanzi Mao and Chloe Rolland and Laura Gustafson and Tete Xiao and Spencer Whitehead and Alexander C. Berg and Wan-Yen Lo and Piotr Dollár and Ross Girshick},
|
||||
year={2023},
|
||||
eprint={2304.02643},
|
||||
archivePrefix={arXiv},
|
||||
primaryClass={cs.CV}
|
||||
}
|
||||
```
|
||||
|
||||
نود أن نعبر عن امتناننا لـ Meta AI لإنشاء وصيانة هذا المورد القيم لمجتمع البصريات الحواسيبية.
|
||||
|
||||
*أكلمات دالة: سلسلة المفعولة, نموذج القطعة شيء ما, SAM, Meta SAM, التجزئة, التشفير المميز, آلة آي, segment, Ultralytics, نماذج مدربة مسبقا, SAM الاساسي, SAM الكبير, تجزئة الكيانات, الرؤية الكمبيوترية, آي الاصطناعية, التعلم الآلي, تسمية بيانات, قناع التجزئة, نموذج الكشف, نموذج الكشف YOLO, البيبتكس, Meta AI.*
|
2
ultralytics/docs/ar/models/sam.md:Zone.Identifier
Executable file
2
ultralytics/docs/ar/models/sam.md:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
121
ultralytics/docs/ar/models/yolo-nas.md
Executable file
121
ultralytics/docs/ar/models/yolo-nas.md
Executable file
@ -0,0 +1,121 @@
|
||||
---
|
||||
comments: true
|
||||
description: استكشف التوثيق المفصل لـ YOLO-NAS ، وهو نموذج كشف الكائنات المتطور. تعلم المزيد عن ميزاته والطرز المدربة مسبقًا واستخدامه مع واجهة برمجة Ultralytics Python وأكثر من ذلك.
|
||||
keywords: YOLO-NAS, Deci AI, كشف الكائنات, deep learning, البحث في الهندسة العصبية, واجهة برمجة Ultralytics Python, نموذج YOLO, الطرز المدربة مسبقًا, كمّية, التحسين, COCO, Objects365, Roboflow 100
|
||||
---
|
||||
|
||||
# YOLO-NAS
|
||||
|
||||
## نظرة عامة
|
||||
|
||||
تم تطوير YOLO-NAS بواسطة ديسي ايه اي ، وهو نموذج استشعار الكائنات الطائرة للأمام الذي يقدم تطورًا مبتكرًا. إنه منتج تكنولوجيا بحث الهندسة العصبية المتقدمة ، المصممة بعناية لمعالجة القيود التي كانت تعاني منها النماذج السابقة YOLO. مع تحسينات كبيرة في دعم التمثيل الكموني وتنازلات الدقة والتأخير ، يمثل YOLO-NAS قفزة كبيرة في كشف الكائنات.
|
||||
|
||||

|
||||
**نظرة عامة على YOLO-NAS.** يستخدم YOLO-NAS كتلًا تفاعلية للتمثيل الكموني وتمثيل كمي للحصول على أداء مثلى. يواجه النموذج ، عند تحويله إلى الإصدار المكون من 8 بت ، انخفاضًا طفيفًا في الدقة ، وهو تحسين كبير على النماذج الأخرى. تتوج هذه التطورات بتصميم متفوق ذي قدرات استشعار للكائنات لا مثيل لها وأداء متميز.
|
||||
|
||||
### المزايا الرئيسية
|
||||
|
||||
- **كتلة أساسية ودية للتمثيل الكموني:** يقدم YOLO-NAS كتلة أساسية جديدة ودية للتمثيل الكموني ، مما يعالج أحد القيود الرئيسية للنماذج السابقة YOLO.
|
||||
- **تدريب متطور وتمثيل كمي:** يستخدم YOLO-NAS نظم تدريب متقدمة وتمثيلًا للكم بعد التدريب لتعزيز الأداء.
|
||||
- **تحسين AutoNAC والتدريب المسبق:** يستخدم YOLO-NAS تحسين AutoNAC ويتم تدريبه مسبقًا على مجموعات بيانات بارزة مثل COCO و Objects365 و Roboflow 100. يجعل هذا التدريب المسبق مناسبًا لمهام استشعار الكائنات الفرعية في بيئات الإنتاج.
|
||||
|
||||
## الطرز المدربة مسبقًا
|
||||
|
||||
استمتع بقوة كشف الكائنات من الجيل القادم مع الطرز المدربة مسبقًا لـ YOLO-NAS التي يوفرها Ultralytics. تم تصميم هذه الطرز لتقديم أداء متفوق من حيث السرعة والدقة. اختر من بين مجموعة متنوعة من الخيارات المصممة وفقًا لاحتياجاتك الخاصة:
|
||||
|
||||
| الطراز | مؤشر التقدير المتوسط (mAP) | تأخر الوقت (ms) |
|
||||
|------------------|----------------------------|-----------------|
|
||||
| YOLO-NAS S | 47.5 | 3.21 |
|
||||
| YOLO-NAS M | 51.55 | 5.85 |
|
||||
| YOLO-NAS L | 52.22 | 7.87 |
|
||||
| YOLO-NAS S INT-8 | 47.03 | 2.36 |
|
||||
| YOLO-NAS M INT-8 | 51.0 | 3.78 |
|
||||
| YOLO-NAS L INT-8 | 52.1 | 4.78 |
|
||||
|
||||
تم تصميم كل نسخة من النموذج لتقديم توازن بين متوسط الدقة (mAP) وتأخير الوقت ، مما يساعدك في تحسين مهام كشف الكائنات الخاصة بك من حيث الأداء والسرعة.
|
||||
|
||||
## أمثلة الاستخدام
|
||||
|
||||
قام Ultralytics بجعل طرز YOLO-NAS سهلة الدمج في تطبيقات Python الخاصة بك عبر حزمة `ultralytics` الخاصة بنا. توفر الحزمة واجهة برمجة التطبيقات بسيطة الاستخدام لتسهيل العملية.
|
||||
|
||||
توضح الأمثلة التالية كيفية استخدام طرز YOLO-NAS مع حزمة `ultralytics` للكشف والتحقق:
|
||||
|
||||
### أمثلة الكشف والتحقق
|
||||
|
||||
في هذا المثال ، نقوم بالتحقق من صحة YOLO-NAS-s على مجموعة بيانات COCO8.
|
||||
|
||||
!!! Example "مثال"
|
||||
|
||||
يوفر هذا المثال رمز بسيط لعملية الكشف والتحقق لـ YOLO-NAS. لمعالجة نتائج الاستدلال ، انظر وضع [توقع](../modes/predict.md). لاستخدام YOLO-NAS مع وضعيات إضافية ، انظر [توصيف](../modes/val.md) و[تصدير](../modes/export.md). لا يدعم نظام YOLO-NAS على حزمة `ultralytics` عملية التدريب.
|
||||
|
||||
=== "Python"
|
||||
|
||||
يمكن تمرير نماذج PyTorch المدربة مسبقًا `*.pt` إلى فئة `NAS()` لإنشاء نموذج في Python:
|
||||
|
||||
```python
|
||||
from ultralytics import NAS
|
||||
|
||||
# تحميل نموذج YOLO-NAS-s المدرب مسبقًا على COCO
|
||||
model = NAS('yolo_nas_s.pt')
|
||||
|
||||
# عرض معلومات النموذج (اختياري)
|
||||
model.info()
|
||||
|
||||
# التحقق من صحة النموذج على مجموعة بيانات مثال COCO8
|
||||
results = model.val(data='coco8.yaml')
|
||||
|
||||
# تشغيل استدلال باستخدام نموذج YOLO-NAS-s على صورة 'bus.jpg'
|
||||
results = model('path/to/bus.jpg'))
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
|
||||
تتوفر أوامر CLI لتشغيل النماذج مباشرة:
|
||||
|
||||
```bash
|
||||
# تحميل نموذج YOLO-NAS-s المدرب مسبقًا على COCO والتحقق من أدائه على مجموعة بيانات مثال COCO8
|
||||
yolo val model=yolo_nas_s.pt data=coco8.yaml
|
||||
|
||||
# تحميل نموذج YOLO-NAS-s المدرب مسبقًا على COCO والتنبؤ بالاستدلال على صورة 'bus.jpg'
|
||||
yolo predict model=yolo_nas_s.pt source=path/to/bus.jpg
|
||||
```
|
||||
|
||||
## المهام والأوضاع المدعومة
|
||||
|
||||
نحن نقدم ثلاثة أنواع من نماذج YOLO-NAS: الصغير (s) ، المتوسط (m) ، والكبير (l). يتم تصميم كل نسخة لتلبية احتياجات الحوسبة والأداء المختلفة:
|
||||
|
||||
- **YOLO-NAS-s**: محسنة للبيئات التي تكون فيها الموارد الحسابية محدودة والكفاءة هي الأهم.
|
||||
- **YOLO-NAS-m**: يقدم نهجًا متوازنًا ، مناسبًا لكشف الكائنات العامة بدقة أعلى.
|
||||
- **YOLO-NAS-l**: مصممة للسيناريوهات التي تتطلب أعلى درجة من الدقة ، حيث الموارد الحسابية أقل قيدًا.
|
||||
|
||||
أدناه نظرة عامة مفصلة عن كل نموذج ، بما في ذلك روابط أوزانهم المدربين مسبقًا ، والمهام التي يدعمونها ، وتوافقهم مع وضعيات التشغيل المختلفة.
|
||||
|
||||
| نوع النموذج | أوزان مدربة مسبقًا | المهام المدعومة | الاستدلال | التحقق | التدريب | التصدير |
|
||||
|-------------|-----------------------------------------------------------------------------------------------|------------------------------------|-----------|--------|---------|---------|
|
||||
| YOLO-NAS-s | [yolo_nas_s.pt](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolo_nas_s.pt) | [كشف الكائنات](../tasks/detect.md) | ✅ | ✅ | ❌ | ✅ |
|
||||
| YOLO-NAS-m | [yolo_nas_m.pt](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolo_nas_m.pt) | [كشف الكائنات](../tasks/detect.md) | ✅ | ✅ | ❌ | ✅ |
|
||||
| YOLO-NAS-l | [yolo_nas_l.pt](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolo_nas_l.pt) | [كشف الكائنات](../tasks/detect.md) | ✅ | ✅ | ❌ | ✅ |
|
||||
|
||||
## الاقتباسات والشكر
|
||||
|
||||
إذا استخدمت YOLO-NAS في أعمالك البحثية أو التطويرية ، يرجى الاستشهاد بمشروع SuperGradients:
|
||||
|
||||
!!! Quote ""
|
||||
|
||||
=== "BibTeX"
|
||||
|
||||
```bibtex
|
||||
@misc{supergradients,
|
||||
doi = {10.5281/ZENODO.7789328},
|
||||
url = {https://zenodo.org/record/7789328},
|
||||
author = {Aharon, Shay and {Louis-Dupont} and {Ofri Masad} and Yurkova, Kate and {Lotem Fridman} and {Lkdci} and Khvedchenya, Eugene and Rubin, Ran and Bagrov, Natan and Tymchenko, Borys and Keren, Tomer and Zhilko, Alexander and {Eran-Deci}},
|
||||
title = {Super-Gradients},
|
||||
publisher = {GitHub},
|
||||
journal = {GitHub repository},
|
||||
year = {2021},
|
||||
}
|
||||
```
|
||||
|
||||
نعبر عن امتناننا لفريق [SuperGradients](https://github.com/Deci-AI/super-gradients/) في Deci AI لجهودهم في إنشاء وصيانة هذة الموارد القيمة لمجتمع رؤية الحاسوب. نعتقد أن YOLO-NAS ، بتصميمه المبتكر وقدرته الاستشعار المتفوقة للكائنات ، سيصبح أداة حاسمة للمطورين والباحثين على حد سواء.
|
||||
|
||||
*keywords: YOLO-NAS, Deci AI, كشف الكائنات, deep learning, البحث في الهندسة العصبية, واجهة برمجة Ultralytics Python, نموذج YOLO, SuperGradients, الطرز المدربة مسبقًا, كتلة أساسية ودية للتمثيل الكموني, أنظمة تدريب متطورة, تمثيل كمي بعد التدريب, تحسين AutoNAC, COCO, Objects365, Roboflow 100*
|
2
ultralytics/docs/ar/models/yolo-nas.md:Zone.Identifier
Executable file
2
ultralytics/docs/ar/models/yolo-nas.md:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
98
ultralytics/docs/ar/models/yolov3.md
Executable file
98
ultralytics/docs/ar/models/yolov3.md
Executable file
@ -0,0 +1,98 @@
|
||||
---
|
||||
comments: true
|
||||
description: احصل على نظرة عامة حول YOLOv3 و YOLOv3-Ultralytics و YOLOv3u. تعرف على ميزاتها الرئيسية واستخدامها والمهام المدعومة للكشف عن الكائنات.
|
||||
keywords: YOLOv3، YOLOv3-Ultralytics، YOLOv3u، الكشف عن الكائنات، إجراء، التدريب، Ultralytics
|
||||
---
|
||||
|
||||
# YOLOv3 و YOLOv3-Ultralytics و YOLOv3u
|
||||
|
||||
## النظرة العامة
|
||||
|
||||
يقدم هذا الوثيقة نظرة عامة على ثلاث نماذج مرتبطة بكشف الكائنات ، وهي [YOLOv3](https://pjreddie.com/darknet/yolo/) و [YOLOv3-Ultralytics](https://github.com/ultralytics/yolov3) و [YOLOv3u](https://github.com/ultralytics/ultralytics).
|
||||
|
||||
1. **YOLOv3:** هذه هي الإصدار الثالث من خوارزمية You Only Look Once (YOLO) للكشف عن الكائنات. قام جوزيف ريدمون بتطويرها بالأصل ، وقد قامت YOLOv3 بتحسين سابقيها من خلال إدخال ميزات مثل التنبؤات متعددة المقياس وثلاثة أحجام مختلفة من نوى الكشف.
|
||||
|
||||
2. **YOLOv3-Ultralytics:** هذه هي تنفيذ Ultralytics لنموذج YOLOv3. يقوم بإعادة إنتاج بنية YOLOv3 الأصلية ويقدم وظائف إضافية ، مثل دعم المزيد من النماذج المدربة مسبقًا وخيارات تخصيص أسهل.
|
||||
|
||||
3. **YOLOv3u:** هذا هو الإصدار المُحدّث لـ YOLOv3-Ultralytics الذي يدمج رأس الكشف بدون مشتركات وبدون مستخدم الكائن الذي يستخدم في نماذج YOLOv8. يحتفظ YOLOv3u بنفس بنية العمود الفقري والعنق مثل YOLOv3 ولكن برأس الكشف المُحدث من YOLOv8.
|
||||
|
||||

|
||||
|
||||
## الميزات الرئيسية
|
||||
|
||||
- **YOLOv3:** قدم استخدام ثلاث مقياسات مختلفة للكشف ، باستخدام ثلاثة أحجام مختلفة من نوى الكشف: 13x13 ، 26x26 و 52x52. هذا يحسن بشكل كبير دقة الكشف للكائنات ذات الأحجام المختلفة. بالإضافة إلى ذلك ، أضاف YOLOv3 ميزات مثل التنبؤات متعددة العلامات لكل مربع محاذاة وشبكة استخراج سمات أفضل.
|
||||
|
||||
- **YOLOv3-Ultralytics:** توفر تنفيذ Ultralytics لـ YOLOv3 نفس الأداء مثل النموذج الأصلي ولكنه يأتي مع دعم إضافي للمزيد من النماذج المدربة مسبقًا وطرق تدريب إضافية وخيارات أسهل للتخصيص. هذا يجعلها أكثر مرونة وسهولة استخداماً للتطبيقات العملية.
|
||||
|
||||
- **YOLOv3u:** يدمج هذا النموذج المُحدّث رأس الكشف بدون مشتركات وبدون مستخدم الكائن من YOLOv8. من خلال إزالة الحاجة إلى صناديق المرجع المحددة مسبقًا ودرجات تكون الكائن ، يمكن أن يحسن تصميم رأس الكشف هذا قدرة النموذج على كشف الكائنات ذات الأحجام والأشكال المتنوعة. هذا يجعل YOLOv3u أكثر مرونة ودقة لمهام كشف الكائنات.
|
||||
|
||||
## المهام المدعومة والأوضاع
|
||||
|
||||
تم تصميم سلسلة YOLOv3 ، بما في ذلك YOLOv3 و YOLOv3-Ultralytics و YOLOv3u ، خصيصًا لمهام الكشف عن الكائنات. يشتهر هذه النماذج بفعاليتها في سيناريوهات العالم الحقيقي المختلفة ، مع توازن دقة الكشف والسرعة. يوفر كل طراز ميزات وتحسينات فريدة ، مما يجعلها مناسبة لمجموعة متنوعة من التطبيقات.
|
||||
|
||||
يدعم النماذج الثلاثة وضعًا شاملاً من الأوضاع ، مما يضمن مرونة في مراحل مختلفة من نموذج النشر والتطوير. هذه الأوضاع تشمل [التمييز](../modes/predict.md) ، [التحقق](../modes/val.md) ، [التدريب](../modes/train.md) و [التصدير](../modes/export.md) ، مما يوفر للمستخدمين مجموعة كاملة من أدوات فعالة للكشف عن الكائنات.
|
||||
|
||||
| نوع النموذج | المهام المدعومة | التمييز | التحقق | التدريب | التصدير |
|
||||
|--------------------|------------------------------------|---------|--------|---------|---------|
|
||||
| YOLOv3 | [كشف الكائنات](../tasks/detect.md) | ✅ | ✅ | ✅ | ✅ |
|
||||
| YOLOv3-Ultralytics | [كشف الكائنات](../tasks/detect.md) | ✅ | ✅ | ✅ | ✅ |
|
||||
| YOLOv3u | [كشف الكائنات](../tasks/detect.md) | ✅ | ✅ | ✅ | ✅ |
|
||||
|
||||
توفر هذه الجدولة نظرة فورية على إمكانات كل نسخة من YOLOv3 ، مما يسلط الضوء على مرونتها وملاءمتها لمختلف المهام وأوضاع العمل العملية في سير العمل لكشف الكائنات.
|
||||
|
||||
## أمثلة الاستخدام
|
||||
|
||||
يقدم هذا المثال أمثلة بسيطة للتدريب والتنبؤ باستخدام YOLOv3. للحصول على وثائق كاملة حول هذه وغيرها من [الأوضاع](../modes/index.md) انظر صفحات الوثائق: [التنبؤ](../modes/predict.md) ، (../modes/train.md) [Val](../modes/val.md) و [التصدير](../modes/export.md) docs.
|
||||
|
||||
!!! Example "مثال"
|
||||
|
||||
=== "بيثون"
|
||||
|
||||
يمكن تمرير نماذج PyTorch المدربة مسبقًا `*.pt` وملفات التكوين `*.yaml` إلى فئة `YOLO()` لإنشاء نموذج في Python:
|
||||
|
||||
```python
|
||||
من ultralytics استيراد YOLO
|
||||
|
||||
# تحميل نموذج YOLOv3n المدرب مسبقًا على COCO
|
||||
model = YOLO('yolov3n.pt')
|
||||
|
||||
# عرض معلومات النموذج (اختياري)
|
||||
model.info()
|
||||
|
||||
# تدريب النموذج على مجموعة البيانات المثالية Coco8 لمدة 100 دورة تدريب
|
||||
results = model.train(data='coco8.yaml', epochs=100, imgsz=640)
|
||||
|
||||
# قم بتشغيل التنبؤ باستخدام نموذج YOLOv3n على صورة 'bus.jpg'
|
||||
results = model('path/to/bus.jpg')
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
|
||||
تتوفر أوامر CLI لتشغيل النماذج مباشرة:
|
||||
|
||||
```bash
|
||||
# تحميل نموذج YOLOv3n المدرب مسبقًا على COCO وقم بتدريبه على مجموعة البيانات المثالية Coco8 لمدة 100 دورة تدريب
|
||||
yolo train model=yolov3n.pt data=coco8.yaml epochs=100 imgsz=640
|
||||
|
||||
# تحميل نموذج YOLOv3n المدرب مسبقًا على COCO وتشغيل التنبؤ على صورة 'bus.jpg'
|
||||
yolo predict model=yolov3n.pt source=path/to/bus.jpg
|
||||
```
|
||||
|
||||
## الاقتباسات والشكر
|
||||
|
||||
إذا قمت باستخدام YOLOv3 في بحثك ، فيرجى الاقتباس لأوراق YOLO الأصلية ومستودع Ultralytics YOLOv3:
|
||||
|
||||
!!! Quote ""
|
||||
|
||||
=== "بيب تيكس"
|
||||
|
||||
```bibtex
|
||||
@article{redmon2018yolov3,
|
||||
title={YOLOv3: An Incremental Improvement},
|
||||
author={Redmon, Joseph and Farhadi, Ali},
|
||||
journal={arXiv preprint arXiv:1804.02767},
|
||||
year={2018}
|
||||
}
|
||||
```
|
||||
|
||||
شكراً لجوزيف ريدمون وعلي فرهادي على تطوير YOLOv3 الأصلي.
|
2
ultralytics/docs/ar/models/yolov3.md:Zone.Identifier
Executable file
2
ultralytics/docs/ar/models/yolov3.md:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
72
ultralytics/docs/ar/models/yolov4.md
Executable file
72
ultralytics/docs/ar/models/yolov4.md
Executable file
@ -0,0 +1,72 @@
|
||||
---
|
||||
comments: true
|
||||
description: استكشف دليلنا التفصيلي على YOLOv4 ، وهو جهاز كشف الكائنات الحديثة في الوقت الحقيقي. فهم أبرز معالم التصميم المعماري الخاصة به ، والميزات المبتكرة ، وأمثلة التطبيق.
|
||||
keywords: ultralytics ، yolo v4 ، كشف الكائنات ، شبكة عصبية ، كشف في الوقت الحقيقي ، كاشف الكائنات ، تعلم الآلة
|
||||
|
||||
---
|
||||
|
||||
# YOLOv4: الكشف العالي السرعة والدقة للكائنات
|
||||
|
||||
أهلاً بك في صفحة وثائق Ultralytics لـ YOLOv4 ، جهاز كشف الكائنات الحديث في الوقت الحقيقي الذي تم إطلاقه في عام 2020 من قبل Alexey Bochkovskiy على [https://github.com/AlexeyAB/darknet](https://github.com/AlexeyAB/darknet). تم تصميم YOLOv4 لتوفير التوازن المثالي بين السرعة والدقة ، مما يجعله خيارًا ممتازًا للعديد من التطبيقات.
|
||||
|
||||

|
||||
**رسم توضيحي لهندسة YOLOv4**. يعرض التصميم المعماري المعقد لشبكة YOLOv4 ، بما في ذلك المكونات الرئيسية والرقبة والرأس ، والطبقات المترابطة للكشف الفعال في الوقت الحقيقي.
|
||||
|
||||
## مقدمة
|
||||
|
||||
تعني YOLOv4 "فقط تنظر مرة واحدة النسخة 4". هو نموذج كشف الكائنات الحقيقي الزمني الذي تم تطويره لمعالجة قيود الإصدارات السابقة لـ YOLO مثل [YOLOv3](yolov3.md) ونماذج كشف الكائنات الأخرى. على عكس كاشفات الكائنات الأخرى القائمة على الشبكات العصبية المتزاحمة المستخدمة للكشف عن الكائنات ، يمكن تطبيق YOLOv4 لأنظمة الوصية النصحية وكذلك لإدارة العملية المستقلة وتقليل الإدخالات البشرية. يتيح تشغيله على وحدات معالجة الرسومات القياسية (GPUs) الاستخدام الشامل بتكلفة معقولة ، وتم تصميمه للعمل في الوقت الفعلي على وحدة معالجة الرسومات التقليدية مع الحاجة إلى وحدة واحدة فقط من هذا النوع للتدريب.
|
||||
|
||||
## الهندسة
|
||||
|
||||
تستغل YOLOv4 العديد من الميزات المبتكرة التي تعمل معًا لتحسين أدائها. تشمل هذه الميزات الاتصالات المتبقية المرجحة (WRC) ، والاتصالات الجزئية عبر المرحلة المتقاطعة (CSP) ، والتطبيع المتقاطع المصغر لدُفع (CmBN) ، والتدريب المتنازع لنفسه (SAT) ، وتنشيط Mish ، وزيادة بيانات الزخم ، وتنظيم DropBlock ، وخسارة CIoU. يتم دمج هذه الميزات لتحقيق أحدث النتائج.
|
||||
|
||||
يتألف كاشف الكائنات النموذجي من عدة أجزاء بما في ذلك المدخل والظهر والرقبة والرأس. يتم تدريب الظهرية لـ YOLOv4 سلفًا على ImageNet ويستخدم لتوقع فئات ومربعات محيطة للكائنات. يمكن أن يكون الظهرية من عدة نماذج بما في ذلك VGG و ResNet و ResNeXt أو DenseNet. يتم استخدام جزء الرقبة من الكاشف لجمع خرائط الميزات من مراحل مختلفة وعادة ما يتضمن عدة مسارات لأسفل وعدة مسارات للأعلى. جزء الرأس هو ما يستخدم لإجراء اكتشاف الكائنات والتصنيف النهائي.
|
||||
|
||||
## الحقيبة المجانية
|
||||
|
||||
يستخدم YOLOv4 أيضًا طرقًا تعرف باسم "حقيبة المجانيات" وهي تقنيات تحسِّن دقة النموذج أثناء التدريب دون زيادة تكلفة الاستنتاج. تعد التعديلات في البيانات تقنية شائعة في كشف الكائنات ، والتي تزيد من تنوع صور الإدخال لتحسين قوة الموديل. بعض أمثلة التعديل في البيانات تشمل التشويهات البصرية (ضبط السطوع والتباين والدرجة والتشبع والضوضاء في الصورة) والتشويهات الهندسية (إضافة توزيع عشوائي للتغيير المقياسي والاقتصاص والانعكاس والتدوير). تساعد هذه التقنيات الموديل في التعميم على أنواع مختلفة من الصور.
|
||||
|
||||
## الميزات والأداء
|
||||
|
||||
تم تصميم YOLOv4 لتحقيق سرعة ودقة مثلى في كشف الكائنات. يتضمن تصميم YOLOv4 CSPDarknet53 كظهر ، PANet كرقبة ، و YOLOv3 كرأس كشف. يسمح هذا التصميم لـ YOLOv4 بأداء كشف الكائنات بسرعة مذهلة ، مما يجعله مناسبًا لتطبيقات الوقت الحقيقي. يتفوق YOLOv4 أيضًا في الدقة ، ويحقق نتائج عالية في مقاييس كشف الكائنات.
|
||||
|
||||
## أمثلة الاستخدام
|
||||
|
||||
في وقت كتابة هذا النص ، لا يدعم Ultralytics حاليًا نماذج YOLOv4. لذلك ، سيحتاج أي مستخدمين مهتمين باستخدام YOLOv4 إلى الرجوع مباشرة إلى مستودع YOLOv4 على GitHub للحصول على تعليمات التثبيت والاستخدام.
|
||||
|
||||
إليك نظرة عامة موجزة على الخطوات النموذجية التي يمكن أن تتخذها لاستخدام YOLOv4:
|
||||
|
||||
1. قم بزيارة مستودع YOLOv4 على GitHub: [https://github.com/AlexeyAB/darknet](https://github.com/AlexeyAB/darknet).
|
||||
|
||||
2. اتبع التعليمات المقدمة في ملف README لعملية التثبيت. ينطوي هذا عادة على استنساخ المستودع ، وتثبيت التبعيات اللازمة ، وإعداد أي متغيرات بيئة ضرورية.
|
||||
|
||||
3. بمجرد الانتهاء من التثبيت ، يمكنك تدريب واستخدام النموذج وفقًا لتعليمات الاستخدام المقدمة في المستودع. يتضمن ذلك عادة إعداد مجموعة البيانات الخاصة بك ، وتكوين معاملات النموذج ، وتدريب النموذج ، ثم استخدام النموذج المدرب لأداء اكتشاف الكائنات.
|
||||
|
||||
يرجى ملاحظة أن الخطوات النموذجية قد تختلف اعتمادًا على حالة الاستخدام الخاصة بك وحالة مستودع YOLOv4 الحالي. لذلك ، يُنصح بشدة بالرجوع مباشرة إلى التعليمات المقدمة في مستودع YOLOv4 على GitHub.
|
||||
|
||||
نؤسف على أي إزعاج ، وسنسعى لتحديث هذا المستند بأمثلة استخدام لـ Ultralytics بمجرد تنفيذ الدعم لـ YOLOv4.
|
||||
|
||||
## الاستنتاج
|
||||
|
||||
YOLOv4 هو نموذج قوي وفعال لكشف الكائنات يجمع بين السرعة والدقة. يستخدم الميزات الفريدة وتقنيات الزخم في التدريب للأداء بشكل ممتاز في مهام اكتشاف الكائنات في الوقت الفعلي. يمكن لأي شخص يمتلك وحدة معالجة رسومية تقليدية تدريب YOLOv4 واستخدامها ، مما يجعلها سهلة الوصول وعملية لمجموعة واسعة من التطبيقات.
|
||||
|
||||
## التنويه والتقديرات
|
||||
|
||||
نود أن نعترف بمساهمة أصحاب YOLOv4 في مجال كشف الكائنات الحقيقية الزمنية:
|
||||
|
||||
!!! Quote ""
|
||||
|
||||
=== "بيب تكس"
|
||||
|
||||
```bibtex
|
||||
@misc{bochkovskiy2020yolov4,
|
||||
title={YOLOv4: Optimal Speed and Accuracy of Object Detection},
|
||||
author={Alexey Bochkovskiy and Chien-Yao Wang and Hong-Yuan Mark Liao},
|
||||
year={2020},
|
||||
eprint={2004.10934},
|
||||
archivePrefix={arXiv},
|
||||
primaryClass={cs.CV}
|
||||
}
|
||||
```
|
||||
|
||||
يمكن العثور على ورقة YOLOv4 الأصلية على [arXiv](https://arxiv.org/abs/2004.10934). قام المؤلفون بتوفير عملهم بشكل عام ، ويمكن الوصول إلى قاعدة الشفرات على [GitHub](https://github.com/AlexeyAB/darknet). نقدر جهودهم في تعزيز الميدان وتوفير عملهم للمجتمع العريض.
|
2
ultralytics/docs/ar/models/yolov4.md:Zone.Identifier
Executable file
2
ultralytics/docs/ar/models/yolov4.md:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
107
ultralytics/docs/ar/models/yolov5.md
Executable file
107
ultralytics/docs/ar/models/yolov5.md
Executable file
@ -0,0 +1,107 @@
|
||||
---
|
||||
comments: true
|
||||
description: اكتشف YOLOv5u، وهو إصدار معزز لنموذج YOLOv5 يوفر توازنًا محسنًا بين الدقة والسرعة والعديد من النماذج المدربة مسبقًا لمهام كشف الكائنات المختلفة.
|
||||
keywords: YOLOv5u، كشف الكائنات، النماذج المدربة مسبقًا، Ultralytics، التشخيص، التحقق، YOLOv5، YOLOv8، بدون قاعدة تثبيت العقدة الرئيسية، بدون قيمة الكائن، التطبيقات الفعلية، تعلم الآلة
|
||||
---
|
||||
|
||||
# YOLOv5
|
||||
|
||||
## نظرة عامة
|
||||
|
||||
يمثل YOLOv5u تقدمًا في منهجيات كشف الكائنات. يندرج YOLOv5u تحت البنية المعمارية الأساسية لنموذج [YOLOv5](https://github.com/ultralytics/yolov5) الذي طورته شركة Ultralytics، و يدمج نموذج YOLOv5u ميزة القسمة على جزئين للكائنات المستقلة عن القاعدة التي تم تقديمها في نماذج [YOLOv8](yolov8.md). تحسين هذا النمط يحسن نمط النموذج، مما يؤدي إلى تحسين التوازن بين الدقة والسرعة في مهام كشف الكائنات. بناءً على النتائج التجريبية والمزايا المشتقة منها، يقدم YOLOv5u بديلاً فعالًا لأولئك الذين يسعون لإيجاد حلول قوية في الأبحاث والتطبيقات العملية.
|
||||
|
||||

|
||||
|
||||
## المزايا الرئيسية
|
||||
|
||||
- **رأس Ultralytics للقسمة بدون قاعدة تثبيت العقدة:** يعتمد نماذج كشف الكائنات التقليدية على صناديق قاعدة محددة مسبقًا لتوقع مواقع الكائنات. ومع ذلك، يحدث تحديث في نهج YOLOv5u هذا. من خلال اعتماد رأس Ultralytics المُقسم بدون قاعدة تثبيت العقدة، يضمن هذا النمط آلية كشف أكثر مرونة واندفاعًا، مما يعزز الأداء في سيناريوهات متنوعة.
|
||||
|
||||
- **توازن محسن بين الدقة والسرعة:** تتصارع السرعة والدقة في العديد من الأحيان. ولكن YOLOv5u يتحدى هذا التوازن. يقدم توازنًا معايرًا، ويضمن كشفًا في الوقت الفعلي دون المساومة على الدقة. تعد هذه الميزة ذات قيمة خاصة للتطبيقات التي تتطلب استجابة سريعة، مثل المركبات المستقلة والروبوتات وتحليل الفيديو في الوقت الفعلي.
|
||||
|
||||
- **مجموعة متنوعة من النماذج المدربة مسبقًا:** على فهم الأمور التي تحتاج إلى مجموعات أدوات مختلفة YOLOv5u يوفر العديد من النماذج المدربة مسبقًا. سواء كنت تركز على التشخيص أو التحقق أو التدريب، هناك نموذج مصمم خصيصًا ينتظرك. يضمن هذا التنوع أنك لا تستخدم حلاً من نوع واحد يناسب الجميع، ولكن نموذج موازن حسب حاجتك الفريدة.
|
||||
|
||||
## المهام والأوضاع المدعومة
|
||||
|
||||
تتفوق نماذج YOLOv5u، مع مجموعة متنوعة من الأوزان المدربة مسبقًا، في مهام [كشف الكائنات](../tasks/detect.md). تدعم هذه النماذج مجموعة شاملة من الأوضاع، مما يجعلها مناسبة لتطبيقات متنوعة، من التطوير إلى التنفيذ.
|
||||
|
||||
| نوع النموذج | الأوزان المدربة مسبقًا | المهمة | التشخيص | التحقق | التدريب | التصدير |
|
||||
|-------------|-----------------------------------------------------------------------------------------------------------------------------|------------------------------------|---------|--------|---------|---------|
|
||||
| YOLOv5u | `yolov5nu`, `yolov5su`, `yolov5mu`, `yolov5lu`, `yolov5xu`, `yolov5n6u`, `yolov5s6u`, `yolov5m6u`, `yolov5l6u`, `yolov5x6u` | [كشف الكائنات](../tasks/detect.md) | ✅ | ✅ | ✅ | ✅ |
|
||||
|
||||
يوفر هذا الجدول نظرة عامة مفصلة عن البدائل من نماذج نموذج YOLOv5u، ويسلط الضوء على تطبيقاتها في مهام كشف الكائنات ودعمها لأوضاع تشغيل متنوعة مثل [التشخيص](../modes/predict.md)، [التحقق](../modes/val.md)، [التدريب](../modes/train.md)، و[التصدير](../modes/export.md). يضمن هذا الدعم الشامل أن يمكن للمستخدمين استغلال قدرات نماذج YOLOv5u بشكل كامل في مجموعة واسعة من سيناريوهات كشف الكائنات.
|
||||
|
||||
## الأداء
|
||||
|
||||
!!! الأداء
|
||||
|
||||
=== "كشف"
|
||||
|
||||
راجع [وثائق الكشف](https://docs.ultralytics.com/tasks/detect/) للحصول على أمثلة استخدام مع هذه النماذج المدربة على [COCO](https://docs.ultralytics.com/datasets/detect/coco/)، التي تشمل 80 فئة مدربة مسبقًا.
|
||||
|
||||
| النموذج | يامل | حجم<br><sup>(بكسل) | mAP<sup>val<br>50-95 | سرعة<br><sup>معالج الجهاز ONNX<br>(مللي ثانية) | سرعة<br><sup>حويصلة A100 TensorRT<br>(مللي ثانية) | المعلمات<br><sup>(مليون) | FLOPs<br><sup>(بليون) |
|
||||
|---------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------|-----------------------|----------------------|--------------------------------|-------------------------------------|--------------------|-------------------|
|
||||
| [yolov5nu.pt](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov5nu.pt) | [yolov5n.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/models/v5/yolov5.yaml) | 640 | 34.3 | 73.6 | 1.06 | 2.6 | 7.7 |
|
||||
| [yolov5su.pt](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov5su.pt) | [yolov5s.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/models/v5/yolov5.yaml) | 640 | 43.0 | 120.7 | 1.27 | 9.1 | 24.0 |
|
||||
| [yolov5mu.pt](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov5mu.pt) | [yolov5m.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/models/v5/yolov5.yaml) | 640 | 49.0 | 233.9 | 1.86 | 25.1 | 64.2 |
|
||||
| [yolov5lu.pt](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov5lu.pt) | [yolov5l.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/models/v5/yolov5.yaml) | 640 | 52.2 | 408.4 | 2.50 | 53.2 | 135.0 |
|
||||
| [yolov5xu.pt](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov5xu.pt) | [yolov5x.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/models/v5/yolov5.yaml) | 640 | 53.2 | 763.2 | 3.81 | 97.2 | 246.4 |
|
||||
| | | | | | | | |
|
||||
| [yolov5n6u.pt](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov5n6u.pt) | [yolov5n6.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/models/v5/yolov5-p6.yaml) | 1280 | 42.1 | 211.0 | 1.83 | 4.3 | 7.8 |
|
||||
| [yolov5s6u.pt](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov5s6u.pt) | [yolov5s6.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/models/v5/yolov5-p6.yaml) | 1280 | 48.6 | 422.6 | 2.34 | 15.3 | 24.6 |
|
||||
| [yolov5m6u.pt](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov5m6u.pt) | [yolov5m6.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/models/v5/yolov5-p6.yaml) | 1280 | 53.6 | 810.9 | 4.36 | 41.2 | 65.7 |
|
||||
| [yolov5l6u.pt](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov5l6u.pt) | [yolov5l6.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/models/v5/yolov5-p6.yaml) | 1280 | 55.7 | 1470.9 | 5.47 | 86.1 | 137.4 |
|
||||
| [yolov5x6u.pt](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov5x6u.pt) | [yolov5x6.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/models/v5/yolov5-p6.yaml) | 1280 | 56.8 | 2436.5 | 8.98 | 155.4 | 250.7 |
|
||||
|
||||
## أمثلة للاستخدام
|
||||
|
||||
يقدم هذا المثال أمثلة بسيطة للغاية للتدريب والتشخيص باستخدام YOLOv5. يُمكن إنشاء نموذج مثيل في البرمجة باستخدام نماذج PyTorch المدربة مسبقًا في صيغة `*.pt` وملفات التكوين `*.yaml`:
|
||||
|
||||
```python
|
||||
from ultralytics import YOLO
|
||||
|
||||
#قم بتحميل نموذج YOLOv5n المدرب مسبقًا على مجموعة بيانات COCO
|
||||
model = YOLO('yolov5n.pt')
|
||||
|
||||
# قم بعرض معلومات النموذج (اختياري)
|
||||
model.info()
|
||||
|
||||
# قم بتدريب النموذج على مجموعة البيانات COCO8 لمدة 100 دورة
|
||||
results = model.train(data='coco8.yaml', epochs=100, imgsz=640)
|
||||
|
||||
# قم بتشغيل التشخيص بنموذج YOLOv5n على صورة 'bus.jpg'
|
||||
results = model('path/to/bus.jpg')
|
||||
```
|
||||
|
||||
=== "سطر الأوامر"
|
||||
|
||||
يتاح سطر الأوامر لتشغيل النماذج مباشرة:
|
||||
|
||||
```bash
|
||||
# قم بتحميل نموذج YOLOv5n المدرب مسبقًا على مجموعة بيانات COCO8 وقم بتدريبه لمدة 100 دورة
|
||||
yolo train model=yolov5n.pt data=coco8.yaml epochs=100 imgsz=640
|
||||
|
||||
# قم بتحميل نموذج YOLOv5n المدرب مسبقًا على مجموعة بيانات COCO8 وتشغيل حالة التشخيص على صورة 'bus.jpg'
|
||||
yolo predict model=yolov5n.pt source=path/to/bus.jpg
|
||||
```
|
||||
|
||||
## الاستشهادات والتقدير
|
||||
|
||||
إذا قمت باستخدام YOLOv5 أو YOLOv5u في بحثك، يرجى استشهاد نموذج Ultralytics YOLOv5 بطريقة الاقتباس التالية:
|
||||
|
||||
!!! Quote ""
|
||||
|
||||
=== "BibTeX"
|
||||
```bibtex
|
||||
@software{yolov5,
|
||||
title = {Ultralytics YOLOv5},
|
||||
author = {Glenn Jocher},
|
||||
year = {2020},
|
||||
version = {7.0},
|
||||
license = {AGPL-3.0},
|
||||
url = {https://github.com/ultralytics/yolov5},
|
||||
doi = {10.5281/zenodo.3908559},
|
||||
orcid = {0000-0001-5950-6979}
|
||||
}
|
||||
```
|
||||
|
||||
يرجى ملاحظة أن نماذج YOLOv5 متاحة بترخيص [AGPL-3.0](https://github.com/ultralytics/ultralytics/blob/main/LICENSE) و[Enterprise](https://ultralytics.com/license).
|
2
ultralytics/docs/ar/models/yolov5.md:Zone.Identifier
Executable file
2
ultralytics/docs/ar/models/yolov5.md:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
107
ultralytics/docs/ar/models/yolov6.md
Executable file
107
ultralytics/docs/ar/models/yolov6.md
Executable file
@ -0,0 +1,107 @@
|
||||
---
|
||||
comments: true
|
||||
description: استكشف نموذج Meituan YOLOv6 للكشف عن الكائنات الحديثة، والذي يوفر توازنًا مذهلاً بين السرعة والدقة، مما يجعله الخيار الأمثل لتطبيقات الوقت الحقيقي. تعرّف على الميزات والنماذج المُدربة مسبقًا واستخدام Python.
|
||||
keywords: Meituan YOLOv6، الكشف عن الكائنات، Ultralytics، YOLOv6 docs، Bi-directional Concatenation، تدريب بمساعدة العناصر، النماذج المدربة مسبقا، تطبيقات الوقت الحقيقي
|
||||
---
|
||||
|
||||
# Meituan YOLOv6
|
||||
|
||||
## نظرة عامة
|
||||
|
||||
[Meituan](https://about.meituan.com/) YOLOv6 هو منظّف الكائنات الحديثة الحديثة الذي يُقدم توازنًا ملحوظًا بين السرعة والدقة، مما يجعله خيارًا شائعًا لتطبيقات الوقت الحقيقي. يُقدم هذا النموذج العديد من التحسينات الملحوظة في بنيته ونظام التدريب، بما في ذلك تطبيق وحدة Bi-directional Concatenation (BiC)، واستراتيجية AAT (anchor-aided training) التي تعتمد على العناصر، وتصميم محسّن للأساس والرقبة لتحقيق أداء على مجموعة بيانات COCO يفوق جميع النماذج الأخرى.
|
||||
|
||||

|
||||

|
||||
**نظرة عامة على YOLOv6.** مخطط بنية النموذج يوضح المكونات المعاد تصميمها واستراتيجيات التدريب التي أدت إلى تحسينات أداء كبيرة. (أ) الرقبة الخاصة بـ YOLOv6 (N و S معروضان). لاحظ أنه بالنسبة لم/n، يتم استبدال RepBlocks بـ CSPStackRep. (ب) هيكل وحدة BiC. (ج) مكون SimCSPSPPF. ([المصدر](https://arxiv.org/pdf/2301.05586.pdf)).
|
||||
|
||||
### ميزات رئيسية
|
||||
|
||||
- **وحدة Bi-directional Concatenation (BiC):** يقدم YOLOv6 وحدة BiC في الرقبة التابعة للكاشف، مما يعزز إشارات التحديد المحلية ويؤدي إلى زيادة الأداء دون التأثير على السرعة.
|
||||
- **استراتيجية التدريب بمساعدة العناصر (AAT):** يقدم هذا النموذج استراتيجية AAT للاستفادة من فوائد النماذج المستندة إلى العناصر وغير المستندة إليها دون التضحية في كفاءة الاستدلال.
|
||||
- **تصميم أساس ورقبة محسّن:** من خلال تعميق YOLOv6 لتشمل مرحلة أخرى في الأساس والرقبة، يحقق هذا النموذج أداءً يفوق جميع النماذج الأخرى على مجموعة بيانات COCO لإدخال عالي الدقة.
|
||||
- **استراتيجية الاستنباط الذاتي:** يتم تنفيذ استراتيجية استنتاج ذاتي جديدة لتعزيز أداء النماذج الصغيرة من YOLOv6، وذلك عن طريق تعزيز فرع الانحدار المساعد خلال التدريب وإزالته في الاستنتاج لتجنب انخفاض السرعة الواضح.
|
||||
|
||||
## معايير الأداء
|
||||
|
||||
يوفر YOLOv6 مجموعة متنوعة من النماذج المدرّبة مسبقًا بمقاييس مختلفة:
|
||||
|
||||
- YOLOv6-N: ٣٧.٥٪ AP في COCO val2017 عندما يتم استخدام بطاقة NVIDIA Tesla T4 GPU وسرعة ١١٨٧ إطار في الثانية.
|
||||
- YOLOv6-S: ٤٥.٠٪ AP وسرعة ٤٨٤ إطار في الثانية.
|
||||
- YOLOv6-M: ٥٠.٠٪ AP وسرعة ٢٢٦ إطار في الثانية.
|
||||
- YOLOv6-L: ٥٢.٨٪ AP وسرعة ١١٦ إطار في الثانية.
|
||||
- YOLOv6-L6: دقة حديثة في الزمن الحقيقي.
|
||||
|
||||
كما يوفر YOLOv6 نماذج مؤنقة (quantized models) بدقات مختلفة ونماذج محسنة للمنصات المحمولة.
|
||||
|
||||
## أمثلة عن الاستخدام
|
||||
|
||||
يقدم هذا المثال أمثلة بسيطة لتدريب YOLOv6 واستنتاجه. للحصول على وثائق كاملة حول هذه وأوضاع أخرى [انظر](../modes/index.md) الى الصفحات التوضيحية لتوسعة الوثائق الفائقة ، [توقع](../modes/predict.md) ، [تدريب](../modes/train.md) ، [التحقق](../modes/val.md) و [التصدير](../modes/export.md).
|
||||
|
||||
!!! Example "مثال"
|
||||
|
||||
=== "Python"
|
||||
|
||||
يمكن تمرير النماذج المدرّبة مسبقًا بتنسيق `*.pt` في PyTorch وملفات التكوين `*.yaml` لفئة `YOLO()` لإنشاء نموذج في Python:
|
||||
|
||||
```python
|
||||
from ultralytics import YOLO
|
||||
|
||||
# إنشاء نموذج YOLOv6n من البداية
|
||||
model = YOLO('yolov6n.yaml')
|
||||
|
||||
# عرض معلومات النموذج (اختياري)
|
||||
model.info()
|
||||
|
||||
# تدريب النموذج على مجموعة بيانات مثال COCO8 لمدة 100 دورة تدريب
|
||||
results = model.train(data='coco8.yaml', epochs=100, imgsz=640)
|
||||
|
||||
# تشغيل الاستنتاج بنموذج YOLOv6n على صورة 'bus.jpg'
|
||||
results = model('path/to/bus.jpg')
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
|
||||
يمكن استخدام أوامر CLI لتشغيل النماذج مباشرةً:
|
||||
|
||||
```bash
|
||||
# إنشاء نموذج YOLOv6n من البداية وتدريبه باستخدام مجموعة بيانات مثال COCO8 لمدة 100 دورة تدريب
|
||||
yolo train model=yolov6n.yaml data=coco8.yaml epochs=100 imgsz=640
|
||||
|
||||
# إنشاء نموذج YOLOv6n من البداية وتشغيل الاستنتاج على صورة 'bus.jpg'
|
||||
yolo predict model=yolov6n.yaml source=path/to/bus.jpg
|
||||
```
|
||||
|
||||
## المهام والأوضاع المدعومة
|
||||
|
||||
تقدم سلسلة YOLOv6 مجموعة من النماذج، والتي تم تحسينها للكشف عن الكائنات عالي الأداء. تلبي هذه النماذج احتياجات الكمبيوتيشن المتنوعة ومتطلبات الدقة، مما يجعلها متعددة الاستخدامات في مجموعة واسعة من التطبيقات.
|
||||
|
||||
| نوع النموذج | الأوزان المدربة مسبقًا | المهام المدعومة | الاستنتاج | التحقق | التدريب | التصدير |
|
||||
|-------------|------------------------|-----------------------------------------|-----------|--------|---------|---------|
|
||||
| YOLOv6-N | `yolov6-n.pt` | [الكشف عن الكائنات](../tasks/detect.md) | ✅ | ✅ | ✅ | ✅ |
|
||||
| YOLOv6-S | `yolov6-s.pt` | [الكشف عن الكائنات](../tasks/detect.md) | ✅ | ✅ | ✅ | ✅ |
|
||||
| YOLOv6-M | `yolov6-m.pt` | [الكشف عن الكائنات](../tasks/detect.md) | ✅ | ✅ | ✅ | ✅ |
|
||||
| YOLOv6-L | `yolov6-l.pt` | [الكشف عن الكائنات](../tasks/detect.md) | ✅ | ✅ | ✅ | ✅ |
|
||||
| YOLOv6-L6 | `yolov6-l6.pt` | [الكشف عن الكائنات](../tasks/detect.md) | ✅ | ✅ | ✅ | ✅ |
|
||||
|
||||
توفر هذه الجدول نظرة عامة مفصلة على النماذج المختلفة لـ YOLOv6، مع تسليط الضوء على قدراتها في مهام الكشف عن الكائنات وتوافقها مع الأوضاع التشغيلية المختلفة مثل [الاستنتاج](../modes/predict.md) و [التحقق](../modes/val.md) و [التدريب](../modes/train.md) و [التصدير](../modes/export.md). هذا الدعم الشامل يضمن أن يمكن للمستخدمين الاستفادة الكاملة من قدرات نماذج YOLOv6 في مجموعة واسعة من سيناريوهات الكشف عن الكائنات.
|
||||
|
||||
## الاقتباسات والتقديرات
|
||||
|
||||
نحن نود أن نقدّم الشكر للمؤلفين على مساهماتهم الهامة في مجال كشف الكائنات في الوقت الحقيقي:
|
||||
|
||||
!!! Quote ""
|
||||
|
||||
=== "BibTeX"
|
||||
|
||||
```bibtex
|
||||
@misc{li2023yolov6,
|
||||
title={YOLOv6 v3.0: A Full-Scale Reloading},
|
||||
author={Chuyi Li and Lulu Li and Yifei Geng and Hongliang Jiang and Meng Cheng and Bo Zhang and Zaidan Ke and Xiaoming Xu and Xiangxiang Chu},
|
||||
year={2023},
|
||||
eprint={2301.05586},
|
||||
archivePrefix={arXiv},
|
||||
primaryClass={cs.CV}
|
||||
}
|
||||
```
|
||||
|
||||
يمكن العثور على الورقة الأصلية لـ YOLOv6 على [arXiv](https://arxiv.org/abs/2301.05586). نشر المؤلفون عملهم بشكل عام، ويمكن الوصول إلى الشيفرة المصدرية على [GitHub](https://github.com/meituan/YOLOv6). نحن نقدّر جهودهم في تطوير هذا المجال وجعل عملهم متاحًا للمجتمع بأسره.
|
2
ultralytics/docs/ar/models/yolov6.md:Zone.Identifier
Executable file
2
ultralytics/docs/ar/models/yolov6.md:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
66
ultralytics/docs/ar/models/yolov7.md
Executable file
66
ultralytics/docs/ar/models/yolov7.md
Executable file
@ -0,0 +1,66 @@
|
||||
---
|
||||
comments: true
|
||||
description: استكشف YOLOv7 ، جهاز كشف الكائنات في الوقت الحقيقي. تعرف على سرعته الفائقة، ودقته المذهلة، وتركيزه الفريد على تحسين الأمتعة التدريبية تدريبياً.
|
||||
keywords: YOLOv7، كاشف الكائنات في الوقت الحقيقي، الحالة الفنية، Ultralytics، مجموعة بيانات MS COCO، المعيار المعاد تعريفه للنموذج، التسمية الديناميكية، التحجيم الموسع، التحجيم المركب
|
||||
---
|
||||
|
||||
# YOLOv7: حقيبة مجانية قابلة للتدريب
|
||||
|
||||
YOLOv7 هو كاشف الكائنات في الوقت الحقيقي الحديث الحالي الذي يتفوق على جميع كاشفات الكائنات المعروفة من حيث السرعة والدقة في النطاق من 5 إطارات في الثانية إلى 160 إطارًا في الثانية. إنه يتمتع بأعلى دقة (٥٦.٨٪ AP) بين جميع كاشفات الكائنات الحالية في الوقت الحقيقي بسرعة ٣٠ إطارًا في الثانية أو أعلى على GPU V100. علاوة على ذلك, يتفوق YOLOv7 على كاشفات الكائنات الأخرى مثل YOLOR, YOLOX, Scaled-YOLOv4, YOLOv5 والعديد من الآخرين من حيث السرعة والدقة. النموذج مدرب على مجموعة بيانات MS COCO من البداية دون استخدام أي مجموعات بيانات أخرى أو وزن مُعين مُسبقًا. رمز المصدر لـ YOLOv7 متاح على GitHub.
|
||||
|
||||

|
||||
|
||||
**مقارنة بين كاشفات الكائنات الأعلى الفنية.** من النتائج في الجدول 2 نتعرف على أن الطريقة المقترحة لديها أفضل توازن بين السرعة والدقة بشكل شامل. إذا قارنا بين YOLOv7-tiny-SiLU و YOLOv5-N (r6.1) ، يكون الطريقة الحالية أسرع بـ ١٢٧ إطارًا في الثانية وأكثر دقة بنسبة ١٠.٧٪ من حيث AP. بالإضافة إلى ذلك ، YOLOv7 لديها AP بنسبة ٥١.٤٪ في معدل إطار ١٦١ في الثانية ، في حين يكون لـ PPYOLOE-L نفس AP فقط بمعدل إطار ٧٨ في الثانية. من حيث استخدام العوامل ، يكون YOLOv7 أقل بنسبة ٤١٪ من العوامل مقارنةً بـ PPYOLOE-L. إذا قارنا YOLOv7-X بسرعة تواصل بيانات ١١٤ إطارًا في الثانية مع YOLOv5-L (r6.1) مع سرعة تحليل ٩٩ إطارًا في الثانية ، يمكن أن يحسن YOLOv7-X AP بمقدار ٣.٩٪. إذا قورن YOLOv7-X بــ YOLOv5-X (r6.1) بنفس الحجم ، فإن سرعة تواصل البيانات في YOLOv7-X تكون أسرع بـ ٣١ إطارًا في الثانية. بالإضافة إلى ذلك ، من حيث كمية المعاملات والحسابات ، يقلل YOLOv7-X بنسبة ٢٢٪ من المعاملات و٨٪ من الحساب مقارنةً بـ YOLOv5-X (r6.1) ، ولكنه يحسن AP بنسبة ٢.٢٪ ([المصدر](https://arxiv.org/pdf/2207.02696.pdf)).
|
||||
|
||||
## النظرة العامة
|
||||
|
||||
كاشف الكائنات في الوقت الحقيقي هو جزء مهم في العديد من أنظمة رؤية الحاسوب ، بما في ذلك التتبع متعدد الكائنات والقيادة التلقائية والروبوتات وتحليل صور الأعضاء. في السنوات الأخيرة ، تركز تطوير كاشفات الكائنات في الوقت الحقيقي على تصميم هياكل فعالة وتحسين سرعة التحليل لمعالجات الكمبيوتر المركزية ومعالجات الرسومات ووحدات معالجة الأعصاب (NPUs). يدعم YOLOv7 كلاً من GPU المحمول وأجهزة الـ GPU ، من الحواف إلى السحابة.
|
||||
|
||||
على عكس كاشفات الكائنات في الوقت الحقيقي التقليدية التي تركز على تحسين الهياكل ، يُقدم YOLOv7 تركيزًا على تحسين عملية التدريب. يتضمن ذلك وحدات وطرق تحسين تُصمم لتحسين دقة كشف الكائنات دون زيادة تكلفة التحليل ، وهو مفهوم يُعرف بـ "الحقيبة القابلة للتدريب للمجانيات".
|
||||
|
||||
## الميزات الرئيسية
|
||||
|
||||
تُقدم YOLOv7 عدة ميزات رئيسية:
|
||||
|
||||
1. **إعادة تعيين نموذج المعاملات**: يقترح YOLOv7 نموذج معاملات معين مخطط له ، وهو استراتيجية قابلة للتطبيق على الطبقات في شبكات مختلفة باستخدام مفهوم مسار انتشار التدرج.
|
||||
|
||||
2. **التسمية الديناميكية**: تدريب النموذج مع عدة طبقات إخراج يبرز قضية جديدة: "كيفية تعيين أهداف ديناميكية لإخراج الفروع المختلفة؟" لحل هذه المشكلة ، يقدم YOLOv7 طريقة تسمية جديدة تسمى تسمية الهدف المرشدة من الخشن إلى الدقيقة.
|
||||
|
||||
3. **التحجيم الموسع والمركب**: يقترح YOLOv7 طرق "التحجيم الموسع" و "التحجيم المركب" لكاشف الكائنات في الوقت الحقيقي التي يمكن أن تستخدم بشكل فعال في المعاملات والحسابات.
|
||||
|
||||
4. **الكفاءة**: يمكن للطريقة المقترحة بواسطة YOLOv7 تقليل بشكل فعال حوالي 40٪ من المعاملات و 50٪ من الحساب لكاشف الكائنات في الوقت الحقيقي الأولى من حيث الدقة والسرعة في التحليل.
|
||||
|
||||
## أمثلة على الاستخدام
|
||||
|
||||
في وقت كتابة هذا النص ، لا تدعم Ultralytics حاليًا نماذج YOLOv7. لذلك ، سيحتاج أي مستخدمين مهتمين باستخدام YOLOv7 إلى الرجوع مباشرة إلى مستودع YOLOv7 على GitHub للحصول على تعليمات التثبيت والاستخدام.
|
||||
|
||||
وفيما يلي نظرة عامة على الخطوات النموذجية التي يمكنك اتباعها لاستخدام YOLOv7:
|
||||
|
||||
1. قم بزيارة مستودع YOLOv7 على GitHub: [https://github.com/WongKinYiu/yolov7](https://github.com/WongKinYiu/yolov7).
|
||||
|
||||
2. اتبع التعليمات الموجودة في ملف README لعملية التثبيت. يتضمن ذلك عادةً استنساخ المستودع ، وتثبيت التبعيات اللازمة ، وإعداد أي متغيرات بيئة ضرورية.
|
||||
|
||||
3. بمجرد الانتهاء من عملية التثبيت ، يمكنك تدريب النموذج واستخدامه وفقًا لتعليمات الاستخدام الموجودة في المستودع. ينطوي ذلك عادةً على إعداد مجموعة البيانات الخاصة بك ، وتكوين معلمات النموذج ، وتدريب النموذج ، ثم استخدام النموذج المدرب لأداء كشف الكائنات.
|
||||
|
||||
يرجى ملاحظة أن الخطوات المحددة قد تختلف اعتمادًا على حالة الاستخدام الخاصة بك والحالة الحالية لمستودع YOLOv7. لذا ، يُوصى بشدة بالرجوع مباشرة إلى التعليمات المقدمة في مستودع YOLOv7 على GitHub.
|
||||
|
||||
نأسف على أي إزعاج قد يسببه ذلك وسنسعى لتحديث هذا المستند بأمثلة على الاستخدام لـ Ultralytics عندما يتم تنفيذ الدعم لـ YOLOv7.
|
||||
|
||||
## الاقتباسات والشكر
|
||||
|
||||
نود أن نشكر كتاب YOLOv7 على مساهماتهم الهامة في مجال اكتشاف الكائنات في الوقت الحقيقي:
|
||||
|
||||
!!! Quote ""
|
||||
|
||||
=== "BibTeX"
|
||||
|
||||
```bibtex
|
||||
@article{wang2022yolov7,
|
||||
title={{YOLOv7}: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors},
|
||||
author={Wang, Chien-Yao and Bochkovskiy, Alexey and Liao, Hong-Yuan Mark},
|
||||
journal={arXiv preprint arXiv:2207.02696},
|
||||
year={2022}
|
||||
}
|
||||
```
|
||||
|
||||
يمكن العثور على ورقة YOLOv7 الأصلية على [arXiv](https://arxiv.org/pdf/2207.02696.pdf). قدم الكتاب عملهم علنياً، ويمكن الوصول إلى قاعدة الشيفرة على [GitHub](https://github.com/WongKinYiu/yolov7). نحن نقدر جهودهم في تقدم المجال وتوفير عملهم للمجتمع بشكل عام.
|
2
ultralytics/docs/ar/models/yolov7.md:Zone.Identifier
Executable file
2
ultralytics/docs/ar/models/yolov7.md:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
166
ultralytics/docs/ar/models/yolov8.md
Executable file
166
ultralytics/docs/ar/models/yolov8.md
Executable file
@ -0,0 +1,166 @@
|
||||
---
|
||||
comments: true
|
||||
description: استكشف الميزات المثيرة لـ YOLOv8 ، أحدث إصدار من مكتشف الكائنات الحية الخاص بنا في الوقت الحقيقي! تعرّف على العمارات المتقدمة والنماذج المدرّبة مسبقًا والتوازن المثلى بين الدقة والسرعة التي تجعل YOLOv8 الخيار المثالي لمهام الكشف عن الكائنات الخاصة بك.
|
||||
keywords: YOLOv8, Ultralytics, مكتشف الكائنات الحية الخاص بنا في الوقت الحقيقي, النماذج المدرّبة مسبقًا, وثائق, الكشف عن الكائنات, سلسلة YOLO, العمارات المتقدمة, الدقة, السرعة
|
||||
---
|
||||
|
||||
# YOLOv8
|
||||
|
||||
## نظرة عامة
|
||||
|
||||
YOLOv8 هو التطور الأخير في سلسلة YOLO لمكتشفات الكائنات الحية الخاصة بنا في الوقت الحقيقي ، والذي يقدم أداءً متقدمًا في مجال الدقة والسرعة. بناءً على التقدمات التي تم إحرازها في إصدارات YOLO السابقة ، يقدم YOLOv8 ميزات وتحسينات جديدة تجعله الخيار المثالي لمهام الكشف عن الكائنات في مجموعة واسعة من التطبيقات.
|
||||
|
||||

|
||||
|
||||
## الميزات الرئيسية
|
||||
|
||||
- **العمارات المتقدمة للظهر والعنق:** يعتمد YOLOv8 على عمارات الظهر والعنق على أحدث طراز ، مما يؤدي إلى تحسين استخراج الميزات وأداء الكشف عن الكائنات.
|
||||
- **Ultralytics Head بدون إثبات خطافي:** يعتمد YOLOv8 على Ultralytics Head بدون إثبات خطافي ، مما يسهم في زيادة الدقة وتوفير وقت مكشف أكثر كفاءة مقارنةً بالطرق التي تعتمد على الإثبات.
|
||||
- **توازن مثالي بين الدقة والسرعة محسَّن:** بتركيزه على الحفاظ على توازن مثالي بين الدقة والسرعة ، فإن YOLOv8 مناسب لمهام الكشف عن الكائنات في الوقت الحقيقي في مجموعة متنوعة من المجالات التطبيقية.
|
||||
- **تشكيلة من النماذج المدرّبة مسبقًا:** يقدم YOLOv8 مجموعة من النماذج المدرّبة مسبقًا لتلبية متطلبات المهام المختلفة ومتطلبات الأداء ، مما يجعل من السهل إيجاد النموذج المناسب لحالتك الاستخدامية الخاصة.
|
||||
|
||||
## المهام والأوضاع المدعومة
|
||||
|
||||
تقدم سلسلة YOLOv8 مجموعة متنوعة من النماذج ، يتم تخصيص كلًا منها للمهام المحددة في رؤية الحاسوب. تم تصميم هذه النماذج لتلبية متطلبات مختلفة ، بدءًا من الكشف عن الكائنات إلى مهام أكثر تعقيدًا مثل تقسيم الصور إلى أجزاء واكتشاف نقاط المفاتيح والتصنيف.
|
||||
|
||||
تمت تحسين كل نوع من سلسلة YOLOv8 للمهام التي تخصها ، مما يضمن أداء ودقة عاليين. بالإضافة إلى ذلك ، تتوافق هذه النماذج مع أوضاع تشغيل مختلفة بما في ذلك [الاستدلال](../modes/predict.md) ، [التحقق](../modes/val.md) ، [التدريب](../modes/train.md) و [التصدير](../modes/export.md) ، مما يسهل استخدامها في مراحل مختلفة من عملية التطوير والتنفيذ.
|
||||
|
||||
| النموذج | أسماء الملف | المهمة | استدلال | التحقق | التدريب | التصدير |
|
||||
|-------------|----------------------------------------------------------------------------------------------------------------|----------------------------------------------|---------|--------|---------|---------|
|
||||
| YOLOv8 | `yolov8n.pt` `yolov8s.pt` `yolov8m.pt` `yolov8l.pt` `yolov8x.pt` | [الكشف](../tasks/detect.md) | ✅ | ✅ | ✅ | ✅ |
|
||||
| YOLOv8-seg | `yolov8n-seg.pt` `yolov8s-seg.pt` `yolov8m-seg.pt` `yolov8l-seg.pt` `yolov8x-seg.pt` | [تقسيم الصور إلى أجزاء](../tasks/segment.md) | ✅ | ✅ | ✅ | ✅ |
|
||||
| YOLOv8-pose | `yolov8n-pose.pt` `yolov8s-pose.pt` `yolov8m-pose.pt` `yolov8l-pose.pt` `yolov8x-pose.pt` `yolov8x-pose-p6.pt` | [المواقق/نقاط المفاتيح](../tasks/pose.md) | ✅ | ✅ | ✅ | ✅ |
|
||||
| YOLOv8-cls | `yolov8n-cls.pt` `yolov8s-cls.pt` `yolov8m-cls.pt` `yolov8l-cls.pt` `yolov8x-cls.pt` | [التصنيف](../tasks/classify.md) | ✅ | ✅ | ✅ | ✅ |
|
||||
|
||||
توفر هذه الجدولة نظرة عامة على متغيرات نموذج YOLOv8 ، مما يسلط الضوء على قابليتها للتطبيق في مهام محددة وتوافقها مع أوضاع تشغيل مختلفة مثل الاستدلال والتحقق والتدريب والتصدير. يعرض مرونة وقوة سلسلة YOLOv8 ، مما يجعلها مناسبة لمجموعة متنوعة من التطبيقات في رؤية الحاسوب.
|
||||
|
||||
## مقاييس الأداء
|
||||
|
||||
!!! الأداء
|
||||
|
||||
=== "الكشف (COCO)"
|
||||
|
||||
انظر إلى [وثائق الكشف](https://docs.ultralytics.com/tasks/detect/) لأمثلة عن الاستخدام مع هذه النماذج المدربة مسبقًا على [COCO](https://docs.ultralytics.com/datasets/detect/coco/) ، التي تضم 80 فئة مدربة مسبقًا.
|
||||
|
||||
| النموذج | حجم<br><sup>(بيكسل) | معدل الكشف<sup>التحقق<br>50-95 | سرعة<br><sup>CPU ONNX<br>(متوسط) | سرعة<br><sup>A100 TensorRT<br>(متوسط) | معلمات<br><sup>(مليون) | FLOPs<br><sup>(مليون) |
|
||||
| ------------------------------------------------------------------------------------ | --------------------- | -------------------- | ------------------------------ | ----------------------------------- | ------------------ | ----------------- |
|
||||
| [YOLOv8n](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n.pt) | 640 | 37.3 | 80.4 | 0.99 | 3.2 | 8.7 |
|
||||
| [YOLOv8s](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8s.pt) | 640 | 44.9 | 128.4 | 1.20 | 11.2 | 28.6 |
|
||||
| [YOLOv8m](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8m.pt) | 640 | 50.2 | 234.7 | 1.83 | 25.9 | 78.9 |
|
||||
| [YOLOv8l](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8l.pt) | 640 | 52.9 | 375.2 | 2.39 | 43.7 | 165.2 |
|
||||
| [YOLOv8x](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8x.pt) | 640 | 53.9 | 479.1 | 3.53 | 68.2 | 257.8 |
|
||||
|
||||
=== "الكشف (صور مفتوحة V7)"
|
||||
|
||||
انظر إلى [وثائق الكشف](https://docs.ultralytics.com/tasks/detect/) لأمثلة عن الاستخدام مع هذه النماذج المدربة مسبقًا على [Open Image V7](https://docs.ultralytics.com/datasets/detect/open-images-v7/)، والتي تضم 600 فئة مدربة مسبقًا.
|
||||
|
||||
| النموذج | حجم<br><sup>(بيكسل) | معدل الكشف<sup>التحقق<br>50-95 | سرعة<br><sup>CPU ONNX<br>(متوسط) | سرعة<br><sup>A100 TensorRT<br>(متوسط) | معلمات<br><sup>(مليون) | FLOPs<br><sup>(مليون) |
|
||||
| ----------------------------------------------------------------------------------------- | --------------------- | -------------------- | ------------------------------ | ----------------------------------- | ------------------ | ----------------- |
|
||||
| [YOLOv8n](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n-oiv7.pt) | 640 | 18.4 | 142.4 | 1.21 | 3.5 | 10.5 |
|
||||
| [YOLOv8s](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8s-oiv7.pt) | 640 | 27.7 | 183.1 | 1.40 | 11.4 | 29.7 |
|
||||
| [YOLOv8m](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8m-oiv7.pt) | 640 | 33.6 | 408.5 | 2.26 | 26.2 | 80.6 |
|
||||
| [YOLOv8l](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8l-oiv7.pt) | 640 | 34.9 | 596.9 | 2.43 | 44.1 | 167.4 |
|
||||
| [YOLOv8x](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8x-oiv7.pt) | 640 | 36.3 | 860.6 | 3.56 | 68.7 | 260.6 |
|
||||
|
||||
=== "تقسيم الصور إلى أجزاء (COCO)"
|
||||
|
||||
انظر إلى [وثائق التقسيم](https://docs.ultralytics.com/tasks/segment/) لأمثلة عن الاستخدام مع هذه النماذج المدرّبة مسبقًا على [COCO](https://docs.ultralytics.com/datasets/segment/coco/)، والتي تضم 80 فئة مدربة مسبقًا.
|
||||
|
||||
| النموذج | حجم<br><sup>(بيكسل) | معدل التقسيم<sup>التحقق<br>50-95 | معدل التقسيم<sup>الأقنعة<br>50-95 | سرعة<br><sup>CPU ONNX<br>(متوسط) | سرعة<br><sup>A100 TensorRT<br>(متوسط) | معلمات<br><sup>(مليون) | FLOPs<br><sup>(مليون) |
|
||||
| -------------------------------------------------------------------------------------------- | --------------------- | -------------------- | -------------------- | ------------------------------ | ----------------------------------- | ------------------ | ----------------- |
|
||||
| [YOLOv8n-seg](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n-seg.pt) | 640 | 36.7 | 30.5 | 96.1 | 1.21 | 3.4 | 12.6 |
|
||||
| [YOLOv8s-seg](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8s-seg.pt) | 640 | 44.6 | 36.8 | 155.7 | 1.47 | 11.8 | 42.6 |
|
||||
| [YOLOv8m-seg](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8m-seg.pt) | 640 | 49.9 | 40.8 | 317.0 | 2.18 | 27.3 | 110.2 |
|
||||
| [YOLOv8l-seg](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8l-seg.pt) | 640 | 52.3 | 42.6 | 572.4 | 2.79 | 46.0 | 220.5 |
|
||||
| [YOLOv8x-seg](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8x-seg.pt) | 640 | 53.4 | 43.4 | 712.1 | 4.02 | 71.8 | 344.1 |
|
||||
|
||||
=== "التصنيف (ImageNet)"
|
||||
|
||||
انظر إلى [وثائق التصنيف](https://docs.ultralytics.com/tasks/classify/) لأمثلة عن الاستخدام مع هذه النماذج المدرّبة مسبقًا على [ImageNet](https://docs.ultralytics.com/datasets/classify/imagenet/)، والتي تضم 1000 فئة مدربة مسبقًا.
|
||||
|
||||
| النموذج | حجم<br><sup>(بيكسل) | دقة أعلى<br><sup>أعلى 1 | دقة أعلى<br><sup>أعلى 5 | سرعة<br><sup>CPU ONNX<br>(متوسط) | سرعة<br><sup>A100 TensorRT<br>(متوسط) | معلمات<br><sup>(مليون) | FLOPs<br><sup>(مليون) عند 640 |
|
||||
| -------------------------------------------------------------------------------------------- | --------------------- | ---------------- | ---------------- | ------------------------------ | ----------------------------------- | ------------------ | ------------------------ |
|
||||
| [YOLOv8n-cls](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n-cls.pt) | 224 | 66.6 | 87.0 | 12.9 | 0.31 | 2.7 | 4.3 |
|
||||
| [YOLOv8s-cls](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8s-cls.pt) | 224 | 72.3 | 91.1 | 23.4 | 0.35 | 6.4 | 13.5 |
|
||||
| [YOLOv8m-cls](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8m-cls.pt) | 224 | 76.4 | 93.2 | 85.4 | 0.62 | 17.0 | 42.7 |
|
||||
| [YOLOv8l-cls](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8l-cls.pt) | 224 | 78.0 | 94.1 | 163.0 | 0.87 | 37.5 | 99.7 |
|
||||
| [YOLOv8x-cls](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8x-cls.pt) | 224 | 78.4 | 94.3 | 232.0 | 1.01 | 57.4 | 154.8 |
|
||||
|
||||
=== "المواقف (COCO)"
|
||||
|
||||
انظر إلى [وثائق تقدير المواقع] (https://docs.ultralytics.com/tasks/pose/) لأمثلة على الاستخدام مع هذه النماذج المدربة مسبقًا على [COCO](https://docs.ultralytics.com/datasets/pose/coco/)، والتي تتضمن فئة واحدة مدربة مسبقًا ، 'شخص'.
|
||||
|
||||
| النموذج | حجم<br><sup>(بيكسل) | معدل التوضيح<sup>التحقق<br>50-95 | معدل التوضيح<sup>50 | سرعة<br><sup>CPU ONNX<br>(متوسط) | سرعة<br><sup>A100 TensorRT<br>(متوسط) | معلمات<br><sup>(مليون) | FLOPs<br><sup>(مليون) |
|
||||
| ---------------------------------------------------------------------------------------------------- | --------------------- | --------------------- | ------------------ | ------------------------------ | ----------------------------------- | ------------------ | ----------------- |
|
||||
| [YOLOv8n-pose](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n-pose.pt) | 640 | 50.4 | 80.1 | 131.8 | 1.18 | 3.3 | 9.2 |
|
||||
| [YOLOv8s-pose](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8s-pose.pt) | 640 | 60.0 | 86.2 | 233.2 | 1.42 | 11.6 | 30.2 |
|
||||
| [YOLOv8m-pose](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8m-pose.pt) | 640 | 65.0 | 88.8 | 456.3 | 2.00 | 26.4 | 81.0 |
|
||||
| [YOLOv8l-pose](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8l-pose.pt) | 640 | 67.6 | 90.0 | 784.5 | 2.59 | 44.4 | 168.6 |
|
||||
| [YOLOv8x-pose](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8x-pose.pt) | 640 | 69.2 | 90.2 | 1607.1 | 3.73 | 69.4 | 263.2 |
|
||||
| [YOLOv8x-pose-p6](https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8x-pose-p6.pt) | 1280 | 71.6 | 91.2 | 4088.7 | 10.04 | 99.1 | 1066.4 |
|
||||
|
||||
## أمثلة استخدام
|
||||
|
||||
يوفر هذا المثال أمثلة بسيطة للتدريب والتنبؤ باستخدام YOLOv8. للحصول على وثائق كاملة حول هذه وغيرها من [الأوضاع](../modes/index.md) ، انظر إلى صفحات وثائق [تنبؤ](../modes/predict.md) ، [تدريب](../modes/train.md) ، [التحقق](../modes/val.md) و [التصدير](../modes/export.md) .
|
||||
|
||||
يرجى ملاحظة أن المثال أدناه يتعلق بطراز YOLOv8 [Detect](../tasks/detect.md) للكشف عن الكائنات. لمهام مدعومة إضافية ، انظر إلى وثائق [تقسيم](../tasks/segment.md) ، [تحديد إنتماء](../tasks/classify.md) و [تصوير (Pose)](../tasks/pose.md) .
|
||||
|
||||
!!!
|
||||
|
||||
!!! Example "مثال"
|
||||
|
||||
=== "Python"
|
||||
|
||||
يمكن تمرير نماذج الـ PyTorch المُدرّبة المُحفوظة بالامتداد `*.pt` بالإضافة إلى ملفات التكوين بامتداد `*.yaml` إلى فئة `YOLO()` لإنشاء نموذج في لغة بايثون:
|
||||
|
||||
```python
|
||||
from ultralytics import YOLO
|
||||
|
||||
# تحميل نموذج YOLOv8n المدرّب مسبقًا على COCO
|
||||
model = YOLO('yolov8n.pt')
|
||||
|
||||
# عرض معلومات النموذج (اختياري)
|
||||
model.info()
|
||||
|
||||
# تدريب النموذج على مجموعة بيانات المُدخلات coco8 على سبيل المثال لمدة 100 دورة
|
||||
results = model.train(data='coco8.yaml', epochs=100, imgsz=640)
|
||||
|
||||
# تشغيل التنبؤ باستخدام نموذج YOLOv8n على صورة 'bus.jpg'
|
||||
results = model('path/to/bus.jpg')
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
|
||||
تتوفر أوامر CLI لتشغيل النماذج مباشرة:
|
||||
|
||||
```bash
|
||||
# تحميل نموذج YOLOv8n المدرّب مسبقًا على COCO واختباره على مجموعة بيانات coco8
|
||||
yolo train model=yolov8n.pt data=coco8.yaml epochs=100 imgsz=640
|
||||
|
||||
# تحميل نموذج YOLOv8n المدرّب مسبقًا على COCO والتنبؤ به على صورة 'bus.jpg'
|
||||
yolo predict model=yolov8n.pt source=path/to/bus.jpg
|
||||
```
|
||||
|
||||
## الاقتباسات والتقديرات
|
||||
|
||||
إذا استخدمت نموذج YOLOv8 أو أي برنامج آخر من هذا المستودع في عملك ، فيرجى استشهاده باستخدام التنسيق التالي:
|
||||
|
||||
!!!،
|
||||
|
||||
!!! quote ""
|
||||
|
||||
=== "BibTeX"
|
||||
|
||||
```bibtex
|
||||
@software{yolov8_ultralytics,
|
||||
author = {Glenn Jocher and Ayush Chaurasia and Jing Qiu},
|
||||
title = {Ultralytics YOLOv8},
|
||||
version = {8.0.0},
|
||||
year = {2023},
|
||||
url = {https://github.com/ultralytics/ultralytics},
|
||||
orcid = {0000-0001-5950-6979, 0000-0002-7603-6750, 0000-0003-3783-7069},
|
||||
license = {AGPL-3.0}
|
||||
}
|
||||
```
|
||||
|
||||
يرجى ملاحظة أن وجود معرف الكائن الرقمي (DOI) قيد الانتظار وسيتم إضافته إلى الاقتباس بمجرد توفره. تُقدم نماذج YOLOv8 بموجب [رخصة AGPL-3.0](https://github.com/ultralytics/ultralytics/blob/main/LICENSE) و [الرخصة المؤسسية](https://ultralytics.com/license).
|
2
ultralytics/docs/ar/models/yolov8.md:Zone.Identifier
Executable file
2
ultralytics/docs/ar/models/yolov8.md:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
94
ultralytics/docs/ar/modes/benchmark.md
Executable file
94
ultralytics/docs/ar/modes/benchmark.md
Executable file
@ -0,0 +1,94 @@
|
||||
---
|
||||
comments: true
|
||||
description: تعرف على كيفية قياس سرعة ودقة YOLOv8 عبر تنسيقات التصدير المختلفة. احصل على رؤى حول مقاييس mAP50-95 وaccuracy_top5 والمزيد.
|
||||
keywords: Ultralytics، YOLOv8، اختبار الأداء، قياس السرعة، قياس الدقة، مقاييس mAP50-95 وaccuracy_top5، ONNX، OpenVINO، TensorRT، تنسيقات تصدير YOLO
|
||||
---
|
||||
|
||||
# اختبار النموذج باستخدام Ultralytics YOLO
|
||||
|
||||
<img width="1024" src="https://github.com/ultralytics/assets/raw/main/yolov8/banner-integrations.png" alt="Ultralytics YOLO ecosystem and integrations">
|
||||
|
||||
## المقدمة
|
||||
|
||||
بمجرد أن يتم تدريب نموذجك وتحقق صحته ، فإن الخطوة التالية بشكل منطقي هي تقييم أدائه في سيناريوهات العالم الحقيقي المختلفة. يوفر وضع الاختبار في Ultralytics YOLOv8 هذا الهدف من خلال توفير إطار قوي لتقييم سرعة ودقة النموذج عبر مجموعة من صيغ التصدير.
|
||||
|
||||
## لماذا هو اختبار الأداء مهم؟
|
||||
|
||||
- **قرارات مستنيرة:** اكتساب رؤى حول التنازلات بين السرعة والدقة.
|
||||
- **تخصيص الموارد:** فهم كيفية أداء تنسيقات التصدير المختلفة على أجهزة مختلفة.
|
||||
- **تحسين:** تعلم أي تنسيق تصدير يقدم أفضل أداء لحالتك الاستخدامية المحددة.
|
||||
- **كفاءة التكلفة:** استخدام الموارد الأجهزة بشكل أكثر كفاءة بناءً على نتائج الاختبار.
|
||||
|
||||
### المقاييس الرئيسية في وضع الاختبار
|
||||
|
||||
- **mAP50-95:** لكشف الكائنات وتقسيمها وتحديد الوضع.
|
||||
- **accuracy_top5:** لتصنيف الصور.
|
||||
- **وقت التتبع:** الوقت المستغرق لكل صورة بالميلي ثانية.
|
||||
|
||||
### تنسيقات التصدير المدعومة
|
||||
|
||||
- **ONNX:** لأفضل أداء على وحدة المعالجة المركزية.
|
||||
- **TensorRT:** لأقصى استفادة من وحدة المعالجة الرسومية.
|
||||
- **OpenVINO:** لتحسين الأجهزة من إنتل.
|
||||
- **CoreML و TensorFlow SavedModel وما إلى ذلك:** لتلبية احتياجات النشر المتنوعة.
|
||||
|
||||
!!! Tip "نصيحة"
|
||||
|
||||
* قم بتصدير إلى نموذج ONNX أو OpenVINO لزيادة سرعة وحدة المعالجة المركزية بمقدار 3 مرات.
|
||||
* قم بتصدير إلى نموذج TensorRT لزيادة سرعة وحدة المعالجة الرسومية بمقدار 5 مرات.
|
||||
|
||||
## أمثلة على الاستخدام
|
||||
|
||||
قم بتشغيل اختبارات YOLOv8n على جميع تنسيقات التصدير المدعومة بما في ذلك ONNX و TensorRT وما إلى ذلك. انظر القسم الموجود أدناه للحصول على قائمة كاملة من وسيطات التصدير.
|
||||
|
||||
!!! Example "مثال"
|
||||
|
||||
=== "Python"
|
||||
|
||||
```python
|
||||
from ultralytics.utils.benchmarks import benchmark
|
||||
|
||||
# اختبار على وحدة المعالجة الرسومية
|
||||
benchmark(model='yolov8n.pt', data='coco8.yaml', imgsz=640, half=False, device=0)
|
||||
```
|
||||
=== "CLI"
|
||||
|
||||
```bash
|
||||
yolo benchmark model=yolov8n.pt data='coco8.yaml' imgsz=640 half=False device=0
|
||||
```
|
||||
|
||||
## وسيطات
|
||||
|
||||
توفر الوسائط مثل `model` و `data` و `imgsz` و `half` و `device` و `verbose` مرونة للمستخدمين لضبط الاختبارات حسب احتياجاتهم المحددة ومقارنة أداء تنسيقات التصدير المختلفة بسهولة.
|
||||
|
||||
| المفتاح | القيمة | الوصف |
|
||||
|-----------|---------|---------------------------------------------------------------------------------------------------|
|
||||
| `model` | `None` | مسار إلى ملف النموذج ، على سبيل المثال yolov8n.pt ، yolov8n.yaml |
|
||||
| `data` | `None` | مسار إلى YAML يشير إلى مجموعة بيانات اختبار الأداء (بتحتوى على بيانات `val`) |
|
||||
| `imgsz` | `640` | حجم الصورة كرقم ، أو قائمة (h ، w) ، على سبيل المثال (640، 480) |
|
||||
| `half` | `False` | تقليل دقة العدد العشرى للأبعاد (FP16 quantization) |
|
||||
| `int8` | `False` | تقليل دقة العدد الصحيح 8 بت (INT8 quantization) |
|
||||
| `device` | `None` | الجهاز الذى ستعمل عليه العملية ، على سبيل المثال cuda device=0 أو device=0,1,2,3 أو device=cpu |
|
||||
| `verbose` | `False` | عدم المتابعة عند حدوث خطأ (مقدار منطقى)، أو مستوى الكشف عند تجاوز حد القيمة المطلوبة (قيمة عائمة) |
|
||||
|
||||
## صيغ التصدير
|
||||
|
||||
سيحاول التطبيق تشغيل الاختبارات تلقائيًا على جميع صيغ التصدير الممكنة الموجودة أدناه.
|
||||
|
||||
| Format | `format` Argument | Model | Metadata | Arguments |
|
||||
|--------------------------------------------------------------------|-------------------|---------------------------|----------|-----------------------------------------------------|
|
||||
| [PyTorch](https://pytorch.org/) | - | `yolov8n.pt` | ✅ | - |
|
||||
| [TorchScript](https://pytorch.org/docs/stable/jit.html) | `torchscript` | `yolov8n.torchscript` | ✅ | `imgsz`, `optimize` |
|
||||
| [ONNX](https://onnx.ai/) | `onnx` | `yolov8n.onnx` | ✅ | `imgsz`, `half`, `dynamic`, `simplify`, `opset` |
|
||||
| [OpenVINO](https://docs.openvino.ai/latest/index.html) | `openvino` | `yolov8n_openvino_model/` | ✅ | `imgsz`, `half`, `int8` |
|
||||
| [TensorRT](https://developer.nvidia.com/tensorrt) | `engine` | `yolov8n.engine` | ✅ | `imgsz`, `half`, `dynamic`, `simplify`, `workspace` |
|
||||
| [CoreML](https://github.com/apple/coremltools) | `coreml` | `yolov8n.mlpackage` | ✅ | `imgsz`, `half`, `int8`, `nms` |
|
||||
| [TF SavedModel](https://www.tensorflow.org/guide/saved_model) | `saved_model` | `yolov8n_saved_model/` | ✅ | `imgsz`, `keras`, `int8` |
|
||||
| [TF GraphDef](https://www.tensorflow.org/api_docs/python/tf/Graph) | `pb` | `yolov8n.pb` | ❌ | `imgsz` |
|
||||
| [TF Lite](https://www.tensorflow.org/lite) | `tflite` | `yolov8n.tflite` | ✅ | `imgsz`, `half`, `int8` |
|
||||
| [TF Edge TPU](https://coral.ai/docs/edgetpu/models-intro/) | `edgetpu` | `yolov8n_edgetpu.tflite` | ✅ | `imgsz` |
|
||||
| [TF.js](https://www.tensorflow.org/js) | `tfjs` | `yolov8n_web_model/` | ✅ | `imgsz` |
|
||||
| [PaddlePaddle](https://github.com/PaddlePaddle) | `paddle` | `yolov8n_paddle_model/` | ✅ | `imgsz` |
|
||||
| [ncnn](https://github.com/Tencent/ncnn) | `ncnn` | `yolov8n_ncnn_model/` | ✅ | `imgsz`, `half` |
|
||||
|
||||
انظر تفاصيل التصدير الكاملة في الصفحة [Export](https://docs.ultralytics.com/modes/export/)
|
2
ultralytics/docs/ar/modes/benchmark.md:Zone.Identifier
Executable file
2
ultralytics/docs/ar/modes/benchmark.md:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
108
ultralytics/docs/ar/modes/export.md
Executable file
108
ultralytics/docs/ar/modes/export.md
Executable file
@ -0,0 +1,108 @@
|
||||
---
|
||||
comments: true
|
||||
description: دليل خطوة بخطوة حول تصدير نماذج YOLOv8 الخاصة بك إلى تنسيقات مختلفة مثل ONNX و TensorRT و CoreML وغيرها للنشر. استكشف الآن!.
|
||||
keywords: YOLO، YOLOv8، Ultralytics، تصدير النموذج، ONNX، TensorRT، CoreML، TensorFlow SavedModel، OpenVINO، PyTorch، تصدير النموذج
|
||||
---
|
||||
|
||||
# تصدير النموذج باستخدام يولو من Ultralytics
|
||||
|
||||
<img width="1024" src="https://github.com/ultralytics/assets/raw/main/yolov8/banner-integrations.png" alt="إكوسيستم يولو من Ultralytics والتكاملات">
|
||||
|
||||
## مقدمة
|
||||
|
||||
الهدف النهائي لتدريب نموذج هو نشره لتطبيقات العالم الحقيقي. يوفر وضع التصدير في يولو من Ultralytics مجموعة متنوعة من الخيارات لتصدير النموذج المدرب إلى تنسيقات مختلفة، مما يجعله يمكن استخدامه في مختلف الأنظمة والأجهزة. يهدف هذا الدليل الشامل إلى مساعدتك في فهم تفاصيل تصدير النموذج، ويعرض كيفية تحقيق أقصى توافق وأداء.
|
||||
|
||||
<p align="center">
|
||||
<br>
|
||||
<iframe width="720" height="405" src="https://www.youtube.com/embed/WbomGeoOT_k?si=aGmuyooWftA0ue9X"
|
||||
title="مشغل فيديو YouTube" frameborder="0"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||
allowfullscreen>
|
||||
</iframe>
|
||||
<br>
|
||||
<strong>شاهد:</strong> كيفية تصدير نموذج Ultralytics YOLOv8 التدريب المخصص وتشغيل الاستدلال المباشر على كاميرا الويب.
|
||||
</p>
|
||||
|
||||
## لماذا اختيار وضع تصدير YOLOv8؟
|
||||
|
||||
- **التنوع:** تصدير إلى تنسيقات متعددة بما في ذلك ONNX و TensorRT و CoreML ، وغيرها.
|
||||
- **الأداء:** الحصول على سرعة تسريع تصل إلى 5 أضعاف باستخدام TensorRT وسرعة تسريع معالج الكمبيوتر المركزي بنسبة 3 أضعاف باستخدام ONNX أو OpenVINO.
|
||||
- **التوافقية:** جعل النموذج قابلاً للنشر على الأجهزة والبرامج المختلفة.
|
||||
- **سهولة الاستخدام:** واجهة سطر الأوامر البسيطة وواجهة برمجة Python لتصدير النموذج بسرعة وسهولة.
|
||||
|
||||
### الميزات الرئيسية لوضع التصدير
|
||||
|
||||
إليك بعض من الميزات المميزة:
|
||||
|
||||
- **تصدير بنقرة واحدة:** أوامر بسيطة لتصدير إلى تنسيقات مختلفة.
|
||||
- **تصدير الدُفعات:** تصدير نماذج قادرة على العمل مع الدُفعات.
|
||||
- **تنفيذ محسَّن:** يتم تحسين النماذج المصدرة لتوفير وقت تنفيذ أسرع.
|
||||
- **فيديوهات تعليمية:** مرشدين وفيديوهات تعليمية لتجربة تصدير سلسة.
|
||||
|
||||
!!! Tip "نصيحة"
|
||||
|
||||
* صدّر إلى ONNX أو OpenVINO للحصول على تسريع معالج الكمبيوتر المركزي بنسبة 3 أضعاف.
|
||||
* صدّر إلى TensorRT للحصول على تسريع وحدة المعالجة الرسومية بنسبة 5 أضعاف.
|
||||
|
||||
## أمثلة للاستخدام
|
||||
|
||||
قم بتصدير نموذج YOLOv8n إلى تنسيق مختلف مثل ONNX أو TensorRT. انظر الجدول أدناه للحصول على قائمة كاملة من وسائط التصدير.
|
||||
|
||||
!!! Example "مثال"
|
||||
|
||||
=== "بايثون"
|
||||
|
||||
```python
|
||||
from ultralytics import YOLO
|
||||
|
||||
# قم بتحميل نموذج
|
||||
model = YOLO('yolov8n.pt') # تحميل نموذج رسمي
|
||||
model = YOLO('path/to/best.pt') # تحميل نموذج مدرب مخصص
|
||||
|
||||
# قم بتصدير النموذج
|
||||
model.export(format='onnx')
|
||||
```
|
||||
=== "واجهة سطر الأوامر"
|
||||
|
||||
```bash
|
||||
yolo export model=yolov8n.pt format=onnx # تصدير نموذج رسمي
|
||||
yolo export model=path/to/best.pt format=onnx # تصدير نموذج مدرب مخصص
|
||||
```
|
||||
|
||||
## الوسائط
|
||||
|
||||
تشير إعدادات تصدير YOLO إلى التكوينات والخيارات المختلفة المستخدمة لحفظ أو تصدير النموذج للاستخدام في بيئات أو منصات أخرى. يمكن أن تؤثر هذه الإعدادات على أداء النموذج وحجمه وتوافقه مع الأنظمة المختلفة. تشمل بعض إعدادات تصدير YOLO الشائعة تنسيق ملف النموذج المصدر (مثل ONNX وتنسيق TensorFlow SavedModel) والجهاز الذي سيتم تشغيل النموذج عليه (مثل المعالج المركزي أو وحدة المعالجة الرسومية) ووجود ميزات إضافية مثل الأقنعة أو التسميات المتعددة لكل مربع. قد تؤثر عوامل أخرى قد تؤثر عملية التصدير تشمل المهمة النموذجة المحددة التي يتم استخدام النموذج لها ومتطلبات أو قيود البيئة أو المنصة المستهدفة. من المهم أن ننظر بعناية ونقوم بتكوين هذه الإعدادات لضمان أن النموذج المصدر هو محسَّن للحالة الاستخدام المقصودة ويمكن استخدامه بشكل فعال في البيئة المستهدفة.
|
||||
|
||||
| المفتاح | القيمة | الوصف |
|
||||
|-------------|-----------------|-----------------------------------------------------------------------|
|
||||
| `format` | `'torchscript'` | التنسيق المراد تصديره |
|
||||
| `imgsz` | `640` | حجم الصورة كمقدار علمي أو قائمة (h ، w) ، على سبيل المثال (640 ، 480) |
|
||||
| `keras` | `False` | استخدام Keras لتصدير TF SavedModel |
|
||||
| `optimize` | `False` | TorchScript: الأمثل للجوال |
|
||||
| `half` | `False` | تكميم FP16 |
|
||||
| `int8` | `False` | تكميم INT8 |
|
||||
| `dynamic` | `False` | ONNX/TensorRT: المحاور الديناميكية |
|
||||
| `simplify` | `False` | ONNX/TensorRT: تبسيط النموذج |
|
||||
| `opset` | `None` | ONNX: إصدار opset (اختياري ، الافتراضي هو الأحدث) |
|
||||
| `workspace` | `4` | TensorRT: حجم مساحة العمل (GB) |
|
||||
| `nms` | `False` | CoreML: إضافة NMS |
|
||||
|
||||
## تنسيقات التصدير
|
||||
|
||||
صيغ تصدير YOLOv8 المتاحة في الجدول أدناه. يمكنك التصدير إلى أي تنسيق باستخدام الوسيطة `format` ، مثل `format='onnx'` أو `format='engine'`.
|
||||
|
||||
| التنسيق | وسيطة format | النموذج | البيانات الوصفية | الوسائط |
|
||||
|--------------------------------------------------------------------|---------------|---------------------------|------------------|-----------------------------------------------------|
|
||||
| [بايثورش](https://pytorch.org/) | - | `yolov8n.pt` | ✅ | - |
|
||||
| [TorchScript](https://pytorch.org/docs/stable/jit.html) | `تورتشسيريبت` | `yolov8n.torchscript` | ✅ | `imgsz`, `optimize` |
|
||||
| [ONNX](https://onnx.ai/) | `onnx` | `yolov8n.onnx` | ✅ | `imgsz`, `half`, `dynamic`, `simplify`, `opset` |
|
||||
| [OpenVINO](https://docs.openvino.ai/latest/index.html) | `openvino` | `yolov8n_openvino_model/` | ✅ | `imgsz`, `half`, `int8` |
|
||||
| [TensorRT](https://developer.nvidia.com/tensorrt) | `engine` | `yolov8n.engine` | ✅ | `imgsz`, `half`, `dynamic`, `simplify`, `workspace` |
|
||||
| [CoreML](https://github.com/apple/coremltools) | `coreml` | `yolov8n.mlpackage` | ✅ | `imgsz`, `half`, `int8`, `nms` |
|
||||
| [TF SavedModel](https://www.tensorflow.org/guide/saved_model) | `saved_model` | `yolov8n_saved_model/` | ✅ | `imgsz`, `keras`, `int8` |
|
||||
| [TF GraphDef](https://www.tensorflow.org/api_docs/python/tf/Graph) | `pb` | `yolov8n.pb` | ❌ | `imgsz` |
|
||||
| [TF Lite](https://www.tensorflow.org/lite) | `tflite` | `yolov8n.tflite` | ✅ | `imgsz`, `half`, `int8` |
|
||||
| [TF Edge TPU](https://coral.ai/docs/edgetpu/models-intro/) | `edgetpu` | `yolov8n_edgetpu.tflite` | ✅ | `imgsz` |
|
||||
| [TF.js](https://www.tensorflow.org/js) | `tfjs` | `yolov8n_web_model/` | ✅ | `imgsz` |
|
||||
| [PaddlePaddle](https://github.com/PaddlePaddle) | `paddle` | `yolov8n_paddle_model/` | ✅ | `imgsz` |
|
||||
| [ncnn](https://github.com/Tencent/ncnn) | `ncnn` | `yolov8n_ncnn_model/` | ✅ | `imgsz`, `half` |
|
2
ultralytics/docs/ar/modes/export.md:Zone.Identifier
Executable file
2
ultralytics/docs/ar/modes/export.md:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
77
ultralytics/docs/ar/modes/index.md
Executable file
77
ultralytics/docs/ar/modes/index.md
Executable file
@ -0,0 +1,77 @@
|
||||
---
|
||||
comments: true
|
||||
description: من التدريب إلى التتبع، استفد من YOLOv8 مع Ultralytics. احصل على نصائح وأمثلة لكل وضع مدعوم بما في ذلك التحقق والتصدير واختبار الأداء.
|
||||
keywords: Ultralytics, YOLOv8, التعلم الآلي، كشف الكائنات، التدريب، التحقق، التنبؤ، التصدير، التتبع، اختبار الأداء
|
||||
---
|
||||
|
||||
# أوضاع Ultralytics YOLOv8
|
||||
|
||||
<img width="1024" src="https://github.com/ultralytics/assets/raw/main/yolov8/banner-integrations.png" alt="بيئة عمل Ultralytics YOLO والتكاملات">
|
||||
|
||||
## المقدمة
|
||||
|
||||
YOLOv8 من Ultralytics ليست مجرد نموذج لكشف الكائنات آخر؛ إنها إطار متعدد الاستخدامات مصمم لتغطية دورة حياة نماذج التعلم الآلي بأكملها - من امتصاص البيانات وتدريب النموذج إلى التحقق والنشر وتتبع الواقع الحقيقي. يخدم كل وضع غرضًا محددًا وهو مصمم لتوفير المرونة والكفاءة المطلوبة للمهام والحالات الاستخدام المختلفة.
|
||||
|
||||
!!! Note "ملاحظة"
|
||||
|
||||
🚧 توثيقنا متعدد اللغات قيد الإنشاء حاليًا، ونحن نعمل بجهد لتحسينه. شكرًا لك على صبرك! 🙏
|
||||
|
||||
<p align="center">
|
||||
<br>
|
||||
<iframe width="720" height="405" src="https://www.youtube.com/embed/j8uQc0qB91s?si=dhnGKgqvs7nPgeaM"
|
||||
title="مشغل فيديو يوتيوب" frameborder="0"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||
allowfullscreen>
|
||||
</iframe>
|
||||
<br>
|
||||
<strong>شاهد:</strong> برنامج التعليم Ultralytics: تدريب، التحقق، التنبؤ، التصدير، واختبار الأداء.
|
||||
</p>
|
||||
|
||||
### أوضاع مختصرة
|
||||
|
||||
فهم ال**أوضاع** المختلفة المدعومة بواسطة Ultralytics YOLOv8 مهم جدًا للاستفادة القصوى من النماذج الخاصة بك:
|
||||
|
||||
- وضع **التدريب**: قم بضبط نموذجك على مجموعة بيانات مخصصة أو محملة مسبقًا.
|
||||
- وضع **التحقق**: نقطة فحص بعد التدريب لتقييم أداء النموذج.
|
||||
- وضع **التنبؤ**: اطلق قوة التنبؤ الخاصة بنموذجك على البيانات الحقيقية.
|
||||
- وضع **التصدير**: قم بتجهيز نموذجك للاستخدام في صيغ مختلفة.
|
||||
- وضع **التتبع**: قم بتوسيع نموذج الكشف عن الكائنات الخاص بك إلى تطبيقات التتبع في الوقت الحقيقي.
|
||||
- وضع **اختبار الأداء**: قم بتحليل سرعة ودقة نموذجك في بيئات نشر متنوعة.
|
||||
|
||||
يهدف هذا الدليل الشامل إلى تقديم لمحة عامة ونصائح عملية حول كل وضع، لمساعدتك في استغلال كامل إمكانات YOLOv8.
|
||||
|
||||
## [وضع التدريب](train.md)
|
||||
|
||||
يتم استخدام وضع التدريب لتدريب نموذج YOLOv8 على مجموعة بيانات مخصصة. في هذا الوضع، يتم تدريب النموذج باستخدام مجموعة البيانات والمعلمات الهايبر للحصول على دقة في توقع الفئات ومواقع الكائنات في الصورة.
|
||||
|
||||
[أمثلة التدريب](train.md){ .md-button }
|
||||
|
||||
## [وضع التحقق](val.md)
|
||||
|
||||
يتم استخدام وضع التحقق للتحقق من نموذج YOLOv8 بعد تدريبه. في هذا الوضع، يتم تقييم النموذج على مجموعة التحقق لقياس دقته وأداء التعميم. يمكن استخدام هذا الوضع لتعديل المعلمات الهايبر للنموذج لتحسين أدائه.
|
||||
|
||||
[أمثلة التحقق](val.md){ .md-button }
|
||||
|
||||
## [وضع التنبؤ](predict.md)
|
||||
|
||||
يتم استخدام وضع التنبؤ لإجراء تنبؤات باستخدام نموذج YOLOv8 المدرب على صور أو فيديوهات جديدة. في هذا الوضع، يتم تحميل النموذج من ملف الفحص، ويمكن للمستخدم توفير الصور أو مقاطع الفيديو لإجراء استدلال. يقوم النموذج بتوقع الفئات ومواقع الكائنات في الصور أو مقاطع الفيديو المدخلة.
|
||||
|
||||
[أمثلة التنبؤ](predict.md){ .md-button }
|
||||
|
||||
## [وضع التصدير](export.md)
|
||||
|
||||
يتم استخدام وضع التصدير لتصدير نموذج YOLOv8 إلى صيغة يمكن استخدامها للنشر. في هذا الوضع، يتم تحويل النموذج إلى صيغة يمكن استخدامها من قبل تطبيقات البرامج الأخرى أو الأجهزة الأجهزة. يكون هذا الوضع مفيدًا عند نشر النموذج في بيئات الإنتاج.
|
||||
|
||||
[أمثلة التصدير](export.md){ .md-button }
|
||||
|
||||
## [وضع التتبع](track.md)
|
||||
|
||||
يتم استخدام وضع التتبع لتتبع الكائنات في الوقت الحقيقي باستخدام نموذج YOLOv8. في هذا الوضع، يتم تحميل النموذج من ملف الفحص، ويمكن للمستخدم توفير تيار فيديو مباشر لأداء تتبع الكائنات في الوقت الفعلي. يكون هذا الوضع مفيدًا لتطبيقات مثل أنظمة المراقبة أو السيارات ذاتية القيادة.
|
||||
|
||||
[أمثلة التتبع](track.md){ .md-button }
|
||||
|
||||
## [وضع اختبار الأداء](benchmark.md)
|
||||
|
||||
يتم استخدام وضع اختبار الأداء لتقييم سرعة ودقة صيغ التصدير المختلفة لـ YOLOv8. تقدم الاختبارات معلومات حول حجم الصيغة المصدر، معيار الأداء `mAP50-95` (لكشف الكائنات والتقسيم والتصوير) أو المعيار `accuracy_top5` (للتصنيف)، ووقت الاستدلال بالملي ثانية لكل صورة في صيغ التصدير المختلفة مثل ONNX و OpenVINO و TensorRT وغيرها. يمكن لهذه المعلومات مساعدة المستخدمين على اختيار صيغة التصدير الأمثل لحالتهم الاستخدامية المحددة بناءً على متطلبات السرعة والدقة.
|
||||
|
||||
[أمثلة اختبار الأداء](benchmark.md){ .md-button }
|
2
ultralytics/docs/ar/modes/index.md:Zone.Identifier
Executable file
2
ultralytics/docs/ar/modes/index.md:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
217
ultralytics/docs/ar/modes/predict.md
Executable file
217
ultralytics/docs/ar/modes/predict.md
Executable file
@ -0,0 +1,217 @@
|
||||
---
|
||||
comments: true
|
||||
description: اكتشف كيفية استخدام وضع التنبؤ YOLOv8 لمهام مختلفة. تعرّف على مصادر التنبؤ المختلفة مثل الصور ومقاطع الفيديو وتنسيقات البيانات المختلفة.
|
||||
keywords: Ultralytics، YOLOv8، وضع التنبؤ، مصادر التنبؤ، مهام التنبؤ، وضع التدفق، معالجة الصور، معالجة الفيديو، التعلم الآلي، الذكاء الاصطناعي
|
||||
---
|
||||
|
||||
# التنبؤ بالنموذج باستخدام Ultralytics YOLO
|
||||
|
||||
<img width="1024" src="https://github.com/ultralytics/assets/raw/main/yolov8/banner-integrations.png" alt="البيئة والتكامل الخاصة بنظام Ultralytics YOLO">
|
||||
|
||||
## المقدمة
|
||||
|
||||
في عالم التعلم الآلي ورؤية الحاسوب، يُطلق على عملية استخلاص المعنى من البيانات البصرية اسم "الاستدلال" أو "التنبؤ". يوفر YOLOv8 من Ultralytics ميزة قوية تُعرف بـ**وضع التنبؤ** والتي تم تصميمها خصيصًا للاستدلال في الوقت الحقيقي وبأداء عال على مجموعة واسعة من مصادر البيانات.
|
||||
|
||||
<p align="center">
|
||||
<br>
|
||||
<iframe width="720" height="405" src="https://www.youtube.com/embed/QtsI0TnwDZs?si=ljesw75cMO2Eas14"
|
||||
title="مشغل الفيديو" frameborder="0"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||
allowfullscreen>
|
||||
</iframe>
|
||||
<br>
|
||||
<strong>شاهد:</strong> كيفية استخراج النتائج من نموذج Ultralytics YOLOv8 لمشاريع مخصصة.
|
||||
</p>
|
||||
|
||||
## التطبيقات في العالم الحقيقي
|
||||
|
||||
| التصنيع | الرياضة | السلامة |
|
||||
|:-------------------------------------------------:|:----------------------------------------------------:|:-------------------------------------------:|
|
||||
| ![Vehicle Spare Parts Detection][car spare parts] | ![Football Player Detection][football player detect] | ![People Fall Detection][human fall detect] |
|
||||
| كشف قطع غيار المركبات | كشف لاعبي كرة القدم | كشف سقوط الأشخاص |
|
||||
|
||||
## لماذا يجب استخدام Ultralytics YOLO لعمليات التنبؤ؟
|
||||
|
||||
فيما يلي الأسباب التي يجب أخذها في الاعتبار عند الاستفادة من وضع التنبؤ YOLOv8 لاحتياجات التنبؤ المختلفة:
|
||||
|
||||
- **التنوع:** قادر على التنبؤ على الصور ومقاطع الفيديو، وحتى التدفقات الحية.
|
||||
- **الأداء:** مصمم للتطبيقات في الوقت الحقيقي والمعالجة عالية السرعة دون التضحية بالدقة.
|
||||
- **سهولة الاستخدام:** واجهات Python والواجهة السطرية لتسريع النشر والاختبار.
|
||||
- **قابلية التخصيص العالية:** إعدادات ومعلمات مختلفة لضبط سلوك التنبؤ النموذج وفقًا لمتطلباتك المحددة.
|
||||
|
||||
### الميزات الرئيسية لوضع التنبؤ
|
||||
|
||||
تم تصميم وضع التنبؤ الخاص بـ YOLOv8 ليكون قويًا ومتعدد الاستخدامات، ويتميز بما يلي:
|
||||
|
||||
- **توافق متعدد مصادر البيانات:** سواء كانت بياناتك عبارة عن صور فردية أو مجموعة من الصور أو ملفات فيديو أو تدفقات فيديو في الوقت الحقيقي، سيتمكن وضع التنبؤ من التعامل معها جميعًا.
|
||||
- **وضع التدفق الحي:** استخدم ميزة التدفق لإنشاء مولد فعّال لكائنات "النتائج" باستخدام الذاكرة. قم بتمكين هذا بتعيين `stream=True` في طريقة استدعاء المتنبئ.
|
||||
- **معالجة دُفعات:** القدرة على معالجة العديد من الصور أو إطارات الفيديو في دُفعة واحدة، مما يزيد أكثر من سرعة التنبؤ.
|
||||
- **سهل التكامل:** يسهل الدمج مع خطوط الأنابيب البيانية الحالية ومكونات البرامج الأخرى بفضل واجهة برمجة التطبيقات المرنة.
|
||||
|
||||
تُرجع نماذج Ultralytics YOLO إما قائمة Python من كائنات "النتائج" أو مُنشئ برمجياً فعّال لكائنات الـ "النتائج" في حال تم تمرير `stream=True` إلى النموذج أثناء عملية التنبؤ:
|
||||
|
||||
!!! Example "التنبؤ"
|
||||
|
||||
=== "العودة بقائمة واحدة باستخدام `stream=False`"
|
||||
```python
|
||||
from ultralytics import YOLO
|
||||
|
||||
# تحميل نموذج
|
||||
model = YOLO('yolov8n.pt') # نموذج YOLOv8n المُدرَّب مسبقًا
|
||||
|
||||
# تشغيل التنبؤ بدُفعة على قائمة من الصور
|
||||
results = model(['im1.jpg', 'im2.jpg']) # العودة بقائمة من كائنات 'النتائج'
|
||||
|
||||
# معالجة قائمة النتائج
|
||||
for result in results:
|
||||
boxes = result.boxes # كائن Boxes لمخرجات bbox
|
||||
masks = result.masks # كائن Masks لمخرجات قنوات الفصل العنقودي
|
||||
keypoints = result.keypoints # كائن Keypoints لمخرجات الاتجاهات
|
||||
probs = result.probs # كائن Probs لمخرجات التصنيف
|
||||
```
|
||||
|
||||
=== "العودة بمُنشئ فعال مع `stream=True`"
|
||||
```python
|
||||
from ultralytics import YOLO
|
||||
|
||||
# تحميل نموذج
|
||||
model = YOLO('yolov8n.pt') # نموذج YOLOv8n المُدرَّب مسبقًا
|
||||
|
||||
# تشغيل التنبؤ بدُفعة على قائمة من الصور
|
||||
results = model(['im1.jpg', 'im2.jpg'], stream=True) # العودة بمُنشئ فعال لكائنات 'النتائج'
|
||||
|
||||
# معالجة المُنشئ الفعال
|
||||
for result in results:
|
||||
boxes = result.boxes # كائن Boxes لمخرجات bbox
|
||||
masks = result.masks # كائن Masks لمخرجات قنوات الفصل العنقودي
|
||||
keypoints = result.keypoints # كائن Keypoints لمخرجات الاتجاهات
|
||||
probs = result.probs # كائن Probs لمخرجات التصنيف
|
||||
```
|
||||
|
||||
## مصادر التنبؤ
|
||||
|
||||
يمكن لـ YOLOv8 معالجة أنواع مختلفة من مصادر الإدخال لعملية الاستدلال، على النحو الموضح في الجدول أدناه. تشمل المصادر الصور الثابتة وتيارات الفيديو وتنسيقات مختلفة للبيانات. يشير الجدول أيضًا إلى ما إذا كان يمكن استخدام كل مصدر في وضع التدفق باستخدام الوسيط `stream=True` ✅. يعتبر وضع التدفق مفيدًا لمعالجة مقاطع الفيديو أو التدفقات الحية حيث يقوم بإنشاء مُنشئ للنتائج بدلاً من تحميل جميع الإطارات في الذاكرة.
|
||||
|
||||
!!! Tip "طراز"
|
||||
|
||||
استخدم `stream=True` لمعالجة مقاطع الفيديو الطويلة أو مجموعات البيانات الكبيرة لإدارة الذاكرة بكفاءة. عندما تكون القيمة مساوية لـ `stream=False`، يتم تخزين النتائج لجميع الإطارات أو نقاط البيانات في الذاكرة، والتي يمكن أن تتراكم بسرعة وتُسبِّب أخطاء الذاكرة غير الكافية للمدخلات الكبيرة. على النقيض من ذلك، يستخدم التدفق `stream=True` مولدًا يُبقي نتائج الإطار الحالي أو نقطة البيانات الحالية في الذاكرة فقط، مما يقلل بشكل كبير من استهلاك الذاكرة ويمنع مشكلات عدم كفاية الذاكرة.
|
||||
|
||||
| مصدر | الوسيط | النوع | الملاحظات |
|
||||
|------------------|--------------------------------------------|-----------------|----------------------------------------------------------------------------------------------|
|
||||
| صورة | `'صورة.jpg'` | `str` or `Path` | ملف صورة واحدة. |
|
||||
| رابط URL | `'https://ultralytics.com/images/bus.jpg'` | `str` | رابط URL لصورة ما. |
|
||||
| لقطة شاشة برمجية | `'الشاشة'` | `str` | قم بالتقاط لقطة شاشة برمجية. |
|
||||
| PIL | `Image.open('im.jpg')` | `PIL.Image` | الصيغة HWC مع قنوات RGB. |
|
||||
| OpenCV | `cv2.imread('im.jpg')` | `np.ndarray` | الصيغة HWC مع قنوات BGR `uint8 (0-255)`. |
|
||||
| numpy | `np.zeros((640,1280,3))` | `np.ndarray` | الصيغة HWC مع قنوات BGR `uint8 (0-255)`. |
|
||||
| torch | `torch.zeros(16,3,320,640)` | `torch.Tensor` | الصيغة BCHW مع قنوات RGB `float32 (0.0-1.0)`. |
|
||||
| CSV | `'المصادر.csv'` | `str` or `Path` | ملف CSV يحتوي على مسارات الصور أو مقاطع الفيديو أو المجلدات. |
|
||||
| فيديو ✅ | `'الفيديو.mp4'` | `str` or `Path` | ملف فيديو بتنسيقات مثل MP4 و AVI وما إلى ذلك. |
|
||||
| الدليل ✅ | `'المسار/'` | `str` or `Path` | مسار إلى مجلد يحتوي على صور أو مقاطع فيديو. |
|
||||
| glob ✅ | `'المسار/*.jpg'` | `str` | نمط glob لمطابقة عدة ملفات. استخدم حرف `*` كحرطوم. |
|
||||
| يوتيوب ✅ | `'https://youtu.be/LNwODJXcvt4'` | `str` | رابط URL إلى فيديو يوتيوب. |
|
||||
| تدفق ✅ | `'rtsp://example.com/media.mp4'` | `str` | عنوان URL لبروتوكولات التدفق مثل RTSP و RTMP و TCP أو عنوان IP. |
|
||||
| تدفق متعدد ✅ | `'list.streams'` | `str` or `Path` | ملف نصي `*.streams` مع عنوان تدفق URL في كل صف، على سبيل المثال 8 تدفقات ستعمل بحجم دُفعة 8. |
|
||||
|
||||
فيما يلي أمثلة تعليمات برمجية لاستخدام كل نوع من مصدر:
|
||||
|
||||
!!! Example "مصادر التنبؤ"
|
||||
|
||||
=== "الصورة"
|
||||
قم بأجراء عملية التنبؤ على ملف صورة.
|
||||
```python
|
||||
from ultralytics import YOLO
|
||||
|
||||
# تحميل نموذج YOLOv8n المدرب مسبقًا
|
||||
model = YOLO('yolov8n.pt')
|
||||
|
||||
# تنشيط عملية التنبؤ لملف الصورة
|
||||
source = 'المسار/إلى/الصورة.jpg'
|
||||
|
||||
# الجمع بين التنبؤ على المصدر
|
||||
results = model(source) # قائمة كائنات النتائج
|
||||
```
|
||||
|
||||
=== "لقطة شاشة برمجية"
|
||||
قم بأجراء عملية التنبؤ على محتوى الشاشة الحالي كلقطة شاشة.
|
||||
```python
|
||||
from ultralytics import YOLO
|
||||
|
||||
# تحميل نموذج YOLOv8n المدرب مسبقًا
|
||||
model = YOLO('yolov8n.pt')
|
||||
|
||||
# تعريف اللقطة الحالية كمصدر
|
||||
source = 'الشاشة'
|
||||
|
||||
# الجمع بين التنبؤ على المصدر
|
||||
results = model(source) # قائمة كائنات النتائج
|
||||
```
|
||||
|
||||
=== "رابط URL"
|
||||
قم بأجراء عملية التنبؤ على صورة موجودة على الإنترنت أو فيديو.
|
||||
```python
|
||||
from ultralytics import YOLO
|
||||
|
||||
# تحميل نموذج YOLOv8n المدرب مسبقًا
|
||||
model = YOLO('yolov8n.pt')
|
||||
|
||||
# تعريف رابط الصورة أو الفيديو على الإنترنت
|
||||
source = 'https://ultralytics.com/images/bus.jpg'
|
||||
|
||||
# الجمع بين التنبؤ على المصدر
|
||||
results = model(source) # قائمة كائنات النتائج
|
||||
```
|
||||
|
||||
=== "PIL"
|
||||
قم بأجراء عملية التنبؤ على صورة مفتوحة بواسطة مكتبة Python Imaging Library (PIL).
|
||||
```python
|
||||
from PIL import Image
|
||||
from ultralytics import YOLO
|
||||
|
||||
# تحميل نموذج YOLOv8n المدرب مسبقًا
|
||||
model = YOLO('yolov8n.pt')
|
||||
|
||||
# فتح صورة باستخدام PIL
|
||||
source = Image.open('المسار/إلى/الصورة.jpg')
|
||||
|
||||
# الجمع بين التنبؤ على المصدر
|
||||
results = model(source) # قائمة كائنات النتائج
|
||||
```
|
||||
|
||||
=== "OpenCV"
|
||||
قم بأجراء عملية التنبؤ على صورة مُقروءة بواسطة OpenCV.
|
||||
```python
|
||||
import cv2
|
||||
from ultralytics import YOLO
|
||||
|
||||
# تحميل نموذج YOLOv8n المدرب مسبقًا
|
||||
model = YOLO('yolov8n.pt')
|
||||
|
||||
# قراءة صورة باستخدام OpenCV
|
||||
source = cv2.imread('المسار/إلى/الصورة.jpg')
|
||||
|
||||
# الجمع بين التنبؤ على المصدر
|
||||
results = model(source) # قائمة كائنات النتائج
|
||||
```
|
||||
|
||||
=== "numpy"
|
||||
قم بأجراء عملية التنبؤ على صورة مُمثلة كمصفوفة numpy.
|
||||
```python
|
||||
import numpy as np
|
||||
from ultralytics import YOLO
|
||||
|
||||
# تحميل نموذج YOLOv8n المدرب مسبقًا
|
||||
model = YOLO('yolov8n.pt')
|
||||
|
||||
# إنشاء مصفوفة numpy عشوائية في صيغة HWC (640, 640, 3) بقيم بين [0, 255] ونوع uint8
|
||||
source = np.random.randint(low=0, high=255, size=(640, 640, 3), dtype='uint8')
|
||||
|
||||
# الجمع بين التنبؤ على المصدر
|
||||
results = model(source) # قائمة كائنات النتائج
|
||||
```
|
||||
|
||||
[car spare parts]: https://github.com/RizwanMunawar/ultralytics/assets/62513924/a0f802a8-0776-44cf-8f17-93974a4a28a1
|
||||
|
||||
[football player detect]: https://github.com/RizwanMunawar/ultralytics/assets/62513924/7d320e1f-fc57-4d7f-a691-78ee579c3442
|
||||
|
||||
[human fall detect]: https://github.com/RizwanMunawar/ultralytics/assets/62513924/86437c4a-3227-4eee-90ef-9efb697bdb43
|
2
ultralytics/docs/ar/modes/predict.md:Zone.Identifier
Executable file
2
ultralytics/docs/ar/modes/predict.md:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
360
ultralytics/docs/ar/modes/track.md
Executable file
360
ultralytics/docs/ar/modes/track.md
Executable file
@ -0,0 +1,360 @@
|
||||
---
|
||||
comments: true
|
||||
description: تعرف على كيفية استخدام Ultralytics YOLO لتتبع الكائنات في تدفقات الفيديو. أدلة لاستخدام مختلف المتتبعين وتخصيص إعدادات المتتبع.
|
||||
keywords: Ultralytics، YOLO، تتبع الكائنات، تدفقات الفيديو، BoT-SORT، ByteTrack، دليل Python، دليل خط الأوامر (CLI)
|
||||
---
|
||||
|
||||
# تتبع عدة كائنات باستخدام Ultralytics YOLO
|
||||
|
||||
<img width="1024" src="https://user-images.githubusercontent.com/26833433/243418637-1d6250fd-1515-4c10-a844-a32818ae6d46.png" alt="Multi-object tracking examples">
|
||||
|
||||
يعد تتبع الكائنات في مجال تحليل الفيديو مهمة حرجة ليس فقط في تحديد موقع وفئة الكائنات داخل الإطار، ولكن أيضًا في الحفاظ على هوية فريدة لكل كائن يتم اكتشافه مع تقدم الفيديو. تكاد التطبيقات لا تعد ولا تحصى - تتراوح من المراقبة والأمان إلى تحليل الرياضة الفورية.
|
||||
|
||||
## لماذا يجب اختيار Ultralytics YOLO لتتبع الكائنات؟
|
||||
|
||||
إن مخرجات المتتبعين في Ultralytics متسقة مع كشف الكائنات القياسي ولها قيمة مضافة من هويات الكائنات. هذا يجعل من السهل تتبع الكائنات في تدفقات الفيديو وأداء التحليلات التالية. إليك لماذا يجب أن تفكر في استخدام Ultralytics YOLO لتلبية احتياجات تتبع الكائنات الخاصة بك:
|
||||
|
||||
- **الكفاءة:** معالجة تدفقات الفيديو في الوقت الحقيقي دون المساومة على الدقة.
|
||||
- **المرونة:** يدعم العديد من خوارزميات التتبع والتكوينات.
|
||||
- **سهولة الاستخدام:** واجهة برمجة تطبيقات بسيطة للغاية وخيارات سطر الأوامر للاستدماج السريع والنشر.
|
||||
- **إمكانية التخصيص:** سهل الاستخدام مع نماذج YOLO مدربة مخصصة، مما يسمح بالاكتمال في التطبيقات ذات النطاق الخاص.
|
||||
|
||||
<p align="center">
|
||||
<br>
|
||||
<iframe width="720" height="405" src="https://www.youtube.com/embed/hHyHmOtmEgs?si=VNZtXmm45Nb9s-N-"
|
||||
title="مشغل فيديو YouTube" frameborder="0"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||
allowfullscreen>
|
||||
</iframe>
|
||||
<br>
|
||||
<strong>شاهد:</strong> كشف الكائنات وتتبعها باستخدام Ultralytics YOLOv8.
|
||||
</p>
|
||||
|
||||
## تطبيقات في العالم الحقيقي
|
||||
|
||||
| النقل | البيع بالتجزئة | الاستزراع المائي |
|
||||
|:----------------------------------:|:--------------------------------:|:----------------------------:|
|
||||
| ![Vehicle Tracking][vehicle track] | ![People Tracking][people track] | ![Fish Tracking][fish track] |
|
||||
| تتبع المركبات | تتبع الأشخاص | تتبع الأسماك |
|
||||
|
||||
## ملامح بلمحة
|
||||
|
||||
يوفر Ultralytics YOLO ميزات كشف الكائنات لتوفير تتبع فعال ومتعدد الاستخدامات للكائنات:
|
||||
|
||||
- **تتبع فوري:** تتبع الكائنات بسلاسة في مقاطع الفيديو ذات معدل الإطارات العالي.
|
||||
- **دعم عدة متتبعين:** اختيار بين مجموعة متنوعة من خوارزميات التتبع المعتمدة.
|
||||
- **تخصيص تكوينات المتتبع المتاحة:** ضبط خوارزمية التتبع لتلبية المتطلبات المحددة عن طريق ضبط مختلف المعلمات.
|
||||
|
||||
## متتبعون متاحون
|
||||
|
||||
يدعم Ultralytics YOLO الخوارزميات التالية للتتبع. يمكن تمكينها عن طريق تمرير ملف تكوين YAML ذي الصلة مثل "tracker=tracker_type.yaml":
|
||||
|
||||
* [BoT-SORT](https://github.com/NirAharon/BoT-SORT) - استخدم `botsort.yaml` لتمكين هذا المتتبع.
|
||||
* [ByteTrack](https://github.com/ifzhang/ByteTrack) - استخدم `bytetrack.yaml` لتمكين هذا المتتبع.
|
||||
|
||||
المتتبع الافتراضي هو BoT-SORT.
|
||||
|
||||
## تتبع
|
||||
|
||||
لتشغيل المتتبع على تدفقات الفيديو، استخدم نموذج تحديد (Detect) أو قطع (Segment) أو وضع (Pose) مدرب مثل YOLOv8n و YOLOv8n-seg و YOLOv8n-pose.
|
||||
|
||||
!!! Example "مثال"
|
||||
|
||||
=== "Python"
|
||||
|
||||
```python
|
||||
from ultralytics import YOLO
|
||||
|
||||
# قم بتحميل نموذج رسمي أو مخصص
|
||||
model = YOLO('yolov8n.pt') # قم بتحميل نموذج رسمي Detect
|
||||
model = YOLO('yolov8n-seg.pt') # قم بتحميل نموذج رسمي Segment
|
||||
model = YOLO('yolov8n-pose.pt') # قم بتحميل نموذج رسمي Pose
|
||||
model = YOLO('path/to/best.pt') # قم بتحميل نموذج مخصص مدرب
|
||||
|
||||
# قم بتنفيذ التتبع باستخدام النموذج
|
||||
results = model.track(source="https://youtu.be/LNwODJXcvt4", show=True) # التتبع باستخدام المتتبع الافتراضي
|
||||
results = model.track(source="https://youtu.be/LNwODJXcvt4", show=True, tracker="bytetrack.yaml") # التتبع باستخدام متتبع ByteTrack
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
|
||||
```bash
|
||||
# قم بتنفيذ التتبع باستخدام مختلف النماذج باستخدام واجهة سطر الأوامر
|
||||
yolo track model=yolov8n.pt source="https://youtu.be/LNwODJXcvt4" # نموذج Detect رسمي
|
||||
yolo track model=yolov8n-seg.pt source="https://youtu.be/LNwODJXcvt4" # نموذج Segment رسمي
|
||||
yolo track model=yolov8n-pose.pt source="https://youtu.be/LNwODJXcvt4" # نموذج Pose رسمي
|
||||
yolo track model=path/to/best.pt source="https://youtu.be/LNwODJXcvt4" # تم تدريب نموذج مخصص
|
||||
|
||||
# تتبع عن طريق ByteTrack متتبع
|
||||
yolo track model=path/to/best.pt tracker="bytetrack.yaml"
|
||||
```
|
||||
|
||||
كما يظهر في الاستخدام أعلاه، يتوفر التتبع لجميع نماذج Detect و Segment و Pose التي تعمل على مقاطع الفيديو أو مصادر البث.
|
||||
|
||||
## الاعدادات
|
||||
|
||||
### معاملات التتبع
|
||||
|
||||
تتشارك إعدادات التتبع الخصائص مع وضع التوقعات (Predict)، مثل `conf` و `iou` و `show`. للحصول على مزيد من التكوينات، راجع صفحة النموذج [Predict](../modes/predict.md#inference-arguments).
|
||||
|
||||
!!! Example "مثال"
|
||||
|
||||
=== "Python"
|
||||
|
||||
```python
|
||||
from ultralytics import YOLO
|
||||
|
||||
# قم بتكوين معلمات التتبع وقم بتشغيل التتبع
|
||||
model = YOLO('yolov8n.pt')
|
||||
results = model.track(source="https://youtu.be/LNwODJXcvt4", conf=0.3, iou=0.5, show=True)
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
|
||||
```bash
|
||||
# قم بتكوين معلمات التتبع وقم بتشغيل التتبع باستخدام واجهة سطر الأوامر
|
||||
yolo track model=yolov8n.pt source="https://youtu.be/LNwODJXcvt4" conf=0.3, iou=0.5 show
|
||||
```
|
||||
|
||||
### اختيار المتتبع
|
||||
|
||||
يتيح لك Ultralytics أيضًا استخدام ملف تكوين متتبع معدل. للقيام بذلك، أنقل نسخة من ملف تكوين المتتبع (مثل `custom_tracker.yaml`) من [ultralytics/cfg/trackers](https://github.com/ultralytics/ultralytics/tree/main/ultralytics/cfg/trackers) وقم بتعديل أي تكوينات (باستثناء `tracker_type`) حسب احتياجاتك.
|
||||
|
||||
!!! Example "مثال"
|
||||
|
||||
=== "Python"
|
||||
|
||||
```python
|
||||
from ultralytics import YOLO
|
||||
|
||||
# قم بتحميل النموذج وتشغيل التتبع باستخدام ملف تكوين مخصص
|
||||
model = YOLO('yolov8n.pt')
|
||||
results = model.track(source="https://youtu.be/LNwODJXcvt4", tracker='custom_tracker.yaml')
|
||||
```
|
||||
|
||||
=== "CLI"
|
||||
|
||||
```bash
|
||||
# قم بتحميل النموذج وتشغيل التتبع باستخدام ملف تكوين مخصص باستخدام واجهة سطر الأوامر
|
||||
yolo track model=yolov8n.pt source="https://youtu.be/LNwODJXcvt4" tracker='custom_tracker.yaml'
|
||||
```
|
||||
|
||||
للحصول على قائمة شاملة من وسائط تتبع، راجع الصفحة [ultralytics/cfg/trackers](https://github.com/ultralytics/ultralytics/tree/main/ultralytics/cfg/trackers).
|
||||
|
||||
## أمثلة Python
|
||||
|
||||
### الحفاظ على المسارات التكرارية
|
||||
|
||||
فيما يلي سكريبت Python باستخدام OpenCV (cv2) و YOLOv8 لتشغيل تتبع الكائنات على إطارات الفيديو. يفترض هذا السكريبت أنك قد قمت بالفعل بتثبيت الحزم اللازمة (opencv-python و ultralytics). المعامل `persist=True` يخبر المتتبع أن الصورة الحالية أو الإطار التالي في التسلسل ومن المتوقع أن يتوفر مسارات من الصورة السابقة في الصورة الحالية.
|
||||
|
||||
!!! Example "For-loop للتدفق مع التتبع"
|
||||
|
||||
```python
|
||||
import cv2
|
||||
from ultralytics import YOLO
|
||||
|
||||
# حمّل نموذج YOLOv8
|
||||
model = YOLO('yolov8n.pt')
|
||||
|
||||
# افتح ملف الفيديو
|
||||
video_path = "path/to/video.mp4"
|
||||
cap = cv2.VideoCapture(video_path)
|
||||
|
||||
# تحلق عبر إطارات الفيديو
|
||||
while cap.isOpened():
|
||||
# قراءة الإطار من الفيديو
|
||||
success, frame = cap.read()
|
||||
|
||||
if success:
|
||||
# تشغيل تتبع YOLOv8 على الإطار ، وحفظ المسارات بين الإطارات
|
||||
results = model.track(frame, persist=True)
|
||||
|
||||
# تصور النتائج على الإطار
|
||||
annotated_frame = results[0].plot()
|
||||
|
||||
# عرض الإطار المعلق
|
||||
cv2.imshow("YOLOv8 Tracking", annotated_frame)
|
||||
|
||||
# كسر اللوب في حالة الضغط على 'q'
|
||||
if cv2.waitKey(1) & 0xFF == ord("q"):
|
||||
break
|
||||
else:
|
||||
# كسر اللوب في نهاية الفيديو
|
||||
break
|
||||
|
||||
# إطلاق كائن التقاط الفيديو وإغلاق نافذة العرض
|
||||
cap.release()
|
||||
cv2.destroyAllWindows()
|
||||
```
|
||||
|
||||
يرجى ملاحظة التغيير من `model(frame)` إلى `model.track(frame)` ، مما يمكن التتبع بدلاً من الكشف البسيط. سيتم تشغيل البرنامج المعدل على كل إطار فيديو وتصور النتائج وعرضها في نافذة. يمكن الخروج من الحلقة عن طريق الضغط على 'q'.
|
||||
|
||||
### رسم المسارات عبر الوقت
|
||||
|
||||
يمكن أن يوفر رسم المسارات الكائنية عبر الإطارات المتتالية إشارات قيمة حول أنماط الحركة والسلوك للكائنات المكتشفة في الفيديو. باستخدام Ultralytics YOLOv8 ، يعد تصوير هذه المسارات عملية سلسة وفعالة.
|
||||
|
||||
في المثال التالي ، نوضح كيفية استخدام قدرات يوكو 8 YOLO لتتبع الكائنات لرسم حركة الكائنات المكتشفة عبر إطارات الفيديو المتعددة. يتضمن هذا البرنامج فتح ملف فيديو وقراءته إطارًا بإطار ، واستخدام نموذج YOLO لتحديد وتتبع العديد من الكائنات. عن طريق الاحتفاظ بنقاط الوسط لمربعات الحدود المكتشفة وتوصيلها ، يمكننا رسم خطوط تمثل المسارات التي تم اتباعها بواسطة الكائنات التي تمت متابعتها.
|
||||
|
||||
!!! Example "رسم المسارات عبر إطارات الفيديو المتعددة"
|
||||
|
||||
```python
|
||||
from collections import defaultdict
|
||||
|
||||
import cv2
|
||||
import numpy as np
|
||||
|
||||
from ultralytics import YOLO
|
||||
|
||||
# حمّل نموذج YOLOv8
|
||||
model = YOLO('yolov8n.pt')
|
||||
|
||||
# افتح ملف الفيديو
|
||||
video_path = "path/to/video.mp4"
|
||||
cap = cv2.VideoCapture(video_path)
|
||||
|
||||
# احفظ تاريخ المسارات
|
||||
track_history = defaultdict(lambda: [])
|
||||
|
||||
# تحلق عبر إطارات الفيديو
|
||||
while cap.isOpened():
|
||||
# قراءة الإطار من الفيديو
|
||||
success, frame = cap.read()
|
||||
|
||||
if success:
|
||||
# تشغيل تتبع YOLOv8 على الإطار ، وحفظ المسارات بين الإطارات
|
||||
results = model.track(frame, persist=True)
|
||||
|
||||
# الحصول على المربعات ومعرفات المسار
|
||||
boxes = results[0].boxes.xywh.cpu()
|
||||
track_ids = results[0].boxes.id.int().cpu().tolist()
|
||||
|
||||
# تصور النتائج على الإطار
|
||||
annotated_frame = results[0].plot()
|
||||
|
||||
# رسم المسارات
|
||||
for box, track_id in zip(boxes, track_ids):
|
||||
x, y, w, h = box
|
||||
track = track_history[track_id]
|
||||
track.append((float(x), float(y))) # x, y نقطة الوسط
|
||||
if len(track) > 30: # احتفظ بـ 90 مسارًا لـ 90 إطارًا
|
||||
track.pop(0)
|
||||
|
||||
# رسم خطوط التتبع
|
||||
points = np.hstack(track).astype(np.int32).reshape((-1, 1, 2))
|
||||
cv2.polylines(annotated_frame, [points], isClosed=False, color=(230, 230, 230), thickness=10)
|
||||
|
||||
# عرض الإطار المعلق
|
||||
cv2.imshow("YOLOv8 Tracking", annotated_frame)
|
||||
|
||||
# كسر اللوب في حالة الضغط على 'q'
|
||||
if cv2.waitKey(1) & 0xFF == ord("q"):
|
||||
break
|
||||
else:
|
||||
# كسر اللوب في نهاية الفيديو
|
||||
break
|
||||
|
||||
# إطلاق كائن التقاط الفيديو وإغلاق نافذة العرض
|
||||
cap.release()
|
||||
cv2.destroyAllWindows()
|
||||
```
|
||||
|
||||
### التتبع متعدد الخيوط
|
||||
|
||||
يوفر التتبع متعدد الخيوط القدرة على تشغيل تتبع الكائنات على عدة تدفقات فيديو في وقت واحد. هذا مفيد بشكل خاص عند التعامل مع مدخلات فيديو متعددة ، مثل من كاميرات المراقبة المتعددة ، حيث يمكن أن يعزز المعالجة المتزامنة الكفاءة والأداء بشكل كبير.
|
||||
|
||||
في السكريبت البايثون المقدم ، نستخدم وحدة `threading` في Python لتشغيل عدة نسخ متزامنة من المتتبع. يكون لكل موضوع مسؤولية تشغيل المتتبع على ملف فيديو واحد ، وتعمل جميع الخيوط في الخلفية في نفس الوقت.
|
||||
|
||||
للتأكد من أن كل خيط يتلقى المعلمات الصحيحة (ملف الفيديو والنموذج المستخدم وفهرس الملف) ، نحدد وظيفة `run_tracker_in_thread` التي تقبل هذه المعلمات وتحتوي على حلقة المتابعة الرئيسية. هذه الوظيفة تقرأ إطار الفيديو الخاصة بالفيديو مباشرة من مصدر الملف الواحد ، وتشغيل المتتبع ، وعرض النتائج.
|
||||
|
||||
تستخدم في هذا المثال نموذجين مختلفين: 'yolov8n.pt' و 'yolov8n-seg.pt' ، يقوم كل منهما بتتبع الكائنات في ملف فيديو مختلف. تم تحديد ملفات الفيديو في `video_file1` و `video_file2`.
|
||||
|
||||
تعديل معلمات `daemon=True` في `threading.Thread` يعني أن هذه الخيوط ستتم إغلاقها بمجرد انتهاء البرنامج الرئيسي. ثم نبدأ الخيوط باستخدام `start ()` واستخدم `join ()` لجعل الخيط الرئيسي ينتظر حتى ينتهي خيطي المتتبع.
|
||||
|
||||
أخيرًا ، بعد اكتمال جميع الخيوط لمهمتها ، يتم إغلاق النوافذ التي تعرض النتائج باستخدام `cv2.destroyAllWindows()`.
|
||||
|
||||
!!! Example "Streaming for-loop with tracking"
|
||||
|
||||
```python
|
||||
import threading
|
||||
import cv2
|
||||
from ultralytics import YOLO
|
||||
|
||||
|
||||
def run_tracker_in_thread(filename, model, file_index):
|
||||
"""
|
||||
يشغل ملف فيديو أو مصدر تيار الكاميرا بالتزامن مع YOLOv8 النموذج باستخدام تعدد الخيوط.
|
||||
|
||||
هذه الوظيفة تلتقط إطارات الفيديو من ملف أو مصدر الكاميرا المعروف ، وتستخدم نموذج YOLOv8 لتتبع الكائنات.
|
||||
يعمل البرنامج في خيطه الخاص للمعالجة المتزامنة.
|
||||
|
||||
Args:
|
||||
filename (str): مسار ملف الفيديو أو معرف مصدر كاميرا الويب / خارجية.
|
||||
model (obj): كائن نموذج YOLOv8.
|
||||
file_index (int): مؤشر لتحديد الملف بشكل فريد ، يُستخدم لأغراض العرض.
|
||||
|
||||
ملاحظة:
|
||||
اضغط على 'q' لإنهاء نافذة عرض الفيديو.
|
||||
"""
|
||||
video = cv2.VideoCapture(filename) # قراءة ملف الفيديو
|
||||
|
||||
while True:
|
||||
ret, frame = video.read() # قراءة إطارات الفيديو
|
||||
|
||||
# إنهاء الدورة إذا لم يتبقى إطارات على الفيديوين
|
||||
if not ret:
|
||||
break
|
||||
|
||||
# تتبع كائنات في الإطارات إذا توفرت
|
||||
results = model.track(frame, persist=True)
|
||||
res_plotted = results[0].plot()
|
||||
cv2.imshow(f"Tracking_Stream_{file_index}", res_plotted)
|
||||
|
||||
key = cv2.waitKey(1)
|
||||
if key == ord('q'):
|
||||
break
|
||||
|
||||
# إطلاق مصدري الفيديو
|
||||
video.release()
|
||||
|
||||
|
||||
# حمّل النماذج
|
||||
model1 = YOLO('yolov8n.pt')
|
||||
model2 = YOLO('yolov8n-seg.pt')
|
||||
|
||||
# حدد ملفات الفيديو للمتابعين
|
||||
video_file1 = "path/to/video1.mp4" # مسار ملف الفيديو ، 0 لكاميرا الويب
|
||||
video_file2 = 0 # مسار ملف الفيديو ، 0 لكاميرا الويب ، 1 لكاميرا خارجية
|
||||
|
||||
# إنشاء خيوط المتابع
|
||||
tracker_thread1 = threading.Thread(target=run_tracker_in_thread, args=(video_file1, model1 ,1), daemon=True)
|
||||
tracker_thread2 = threading.Thread(target=run_tracker_in_thread, args=(video_file2, model2, 2), daemon=True)
|
||||
|
||||
# بدء خيوط المتابع
|
||||
tracker_thread1.start()
|
||||
tracker_thread2.start()
|
||||
|
||||
# انتظر حتى ينتهي خيط المتابع
|
||||
tracker_thread1.join()
|
||||
tracker_thread2.join()
|
||||
|
||||
# Clean up and close windows
|
||||
cv2.destroyAllWindows()
|
||||
```
|
||||
|
||||
يمكن بسهولة توسيع هذا المثال للتعامل مع ملفات فيديو ونماذج أخرى من خلال إنشاء مزيد من الخيوط وتطبيق نفس المنهجية.
|
||||
|
||||
## المساهمة في المتتبعون الجديدون
|
||||
|
||||
هل أنت ماهر في التتبع متعدد الكائنات وقد نفذت أو صيغت بنجاح خوارزمية تتبع باستخدام Ultralytics YOLO؟ ندعوك للمشاركة في قسم المتتبعين لدينا في [ultralytics/cfg/trackers](https://github.com/ultralytics/ultralytics/tree/main/ultralytics/cfg/trackers)! قد تكون التطبيقات في العالم الحقيقي والحلول التي تقدمها لا تقدر بثمن للمستخدمين العاملين على مهام التتبع.
|
||||
|
||||
من خلال المساهمة في هذا القسم ، تساعد في توسيع نطاق حلول التتبع المتاحة في إطار Ultralytics YOLO ، مضيفًا طبقة أخرى من الوظائف والفعالية للمجتمع.
|
||||
|
||||
لبدء المساهمة ، يرجى الرجوع إلى [دليل المساهمة الخاص بنا](https://docs.ultralytics.com/help/contributing) للحصول على تعليمات شاملة حول تقديم طلب سحب (PR) 🛠️. نتطلع بشكل كبير إلى ما ستجلبه للطاولة!
|
||||
|
||||
لنعزز معًا قدرات عملية التتبع لأجهزة Ultralytics YOLO 🙏!
|
||||
|
||||
[vehicle track]: https://github.com/RizwanMunawar/ultralytics/assets/62513924/ee6e6038-383b-4f21-ac29-b2a1c7d386ab
|
||||
|
||||
[people track]: https://github.com/RizwanMunawar/ultralytics/assets/62513924/93bb4ee2-77a0-4e4e-8eb6-eb8f527f0527
|
||||
|
||||
[fish track]: https://github.com/RizwanMunawar/ultralytics/assets/62513924/a5146d0f-bfa8-4e0a-b7df-3c1446cd8142
|
2
ultralytics/docs/ar/modes/track.md:Zone.Identifier
Executable file
2
ultralytics/docs/ar/modes/track.md:Zone.Identifier
Executable file
@ -0,0 +1,2 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user