Default `simplify=True` (#16435)

pull/16448/head
inisis 2 months ago committed by GitHub
parent 23e79e4e1f
commit 8b8c25f216
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      docs/en/macros/export-args.md
  2. 2
      ultralytics/cfg/default.yaml
  3. 1
      ultralytics/utils/benchmarks.py

@ -7,7 +7,7 @@
| `half` | `bool` | `False` | Enables FP16 (half-precision) quantization, reducing model size and potentially speeding up inference on supported hardware. | | `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. | | `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. | | `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. | | `simplify` | `bool` | `True` | 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. | | `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. | | `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. | | `nms` | `bool` | `False` | Adds Non-Maximum Suppression (NMS) to the CoreML export, essential for accurate and efficient detection post-processing. |

@ -81,7 +81,7 @@ keras: False # (bool) use Kera=s
optimize: False # (bool) TorchScript: optimize for mobile optimize: False # (bool) TorchScript: optimize for mobile
int8: False # (bool) CoreML/TF INT8 quantization int8: False # (bool) CoreML/TF INT8 quantization
dynamic: False # (bool) ONNX/TF/TensorRT: dynamic axes dynamic: False # (bool) ONNX/TF/TensorRT: dynamic axes
simplify: False # (bool) ONNX: simplify model using `onnxslim` simplify: True # (bool) ONNX: simplify model using `onnxslim`
opset: # (int, optional) ONNX: opset version opset: # (int, optional) ONNX: opset version
workspace: 4 # (int) TensorRT: workspace size (GB) workspace: 4 # (int) TensorRT: workspace size (GB)
nms: False # (bool) CoreML: add NMS nms: False # (bool) CoreML: add NMS

@ -365,7 +365,6 @@ class ProfileModels:
onnx_file = model.export( onnx_file = model.export(
format="onnx", format="onnx",
imgsz=self.imgsz, imgsz=self.imgsz,
simplify=True,
device=self.device, device=self.device,
verbose=False, verbose=False,
) )

Loading…
Cancel
Save