Synthpose Vitpose Huge Hf
SynthPoseはVitPose巨大バックボーンネットワークを基にしたキーポイント検出モデルで、合成データによるファインチューニングにより52の人体キーポイントを予測し、運動学分析に適しています。
ダウンロード数 1,320
リリース時間 : 1/10/2025
モデル概要
このモデルはVitPose巨大バックボーンネットワークを採用し、合成データによるファインチューニングにより、COCOキーポイントを含む52の解剖学的マーカーポイントを予測でき、特にモーションキャプチャや生体力学分析のシナリオに適しています。
モデル特徴
高密度キーポイント予測
17の標準COCOキーポイントと35の追加生体力学分析用キーポイントを含む52の解剖学的マーカーポイントを予測可能
合成データによるファインチューニング
合成データを使用して事前学習済みモデルをファインチューニングし、特定のキーポイントセットに対する予測精度を向上
2段階検出プロセス
最初に人体バウンディングボックスを検出し、その後キーポイントを予測することで検出精度を向上
モデル能力
人体キーポイント検出
運動学分析
生体力学マーカーポイント予測
複数人姿勢推定
使用事例
モーションキャプチャ
運動生体力学分析
アスリートの動作姿勢を分析し、正確な関節角度と運動軌跡データを提供
52の解剖学的マーカーポイントの正確な位置を出力可能
医療リハビリ
リハビリ訓練モニタリング
患者のリハビリ訓練中の動作姿勢変化を監視
治療効果評価のための詳細な関節運動データを提供
🚀 SynthPose (Transformers 🤗 VitPose Huge variant)
SynthPoseモデルは、Yoni Gozlan、Antoine Falisse、Scott Uhlrich、Anthony Gatti、Michael Black、Akshay ChaudhariによるOpenCapBench: A Benchmark to Bridge Pose Estimation and Biomechanicsで提案されました。 このモデルはYoni Gozlanによって貢献されました。
🚀 クイックスタート
このセクションでは、SynthPoseモデルの概要と使用方法について説明します。
✨ 主な機能
- このモデルはVitPose Hugeのバックボーンを使用しています。
- SynthPoseは、合成データを使用することで、事前学習された2D人体姿勢モデルを微調整し、任意に高密度なキーポイントセットを予測し、正確な運動学的分析を行うことができる新しいアプローチです。
- この特定のバリアントは、通常モーションキャプチャセットアップで見られるキーポイントセットで微調整されており、COCOキーポイントも含まれています。
📚 ドキュメント
想定される使用ケース
このモデルはVitPose Hugeのバックボーンを使用しています。SynthPoseは、合成データを使用することで、事前学習された2D人体姿勢モデルを微調整し、任意に高密度なキーポイントセットを予測し、正確な運動学的分析を行うことができる新しいアプローチです。詳細については、OpenCapBench: A Benchmark to Bridge Pose Estimation and Biomechanicsを参照してください。この特定のバリアントは、通常モーションキャプチャセットアップで見られるキーポイントセットで微調整されており、COCOキーポイントも含まれています。
モデルは以下の52個のマーカーを予測します。
{
0: "Nose",
1: "L_Eye",
2: "R_Eye",
3: "L_Ear",
4: "R_Ear",
5: "L_Shoulder",
6: "R_Shoulder",
7: "L_Elbow",
8: "R_Elbow",
9: "L_Wrist",
10: "R_Wrist",
11: "L_Hip",
12: "R_Hip",
13: "L_Knee",
14: "R_Knee",
15: "L_Ankle",
16: "R_Ankle",
17: "sternum",
18: "rshoulder",
19: "lshoulder",
20: "r_lelbow",
21: "l_lelbow",
22: "r_melbow",
23: "l_melbow",
24: "r_lwrist",
25: "l_lwrist",
26: "r_mwrist",
27: "l_mwrist",
28: "r_ASIS",
29: "l_ASIS",
30: "r_PSIS",
31: "l_PSIS",
32: "r_knee",
33: "l_knee",
34: "r_mknee",
35: "l_mknee",
36: "r_ankle",
37: "l_ankle",
38: "r_mankle",
39: "l_mankle",
40: "r_5meta",
41: "l_5meta",
42: "r_toe",
43: "l_toe",
44: "r_big_toe",
45: "l_big_toe",
46: "l_calc",
47: "r_calc",
48: "C7",
49: "L2",
50: "T11",
51: "T6",
}
最初の17個のキーポイントはCOCOキーポイントで、次の35個は解剖学的マーカーです。
使用方法
画像推論
以下は、モデルをロードして画像に対して推論を実行する方法です。
import torch
import requests
import numpy as np
from PIL import Image
from transformers import (
AutoProcessor,
RTDetrForObjectDetection,
VitPoseForPoseEstimation,
)
device = "cuda" if torch.cuda.is_available() else "cpu"
url = "http://farm4.staticflickr.com/3300/3416216247_f9c6dfc939_z.jpg"
image = Image.open(requests.get(url, stream=True).raw)
# ------------------------------------------------------------------------
# Stage 1. Detect humans on the image
# ------------------------------------------------------------------------
# You can choose detector by your choice
person_image_processor = AutoProcessor.from_pretrained("PekingU/rtdetr_r50vd_coco_o365")
person_model = RTDetrForObjectDetection.from_pretrained("PekingU/rtdetr_r50vd_coco_o365", device_map=device)
inputs = person_image_processor(images=image, return_tensors="pt").to(device)
with torch.no_grad():
outputs = person_model(**inputs)
results = person_image_processor.post_process_object_detection(
outputs, target_sizes=torch.tensor([(image.height, image.width)]), threshold=0.3
)
result = results[0] # take first image results
# Human label refers 0 index in COCO dataset
person_boxes = result["boxes"][result["labels"] == 0]
person_boxes = person_boxes.cpu().numpy()
# Convert boxes from VOC (x1, y1, x2, y2) to COCO (x1, y1, w, h) format
person_boxes[:, 2] = person_boxes[:, 2] - person_boxes[:, 0]
person_boxes[:, 3] = person_boxes[:, 3] - person_boxes[:, 1]
# ------------------------------------------------------------------------
# Stage 2. Detect keypoints for each person found
# ------------------------------------------------------------------------
image_processor = AutoProcessor.from_pretrained("yonigozlan/synthpose-vitpose-huge-hf")
model = VitPoseForPoseEstimation.from_pretrained("yonigozlan/synthpose-vitpose-huge-hf", device_map=device)
inputs = image_processor(image, boxes=[person_boxes], return_tensors="pt").to(device)
with torch.no_grad():
outputs = model(**inputs)
pose_results = image_processor.post_process_pose_estimation(outputs, boxes=[person_boxes])
image_pose_result = pose_results[0] # results for first image
視覚化(監督ユーザー向け)
import supervision as sv
xy = torch.stack([pose_result['keypoints'] for pose_result in image_pose_result]).cpu().numpy()
scores = torch.stack([pose_result['scores'] for pose_result in image_pose_result]).cpu().numpy()
key_points = sv.KeyPoints(
xy=xy, confidence=scores
)
vertex_annotator = sv.VertexAnnotator(
color=sv.Color.PINK,
radius=2
)
annotated_frame = vertex_annotator.annotate(
scene=image.copy(),
key_points=key_points
)
annotated_frame
高度な手動視覚化
import math
import cv2
def draw_points(image, keypoints, scores, pose_keypoint_color, keypoint_score_threshold, radius, show_keypoint_weight):
if pose_keypoint_color is not None:
assert len(pose_keypoint_color) == len(keypoints)
for kid, (kpt, kpt_score) in enumerate(zip(keypoints, scores)):
x_coord, y_coord = int(kpt[0]), int(kpt[1])
if kpt_score > keypoint_score_threshold:
color = tuple(int(c) for c in pose_keypoint_color[kid])
if show_keypoint_weight:
cv2.circle(image, (int(x_coord), int(y_coord)), radius, color, -1)
transparency = max(0, min(1, kpt_score))
cv2.addWeighted(image, transparency, image, 1 - transparency, 0, dst=image)
else:
cv2.circle(image, (int(x_coord), int(y_coord)), radius, color, -1)
def draw_links(image, keypoints, scores, keypoint_edges, link_colors, keypoint_score_threshold, thickness, show_keypoint_weight, stick_width = 2):
height, width, _ = image.shape
if keypoint_edges is not None and link_colors is not None:
assert len(link_colors) == len(keypoint_edges)
for sk_id, sk in enumerate(keypoint_edges):
x1, y1, score1 = (int(keypoints[sk[0], 0]), int(keypoints[sk[0], 1]), scores[sk[0]])
x2, y2, score2 = (int(keypoints[sk[1], 0]), int(keypoints[sk[1], 1]), scores[sk[1]])
if (
x1 > 0
and x1 < width
and y1 > 0
and y1 < height
and x2 > 0
and x2 < width
and y2 > 0
and y2 < height
and score1 > keypoint_score_threshold
and score2 > keypoint_score_threshold
):
color = tuple(int(c) for c in link_colors[sk_id])
if show_keypoint_weight:
X = (x1, x2)
Y = (y1, y2)
mean_x = np.mean(X)
mean_y = np.mean(Y)
length = ((Y[0] - Y[1]) ** 2 + (X[0] - X[1]) ** 2) ** 0.5
angle = math.degrees(math.atan2(Y[0] - Y[1], X[0] - X[1]))
polygon = cv2.ellipse2Poly(
(int(mean_x), int(mean_y)), (int(length / 2), int(stick_width)), int(angle), 0, 360, 1
)
cv2.fillConvexPoly(image, polygon, color)
transparency = max(0, min(1, 0.5 * (keypoints[sk[0], 2] + keypoints[sk[1], 2])))
cv2.addWeighted(image, transparency, image, 1 - transparency, 0, dst=image)
else:
cv2.line(image, (x1, y1), (x2, y2), color, thickness=thickness)
# Note: keypoint_edges and color palette are dataset-specific
keypoint_edges = model.config.edges
palette = np.array(
[
[255, 128, 0],
[255, 153, 51],
[255, 178, 102],
[230, 230, 0],
[255, 153, 255],
[153, 204, 255],
[255, 102, 255],
[255, 51, 255],
[102, 178, 255],
[51, 153, 255],
[255, 153, 153],
[255, 102, 102],
[255, 51, 51],
[153, 255, 153],
[102, 255, 102],
[51, 255, 51],
[0, 255, 0],
[0, 0, 255],
[255, 0, 0],
[255, 255, 255],
]
)
link_colors = palette[[0, 0, 0, 0, 7, 7, 7, 9, 9, 9, 9, 9, 16, 16, 16, 16, 16, 16, 16]]
keypoint_colors = palette[[16, 16, 16, 16, 16, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0]+[4]*(52-17)]
numpy_image = np.array(image)
for pose_result in image_pose_result:
scores = np.array(pose_result["scores"])
keypoints = np.array(pose_result["keypoints"])
# draw each point on image
draw_points(numpy_image, keypoints, scores, keypoint_colors, keypoint_score_threshold=0.3, radius=2, show_keypoint_weight=False)
# draw links
draw_links(numpy_image, keypoints, scores, keypoint_edges, link_colors, keypoint_score_threshold=0.3, thickness=1, show_keypoint_weight=False)
pose_image = Image.fromarray(numpy_image)
pose_image
📄 ライセンス
このプロジェクトはApache-2.0ライセンスの下で提供されています。
Superpoint
その他
SuperPointは、自己教師あり学習で訓練された全畳み込みネットワークで、関心点検出と記述に使用されます。
姿勢推定
Transformers

