Conversation
|
👋 Hello @asabri97, thank you for submitting a
For more guidance, please refer to our Contributing Guide. Don't hesitate to leave a comment if you have any questions. Thank you for contributing to Ultralytics! 🚀 |
UltralyticsAssistant
left a comment
There was a problem hiding this comment.
🔍 PR Review
Made with ❤️ by Ultralytics Actions
The SpriteKit overlay looks great, but right now those two call sites rebuild the entire mask — and reload every texture — on each frame/inference. Reusing a single ArticulatedSkeletonMask (or its textures) will prevent the skeleton overlay from becoming the dominant performance cost.
💬 Posted 2 inline comments
📋 Skipped 15 files (lock files, minified, images, etc.)
Sources/YOLO/YOLOView.swift
Outdated
|
|
||
| // Ensure skeleton view is properly configured | ||
| skeletonView.frame = self.overlayLayer.frame | ||
|
|
There was a problem hiding this comment.
ArticulatedSkeletonMask() is recreated for every frame. Each initializer reloads all 15 textures from disk, so this path will be hit dozens of times per second and will quickly become the hottest point in the render loop. Please cache a single mask (or at least its textures) and reuse it instead of instantiating a new one here.
|
|
||
| let imageSize = CGSize(width: ciImage.extent.width, height: ciImage.extent.height) | ||
|
|
||
| // Create articulated skeleton scene |
There was a problem hiding this comment.
ArticulatedSkeletonMask() is constructed on every inference pass (also in createRealisticSkeletonImage). The initializer reloads every texture from the asset catalog, so running pose on live video will thrash the main thread and I/O. Please cache one mask instance (or share its textures) on the estimator and reuse it across calls.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
Adds a new real-time, articulated “X-ray” skeleton visualization for pose results using SpriteKit, plus external display and model-loading reliability improvements. 🦴✨
📊 Key Changes
SkeletonUtilities(geometry, effects, texture loading) andSkeletonMaskprotocol.ArticulatedSkeletonMaskto assemble body parts (head, torso, arms, legs, feet) from assets and pose keypoints.useRealisticSkeleton(toggle),skeletonConfThreshold,skeletonType.SKViewoverlay (skeletonView) for real-time skeleton scenes in Pose task.hasExternalDisplaysupporting iOS 16+ APIs with graceful fallback.🎯 Purpose & Impact
PoseEstimator.useRealisticSkeletonand adjustableskeletonConfThreshold.