commit
05ab171299
50 changed files with 936 additions and 666 deletions
@ -1,86 +0,0 @@ |
||||
# 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: detect-private-key |
||||
|
||||
- repo: https://github.com/asottile/pyupgrade |
||||
rev: v3.15.0 |
||||
hooks: |
||||
- id: pyupgrade |
||||
name: Upgrade code |
||||
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit |
||||
rev: v0.1.11 |
||||
hooks: |
||||
- id: ruff |
||||
args: [--fix] |
||||
|
||||
- repo: https://github.com/executablebooks/mdformat |
||||
rev: 0.7.17 |
||||
hooks: |
||||
- id: mdformat |
||||
name: MD formatting |
||||
additional_dependencies: |
||||
- mdformat-gfm |
||||
- mdformat-frontmatter |
||||
- mdformat-mkdocs |
||||
args: |
||||
- --wrap=no |
||||
- --number |
||||
exclude: 'docs/.*\.md' |
||||
# exclude: "README.md|README.zh-CN.md|CONTRIBUTING.md" |
||||
|
||||
- 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,ned,strack,dota,ane,segway,fo,gool,winn,commend,bloc,nam,afterall |
||||
|
||||
- repo: https://github.com/hadialqattan/pycln |
||||
rev: v2.4.0 |
||||
hooks: |
||||
- id: pycln |
||||
args: [--all] |
||||
# |
||||
# - 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 |
@ -0,0 +1,14 @@ |
||||
| Argument | Type | Default | Description | |
||||
| ----------- | ---------------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
||||
| `format` | `str` | `'torchscript'` | Target format for the exported model, such as `'onnx'`, `'torchscript'`, `'tensorflow'`, or others, defining compatibility with various deployment environments. | |
||||
| `imgsz` | `int` or `tuple` | `640` | Desired image size for the model input. Can be an integer for square images or a tuple `(height, width)` for specific dimensions. | |
||||
| `keras` | `bool` | `False` | Enables export to Keras format for TensorFlow SavedModel, providing compatibility with TensorFlow serving and APIs. | |
||||
| `optimize` | `bool` | `False` | Applies optimization for mobile devices when exporting to TorchScript, potentially reducing model size and improving performance. | |
||||
| `half` | `bool` | `False` | Enables FP16 (half-precision) quantization, reducing model size and potentially speeding up inference on supported hardware. | |
||||
| `int8` | `bool` | `False` | Activates INT8 quantization, further compressing the model and speeding up inference with minimal accuracy loss, primarily for edge devices. | |
||||
| `dynamic` | `bool` | `False` | Allows dynamic input sizes for ONNX, TensorRT and OpenVINO exports, enhancing flexibility in handling varying image dimensions. | |
||||
| `simplify` | `bool` | `False` | Simplifies the model graph for ONNX exports with `onnxslim`, potentially improving performance and compatibility. | |
||||
| `opset` | `int` | `None` | Specifies the ONNX opset version for compatibility with different ONNX parsers and runtimes. If not set, uses the latest supported version. | |
||||
| `workspace` | `float` | `4.0` | Sets the maximum workspace size in GiB for TensorRT optimizations, balancing memory usage and performance. | |
||||
| `nms` | `bool` | `False` | Adds Non-Maximum Suppression (NMS) to the CoreML export, essential for accurate and efficient detection post-processing. | |
||||
| `batch` | `int` | `1` | Specifies export model batch inference size or the max number of images the exported model will process concurrently in `predict` mode. | |
@ -0,0 +1,15 @@ |
||||
| Format | `format` Argument | Model | Metadata | Arguments | |
||||
| ------------------------------------------------- | ----------------- | ----------------------------------------------- | -------- | -------------------------------------------------------------------- | |
||||
| [PyTorch](https://pytorch.org/) | - | `{{ model_name or "yolov8n" }}.pt` | ✅ | - | |
||||
| [TorchScript](../integrations/torchscript.md) | `torchscript` | `{{ model_name or "yolov8n" }}.torchscript` | ✅ | `imgsz`, `optimize`, `batch` | |
||||
| [ONNX](../integrations/onnx.md) | `onnx` | `{{ model_name or "yolov8n" }}.onnx` | ✅ | `imgsz`, `half`, `dynamic`, `simplify`, `opset`, `batch` | |
||||
| [OpenVINO](../integrations/openvino.md) | `openvino` | `{{ model_name or "yolov8n" }}_openvino_model/` | ✅ | `imgsz`, `half`, `int8`, `batch` | |
||||
| [TensorRT](../integrations/tensorrt.md) | `engine` | `{{ model_name or "yolov8n" }}.engine` | ✅ | `imgsz`, `half`, `dynamic`, `simplify`, `workspace`, `int8`, `batch` | |
||||
| [CoreML](../integrations/coreml.md) | `coreml` | `{{ model_name or "yolov8n" }}.mlpackage` | ✅ | `imgsz`, `half`, `int8`, `nms`, `batch` | |
||||
| [TF SavedModel](../integrations/tf-savedmodel.md) | `saved_model` | `{{ model_name or "yolov8n" }}_saved_model/` | ✅ | `imgsz`, `keras`, `int8`, `batch` | |
||||
| [TF GraphDef](../integrations/tf-graphdef.md) | `pb` | `{{ model_name or "yolov8n" }}.pb` | ❌ | `imgsz`, `batch` | |
||||
| [TF Lite](../integrations/tflite.md) | `tflite` | `{{ model_name or "yolov8n" }}.tflite` | ✅ | `imgsz`, `half`, `int8`, `batch` | |
||||
| [TF Edge TPU](../integrations/edge-tpu.md) | `edgetpu` | `{{ model_name or "yolov8n" }}_edgetpu.tflite` | ✅ | `imgsz` | |
||||
| [TF.js](../integrations/tfjs.md) | `tfjs` | `{{ model_name or "yolov8n" }}_web_model/` | ✅ | `imgsz`, `half`, `int8`, `batch` | |
||||
| [PaddlePaddle](../integrations/paddlepaddle.md) | `paddle` | `{{ model_name or "yolov8n" }}_paddle_model/` | ✅ | `imgsz`, `batch` | |
||||
| [NCNN](../integrations/ncnn.md) | `ncnn` | `{{ model_name or "yolov8n" }}_ncnn_model/` | ✅ | `imgsz`, `half`, `batch` | |
Loading…
Reference in new issue