Link to this section姿勢推定#
姿勢推定は、画像内の特定の点(通常はキーポイントと呼ばれます)の位置を特定するタスクです。キーポイントは、関節、ランドマーク、その他の特徴的な部分など、オブジェクトのさまざまな部分を表すことができます。キーポイントの位置は、通常、2Dの [x, y] 座標セットとして表現され、オプションで可視フラグ [x, y, visible] が付加されます。
姿勢推定モデルの出力は、画像内のオブジェクト上のキーポイントを表す一連の点であり、通常は各点の信頼度スコアが伴います。姿勢推定は、シーン内のオブジェクトの特定のパーツや、それらの相互の相対的な位置を特定する必要がある場合に適した選択肢です。
Watch: How to Run Real-Time Pose Estimation with Ultralytics YOLO26 | Tracking & Keypoints Extraction 🕺
YOLO26 pose モデルは、-pose サフィックスを使用します(例: yolo26n-pose.pt)。これらのモデルは COCO keypoints データセットでトレーニングされており、さまざまな姿勢推定タスクに適しています。
デフォルトの YOLO26 pose モデルには17個のキーポイントがあり、それぞれが人体の異なる部位を表しています。各インデックスと対応する関節のマッピングは以下の通りです。
- 鼻
- 左目
- 右目
- 左耳
- 右耳
- 左肩
- 右肩
- 左肘
- 右肘
- 左手首
- 右手首
- 左腰
- 右腰
- 左膝
- 右膝
- 左足首
- 右足首
Link to this sectionモデル#
Ultralytics YOLO26 事前学習済み Pose モデルを以下に示します。Detect、Segment、Pose モデルは COCO データセットで事前学習されており、Semantic モデルは Cityscapes で事前学習され、Classify モデルは ImageNet データセットで事前学習されています。
モデル は、初回使用時に最新の Ultralytics リリース から自動的にダウンロードされます。
| モデル | サイズ (ピクセル) | mAPpose 50-95(e2e) | mAPpose 50(e2e) | 速度 CPU ONNX (ms) | 速度 T4 TensorRT10 (ms) | パラメータ (M) | FLOPs (B) |
|---|---|---|---|---|---|---|---|
| YOLO26n-pose | 640 | 57.2 | 83.3 | 40.3 ± 0.5 | 1.8 ± 0.0 | 2.9 | 7.5 |
| YOLO26s-pose | 640 | 63.0 | 86.6 | 85.3 ± 0.9 | 2.7 ± 0.0 | 10.4 | 23.9 |
| YOLO26m-pose | 640 | 68.8 | 89.6 | 218.0 ± 1.5 | 5.0 ± 0.1 | 21.5 | 73.1 |
| YOLO26l-pose | 640 | 70.4 | 90.5 | 275.4 ± 2.4 | 6.5 ± 0.1 | 25.9 | 91.3 |
| YOLO26x-pose | 640 | 71.6 | 91.6 | 565.4 ± 3.0 | 12.2 ± 0.2 | 57.6 | 201.7 |
- mAPval の値は、COCO Keypoints val2017 データセットにおける単一モデル・シングルスケールの値です。
再現手順:yolo val pose data=coco-pose.yaml device=0 - 速度は、Amazon EC2 P4d インスタンスを使用して COCO val 画像で平均したものです。
再現手順:yolo val pose data=coco-pose.yaml batch=1 device=0|cpu - Params および FLOPs の値は、
model.fuse()後の融合済みモデルに対するものです。これは Conv 層と BatchNorm 層を統合し、エンドツーエンドモデルの場合は補助的な one-to-many 検出ヘッドを削除します。事前学習済みのチェックポイントは、完全なトレーニングアーキテクチャを保持しているため、数値が大きく表示される場合があります。
Link to this sectionトレーニング#
YOLO26-pose モデルを COCO8-pose データセットでトレーニングします。COCO8-pose データセット は、姿勢推定モデルのテストやデバッグに最適な小規模サンプルデータセットです。
from ultralytics import YOLO
# Load a model
model = YOLO("yolo26n-pose.yaml") # build a new model from YAML
model = YOLO("yolo26n-pose.pt") # load a pretrained model (recommended for training)
model = YOLO("yolo26n-pose.yaml").load("yolo26n-pose.pt") # build from YAML and transfer weights
# Train the model
results = model.train(data="coco8-pose.yaml", epochs=100, imgsz=640)train モードの詳細については、Train ページをご覧ください。Pose モデルは Ultralytics Platform を通じてクラウド GPU 上でトレーニングすることも可能です。
Link to this sectionデータセット形式#
YOLO pose データセットの形式については、Dataset Guide で詳しく解説しています。既存のデータセットを他の形式(COCO など)から YOLO 形式に変換するには、Ultralytics が提供する JSON2YOLO ツールをご利用ください。Ultralytics Platform は、人物、手、顔、カスタムキーポイントレイアウト用の組み込みスケルトンテンプレートを使用した姿勢アノテーションもサポートしています。
カスタム姿勢推定タスクについては、動物の姿勢推定用の Tiger-Pose、手追跡用の Hand Keypoints、犬の姿勢分析用の Dog-Pose などの専門的なデータセットも検討してください。
Link to this section検証#
Validate trained YOLO26n-pose model accuracy on the COCO8-pose dataset. No arguments are needed as the model retains its training data and arguments as model attributes.
from ultralytics import YOLO
# Load a model
model = YOLO("yolo26n-pose.pt") # load an official model
model = YOLO("path/to/best.pt") # load a custom model
# Validate the model
metrics = model.val() # no arguments needed, dataset and settings remembered
metrics.box.map # map50-95
metrics.box.map50 # map50
metrics.box.map75 # map75
metrics.box.maps # a list containing mAP50-95 for each category
metrics.box.image_metrics # per-image metrics dictionary for box with precision, recall, F1, TP, FP, and FN
metrics.pose.map # map50-95(P)
metrics.pose.map50 # map50(P)
metrics.pose.map75 # map75(P)
metrics.pose.maps # a list containing mAP50-95(P) for each category
metrics.pose.image_metrics # per-image metrics dictionary for pose with precision, recall, F1, TP, FP, and FNLink to this section予測#
トレーニング済みの YOLO26n-pose モデルを使用して画像に対する予測を実行します。predict モード を使用すると、画像、ビデオ、リアルタイムストリームに対する推論が可能になります。
from ultralytics import YOLO
# Load a model
model = YOLO("yolo26n-pose.pt") # load an official model
model = YOLO("path/to/best.pt") # load a custom model
# Predict with the model
results = model("https://ultralytics.com/images/bus.jpg") # predict on an image
# Access the results
for result in results:
xy = result.keypoints.xy # x and y coordinates
xyn = result.keypoints.xyn # normalized
kpts = result.keypoints.data # x, y, visibility (if available)predictモードの詳細については、予測(Predict)ページを参照してください。
Link to this section結果の出力#
姿勢推定は、画像ごとに1つの Results オブジェクトを返します。主な予測フィールドは、姿勢座標用の result.keypoints と、それらのキーポイントが属する検出済みインスタンス用の result.boxes です。
| 属性 | タイプ | 形状 | 説明 |
|---|---|---|---|
result.keypoints | Keypoints | (N) | キーポイント。 |
result.keypoints.data | torch.float32 | (N,K,2/3) | x,y およびオプションの可視性/信頼度。 |
result.keypoints.xy | torch.float32 | (N,K,2) | ピクセル単位のキーポイント。 |
result.keypoints.xyn | torch.float32 | (N,K,2) | 正規化されたキーポイント。 |
result.boxes | Boxes | (N) | インスタンスボックス。 |
すべてのタスクにわたるタスク固有のResultsフィールドについては、タスク別予測結果(Predict Results by Task)セクションを参照してください。
Link to this sectionエクスポート#
YOLO26n Pose モデルを ONNX、CoreML などの異なる形式にエクスポートします。これにより、リアルタイム推論 のために、さまざまなプラットフォームやデバイスにモデルをデプロイできます。
from ultralytics import YOLO
# Load a model
model = YOLO("yolo26n-pose.pt") # load an official model
model = YOLO("path/to/best.pt") # load a custom-trained model
# Export the model
model.export(format="onnx")利用可能な YOLO26-pose エクスポート形式は以下の表の通りです。format 引数(例: format='onnx' や format='engine')を使用して、任意の形式にエクスポートできます。エクスポートされたモデルで直接予測や検証を実行することも可能です(例: yolo predict model=yolo26n-pose.onnx)。エクスポート完了後、モデルの使用例が表示されます。
| 形式 | format引数 | モデル | メタデータ | 引数 |
|---|---|---|---|---|
| PyTorch | - | yolo26n-pose.pt | ✅ | - |
| TorchScript | torchscript | yolo26n-pose.torchscript | ✅ | imgsz, half, dynamic, optimize, nms, batch, device |
| ONNX | onnx | yolo26n-pose.onnx | ✅ | imgsz, half, int8, dynamic, simplify, opset, nms, batch, data, fraction, device |
| OpenVINO | openvino | yolo26n-pose_openvino_model/ | ✅ | imgsz, half, dynamic, int8, nms, batch, data, fraction, device |
| TensorRT | engine | yolo26n-pose.engine | ✅ | imgsz, half, dynamic, simplify, workspace, int8, nms, batch, data, fraction, device |
| CoreML | coreml | yolo26n-pose.mlpackage | ✅ | imgsz, dynamic, half, int8, nms, batch, device |
| TF SavedModel | saved_model | yolo26n-pose_saved_model/ | ✅ | imgsz, keras, int8, nms, batch, data, fraction, device |
| TF GraphDef | pb | yolo26n-pose.pb | ❌ | imgsz, batch, device |
| TF Lite | tflite | yolo26n-pose.tflite | ✅ | imgsz, half, int8, nms, batch, data, fraction, device |
| TF Edge TPU | edgetpu | yolo26n-pose_edgetpu.tflite | ✅ | imgsz, int8, data, fraction, device |
| TF.js | tfjs | yolo26n-pose_web_model/ | ✅ | imgsz, half, int8, nms, batch, data, fraction, device |
| PaddlePaddle | paddle | yolo26n-pose_paddle_model/ | ✅ | imgsz, batch, device |
| MNN | mnn | yolo26n-pose.mnn | ✅ | imgsz, batch, int8, half, device |
| NCNN | ncnn | yolo26n-pose_ncnn_model/ | ✅ | imgsz, half, batch, device |
| IMX500 | imx | yolo26n-pose_imx_model/ | ✅ | imgsz, int8, data, fraction, nms, device |
| RKNN | rknn | yolo26n-pose_rknn_model/ | ✅ | imgsz, batch, name, int8, data, fraction, device |
| ExecuTorch | executorch | yolo26n-pose_executorch_model/ | ✅ | imgsz, batch, device |
| Axelera | axelera | yolo26n-pose_axelera_model/ | ✅ | imgsz, batch, int8, data, fraction, device |
| DEEPX | deepx | yolo26n-pose_deepx_model/ | ✅ | imgsz, int8, data, optimize, device |
| Qualcomm QNN | qnn | yolo26n-pose_qnn_model/ | ✅ | imgsz, batch, name, int8, data, fraction, device |
exportの詳細については、Exportページを参照してください。
Link to this sectionよくある質問 (FAQ)#
Link to this sectionUltralytics YOLO26 による姿勢推定とは何か、またその仕組みは?#
Pose estimation with Ultralytics YOLO26 involves identifying specific points, known as keypoints, in an image. These keypoints typically represent joints or other important features of the object. The output includes the [x, y] coordinates and confidence scores for each point. YOLO26-pose models are specifically designed for this task and use the -pose suffix, such as yolo26n-pose.pt. These models are pretrained on datasets like COCO keypoints and can be used for various pose estimation tasks. For more information, visit the Pose Estimation Page.
Link to this sectionYOLO26-pose モデルをカスタムデータセットでトレーニングするには?#
YOLO26-pose モデルをカスタムデータセットでトレーニングするには、YAML ファイルで定義された新しいモデル、または事前学習済みモデルのいずれかをロードします。その後、指定したデータセットとパラメータを使用してトレーニングプロセスを開始できます。
from ultralytics import YOLO
# Load a model
model = YOLO("yolo26n-pose.yaml") # build a new model from YAML
model = YOLO("yolo26n-pose.pt") # load a pretrained model (recommended for training)
# Train the model
results = model.train(data="your-dataset.yaml", epochs=100, imgsz=640)トレーニングの詳細については、Train セクション を参照してください。Ultralytics Platform を使用すれば、コードなしでカスタム姿勢推定モデルをトレーニングすることも可能です。
Link to this sectionトレーニング済みの YOLO26-pose モデルを検証するには?#
YOLO26-pose モデルの検証では、トレーニング中に保持されたのと同じデータセットパラメータを使用して精度を評価します。以下に例を示します。
from ultralytics import YOLO
# Load a model
model = YOLO("yolo26n-pose.pt") # load an official model
model = YOLO("path/to/best.pt") # load a custom model
# Validate the model
metrics = model.val() # no arguments needed, dataset and settings remembered詳細については、Val セクション をご覧ください。
Link to this sectionYOLO26-pose モデルを他の形式にエクスポートできますか?またその方法は?#
はい、YOLO26-pose モデルは ONNX、CoreML、TensorRT など、さまざまな形式にエクスポートできます。これは Python またはコマンドラインインターフェース (CLI) を使用して実行できます。
from ultralytics import YOLO
# Load a model
model = YOLO("yolo26n-pose.pt") # load an official model
model = YOLO("path/to/best.pt") # load a custom-trained model
# Export the model
model.export(format="onnx")Refer to the Export Section for more details. Exported models can be deployed on edge devices for real-time applications like fitness tracking, sports analysis, or robotics.
Link to this section利用可能な Ultralytics YOLO26-pose モデルとそのパフォーマンス指標は?#
Ultralytics YOLO26 では、YOLO26n-pose、YOLO26s-pose、YOLO26m-pose など、さまざまな事前学習済み Pose モデルを提供しています。これらのモデルはサイズ、精度 (mAP)、速度が異なります。例えば、YOLO26n-pose モデルは mAPpose50-95 で 57.2、mAPpose50 で 83.3 を達成しています。リストやパフォーマンスの詳細については、Models セクション をご覧ください。