コンテンツへスキップ

モデル・ベンチマークUltralytics YOLO

Ultralytics YOLO エコシステムと統合

はじめに

Once your model is trained and validated, the next logical step is to evaluate its performance in various real-world scenarios. Benchmark mode in Ultralytics YOLO11 serves this purpose by providing a robust framework for assessing the speed and accuracy of your model across a range of export formats.



見るんだ: Ultralytics モードのチュートリアルベンチマーク

なぜベンチマーキングが重要なのか?

  • 情報に基づいた決断:スピードと精度のトレードオフに関する洞察を得る。
  • リソースの割り当て:異なるエクスポート・フォーマットが異なるハードウェア上でどのように動作するかを理解する。
  • 最適化:特定のユースケースに最適なパフォーマンスを提供するエクスポート形式をご覧ください。
  • コスト効率:ベンチマークの結果に基づき、ハードウェアリソースをより効率的に使用します。

ベンチマークモードでの主要指標

対応エクスポート形式

  • ONNX:最適なCPU
  • TensorRT: GPU 効率を最大化する
  • OpenVINO: Intel ハードウェアの最適化
  • CoreML TensorFlow SavedModel など:多様な配備ニーズに対応

チップ

  • ONNX またはOpenVINO にエクスポートして、CPU を最大3倍高速化。
  • TensorRT にエクスポートして、GPU を最大5倍高速化。

使用例

Run YOLO11n benchmarks on all supported export formats including ONNX, TensorRT etc. See Arguments section below for a full list of export arguments.

from ultralytics.utils.benchmarks import benchmark

# Benchmark on GPU
benchmark(model="yolo11n.pt", data="coco8.yaml", imgsz=640, half=False, device=0)
yolo benchmark model=yolo11n.pt data='coco8.yaml' imgsz=640 half=False device=0

論争

などの議論がある。 model, data, imgsz, half, deviceそして verbose は、ベンチマークを特定のニーズに合わせて微調整し、異なるエクスポート形式のパフォーマンスを簡単に比較できる柔軟性をユーザーに提供します。

キーデフォルト値説明
modelNoneモデルファイルへのパスを指定します。以下の両方を受け入れます。 .pt そして .yaml などの形式がある、 "yolo11n.pt" 訓練済みモデルや設定ファイル
dataNonePath to a YAML file defining the dataset for benchmarking, typically including paths and settings for validation data. Example: "coco8.yaml".
imgsz640モデルの入力画像サイズ。正方形画像の場合は1つの整数,正方形画像の場合は1つのタプルになります. (width, height) 非正方形の場合、 (640, 480).
halfFalseFP16(半精度)推論を有効にし、メモリ使用量を削減し、互換性のあるハードウェアでは速度を向上させることができる。使用方法 half=True を有効にする。
int8FalseINT8 量子化を有効にすることで、サポートされているデバイスのパフォーマンスがさらに最適化されます。設定 int8=True を使用する。
deviceNoneベンチマーク用の計算デバイスを定義します。 "cpu", "cuda:0"のようなデバイスのリストがある。 "cuda:0,1" マルチGPU セットアップ用。
verboseFalseロギング出力の詳細レベルを制御する。ブール値。 verbose=True は詳細なログを、float は閾値エラーを表示する。

輸出フォーマット

ベンチマークは、以下のすべての可能なエクスポートフォーマットで自動的に実行されます。

フォーマットformat 議論モデルメタデータ論争
PyTorch-yolo11n.pt-
TorchScripttorchscriptyolo11n.torchscriptimgsz, optimize, batch
ONNXonnxyolo11n.onnximgsz, half, dynamic, simplify, opset, batch
OpenVINOopenvinoyolo11n_openvino_model/imgsz, half, int8, batch
TensorRTengineyolo11n.engineimgsz, half, dynamic, simplify, workspace, int8, batch
CoreMLcoremlyolo11n.mlpackageimgsz, half, int8, nms, batch
TF SavedModelsaved_modelyolo11n_saved_model/imgsz, keras, int8, batch
TF GraphDefpbyolo11n.pbimgsz, batch
TF ライトtfliteyolo11n.tfliteimgsz, half, int8, batch
TF エッジTPUedgetpuyolo11n_edgetpu.tfliteimgsz
TF.jstfjsyolo11n_web_model/imgsz, half, int8, batch
PaddlePaddlepaddleyolo11n_paddle_model/imgsz, batch
NCNNncnnyolo11n_ncnn_model/imgsz, half, batch

詳細を見る export 詳細は 輸出 ページを参照されたい。

よくあるご質問

How do I benchmark my YOLO11 model's performance using Ultralytics?

Ultralytics YOLO11 offers a Benchmark mode to assess your model's performance across different export formats. This mode provides insights into key metrics such as mean Average Precision (mAP50-95), accuracy, and inference time in milliseconds. To run benchmarks, you can use either Python or CLI commands. For example, to benchmark on a GPU:

from ultralytics.utils.benchmarks import benchmark

# Benchmark on GPU
benchmark(model="yolo11n.pt", data="coco8.yaml", imgsz=640, half=False, device=0)
yolo benchmark model=yolo11n.pt data='coco8.yaml' imgsz=640 half=False device=0

ベンチマークの引数の詳細については、引数のセクションをご覧ください。

What are the benefits of exporting YOLO11 models to different formats?

Exporting YOLO11 models to different formats such as ONNX, TensorRT, and OpenVINO allows you to optimize performance based on your deployment environment. For instance:

  • ONNX: CPU 、最大3倍のスピードアップを実現。
  • TensorRT: GPU 、最大5倍のスピードアップを実現。
  • OpenVINO: Specifically optimized for Intel hardware. These formats enhance both the speed and accuracy of your models, making them more efficient for various real-world applications. Visit the Export page for complete details.

Why is benchmarking crucial in evaluating YOLO11 models?

Benchmarking your YOLO11 models is essential for several reasons:

  • 情報に基づいた決断:スピードと精度のトレードオフを理解する。
  • リソースの割り当て:さまざまなハードウェアオプションのパフォーマンスを測定します。
  • 最適化:特定のユースケースに最適なパフォーマンスを提供するエクスポート形式を決定します。
  • Cost Efficiency: Optimize hardware usage based on benchmark results. Key metrics such as mAP50-95, Top-5 accuracy, and inference time help in making these evaluations. Refer to the Key Metrics section for more information.

Which export formats are supported by YOLO11, and what are their advantages?

YOLO11 supports a variety of export formats, each tailored for specific hardware and use cases:

  • ONNX: CPU パフォーマンスに最適。
  • TensorRT: GPU 効率を上げるのに最適。
  • OpenVINO: Intel ハードウェアに最適化。
  • CoreML & TensorFlow: Useful for iOS and general ML applications. For a complete list of supported formats and their respective advantages, check out the Supported Export Formats section.

What arguments can I use to fine-tune my YOLO11 benchmarks?

ベンチマークを実行する際、いくつかの引数を特定のニーズに合わせてカスタマイズすることができる:

  • model: Path to the model file (e.g., "yolo11n.pt").
  • データ:data: データセットを定義するYAMLファイルへのパス(例:"coco8.yaml")。
  • imgsz:入力画像のサイズ。整数またはタプル。
  • 半分:FP16 推論を有効にしてパフォーマンスを向上。
  • int8:エッジデバイスのINT8量子化を有効にする。
  • デバイスを指定する:計算デバイスを指定する(例: "cpu", "cuda:0")。
  • verbose: Control the level of logging detail. For a full list of arguments, refer to the Arguments section.
📅 Created 11 months ago ✏️ Updated 22 days ago

コメント