feat: 姿态检测和羽毛球检测自动识别 Apple Silicon MPS 加速 - #14
Open
LoicHmh wants to merge 1 commit into
Open
Conversation
设备自动检测此前只判断 torch.cuda.is_available(),在 Mac 上永远回退到 cpu, 没有利用 Apple Silicon 的 MPS/CoreML 加速。现在 CUDA 不可用时会依次检测 MPS: - yolo_pose.py / shuttlecock.py:torch.backends.mps.is_available() 时 device 设为 "mps",Ultralytics YOLO 原生支持该 device 字符串。 - rtmpose.py:device 设为 'mps',rtmlib 会据此选用 onnxruntime 的 CoreMLExecutionProvider(rtmlib/tools/base.py 已内置该映射)。 在 M3 Pro 上实测:yolo-pose 家族处理速度比从纯 CPU 的约 41x 降到约 12x (数字越低越快),约 3-4 倍提速。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ThBPLRKmwxo3JTSSnk7zw3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
yolo_pose.py/shuttlecock.py/rtmpose.py)此前只判断torch.cuda.is_available(),在没有 NVIDIA 显卡的 Mac 上永远回退到 CPU,没有利用 Apple Silicon 的 MPS/CoreML 加速yolo_pose.py/shuttlecock.py:torch.backends.mps.is_available()为真时device设为"mps",Ultralytics YOLO 原生支持该 device 字符串rtmpose.py:device设为'mps',rtmlib会据此选用 onnxruntime 的CoreMLExecutionProvider(rtmlib/tools/base.py中已内置该映射)Test plan
yolo-pose家族,日志确认device: mps被正确选中NMS time limit exceeded性能提示,不影响结果)🤖 Generated with Claude Code
https://claude.ai/code/session_01ThBPLRKmwxo3JTSSnk7zw3