S
magic-leap-community
59.12k
13
Vitpose Base Simple
Apache-2.0
ViTPoseは視覚Transformerベースの人体姿勢推定モデルで、MS COCOキーポイントテストセットで81.1 APの精度を達成し、モデルの簡潔さ、スケーラビリティ、トレーニングの柔軟性などの利点があります
姿勢推定
Transformers 英語

V
usyd-community
51.40k
20
Vitpose Plus Small
Apache-2.0
ViTPose++はビジョントランスフォーマーを基盤とした人体姿勢推定モデルで、MS COCOキーポイント検出ベンチマークで81.1 APの優れた性能を達成しました。
姿勢推定
Transformers

V
usyd-community
30.02k
2
Vitpose Plus Base
Apache-2.0
ViTPoseは視覚Transformerベースの人体姿勢推定モデルで、シンプルな設計によりMS COCOキーポイント検出ベンチマークで81.1 APの優れた性能を達成しました。
姿勢推定
Transformers 英語

V
usyd-community
22.26k
10
Superglue Outdoor
その他
SuperGlueはグラフニューラルネットワークベースの特徴マッチングモデルで、画像中の関心点をマッチングするために使用され、画像マッチングや姿勢推定タスクに適しています。
姿勢推定
Transformers

S
magic-leap-community
18.39k
2
Vitpose Plus Huge
Apache-2.0
ViTPose++はビジョントランスフォーマーを基盤とした人体姿勢推定の基本モデルで、MS COCOキーポイントテストセットで81.1 APという優れた性能を達成しました。
姿勢推定
Transformers

V
usyd-community
14.49k
6
Img2pose
img2poseはFaster R-CNNベースのモデルで、写真内の全ての顔の6自由度姿勢(6DoF)を予測し、3D顔を2D平面に投影できます。
姿勢推定
Safetensors
I
py-feat
4,440
0
Vitpose Plus Large
Apache-2.0
ViTPose++はビジョントランスフォーマーに基づく人体姿勢推定の基本モデルで、MS COCOキーポイントテストセットで81.1 APの優れた性能を達成しました。
姿勢推定
Transformers

V
usyd-community
1,731
1
Synthpose Vitpose Huge Hf
Apache-2.0
SynthPoseはVitPose巨大バックボーンネットワークを基にしたキーポイント検出モデルで、合成データによるファインチューニングにより52の人体キーポイントを予測し、運動学分析に適しています。
姿勢推定
Transformers

S
stanfordmimi
1,320
1
Sapiens Pose 1b Torchscript
Sapiensは3億枚の1024x1024解像度人体画像で事前学習された視覚Transformerモデルで、高精度な姿勢推定タスクのために設計されています。
姿勢推定 英語
S
facebook
1,245
7
おすすめAIモデル
Llama 3 Typhoon V1.5x 8b Instruct
タイ語専用に設計された80億パラメータの命令モデルで、GPT-3.5-turboに匹敵する性能を持ち、アプリケーションシナリオ、検索拡張生成、制限付き生成、推論タスクを最適化
大規模言語モデル
Transformers 複数言語対応

L
scb10x
3,269
16
Cadet Tiny
Openrail
Cadet-TinyはSODAデータセットでトレーニングされた超小型対話モデルで、エッジデバイス推論向けに設計されており、体積はCosmo-3Bモデルの約2%です。
対話システム
Transformers 英語

C
ToddGoldfarb
2,691
6
Roberta Base Chinese Extractive Qa
RoBERTaアーキテクチャに基づく中国語抽出型QAモデルで、与えられたテキストから回答を抽出するタスクに適しています。
質問応答システム 中国語
R
uer
2,694
98