View in English

  • Apple Developer
    • Get Started

    Explore Get Started

    • Overview
    • Learn
    • Apple Developer Program

    Stay Updated

    • Latest News
    • Hello Developer
    • Platforms

    Explore Platforms

    • Apple Platforms
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store

    Featured

    • Design
    • Distribution
    • Games
    • Accessories
    • Web
    • Home
    • CarPlay
    • Technologies

    Explore Technologies

    • Overview
    • Xcode
    • Swift
    • SwiftUI

    Featured

    • Accessibility
    • App Intents
    • Apple Intelligence
    • Games
    • Machine Learning & AI
    • Security
    • Xcode Cloud
    • Community

    Explore Community

    • Overview
    • Meet with Apple events
    • Community-driven events
    • Developer Forums
    • Open Source

    Featured

    • WWDC
    • Swift Student Challenge
    • Developer Stories
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Centers
    • Documentation

    Explore Documentation

    • Documentation Library
    • Technology Overviews
    • Sample Code
    • Human Interface Guidelines
    • Videos

    Release Notes

    • Featured Updates
    • iOS
    • iPadOS
    • macOS
    • watchOS
    • visionOS
    • tvOS
    • Xcode
    • Downloads

    Explore Downloads

    • All Downloads
    • Operating Systems
    • Applications
    • Design Resources

    Featured

    • Xcode
    • TestFlight
    • Fonts
    • SF Symbols
    • Icon Composer
    • Support

    Explore Support

    • Overview
    • Help Guides
    • Developer Forums
    • Feedback Assistant
    • Contact Us

    Featured

    • Account Help
    • App Review Guidelines
    • App Store Connect Help
    • Upcoming Requirements
    • Agreements and Guidelines
    • System Status
  • Quick Links

    • Events
    • News
    • Forums
    • Sample Code
    • Videos
 

Videos

Abrir menú Cerrar menú
  • Colecciones
  • Todos los videos
  • Información

Más videos

  • Información
  • Código
  • Classify hand poses and actions with Create ML

    With Create ML, your app's ability to understand the expressiveness of the human hand has never been easier. Discover how you can build off the support for Hand Pose Detection in Vision and train custom Hand Pose and Hand Action classifiers using the Create ML app and framework. Learn how simple it is to collect data, train a model, and integrate it with Vision, Camera, and ARKit to create a fun, entertaining app experience.

    To learn more about Create ML and related concepts around model training, check out “Build an Action Classifier with Create ML” from WWDC20. And don't miss “Build dynamic iOS apps with the Create ML framework” to learn how your models can be trained on-the-fly and on device from within your app.

    Recursos

    • Create ML
    • Vision
      • Video HD
      • Video SD

    Videos relacionados

    WWDC23

    • Integrate with motorized iPhone stands using DockKit

    WWDC22

    • Get to know Create ML Components
    • What's new in Create ML

    WWDC21

    • Detect people, faces, and poses using Vision
    • Tuesday@WWDC21
    • Wednesday@WWDC21

    WWDC20

    • Build an Action Classifier with Create ML
    • Detect Body and Hand Pose with Vision
  • Buscar este video…
    • 9:31 - Detecting hands in a frame

      func session(_ session: ARSession, didUpdate frame: ARFrame) {
      
          let pixelBuffer = frame.capturedImage 
          let handPoseRequest = VNDetectHumanHandPoseRequest()
          handPoseRequest.maximumHandCount = 1
          handPoseRequest.revision = VNDetectHumanHandPoseRequestRevision1
      
          let handler = VNImageRequestHandler(cvPixelBuffer: pixelBuffer, options: [:])
          do { 
              try handler.perform([humanBodyPoseRequest]) 
          } catch {
              assertionFailure("Human Pose Request failed: \(error)")
          }
      
          guard let handPoses = request.results, !handPoses.isEmpty else {
              // No effects to draw, so clear out current graphics
              return
          }
          let handObservation = handPoses.first
    • 11:03 - Predicting hand pose

      if frameCounter % handPosePredictionInterval == 0 {
      
          guard let keypointsMultiArray = try? handObservation.keypointsMultiArray() 
      else { fatalError() }
          let handPosePrediction = try model.prediction(poses: keypointsMultiArray)
          let confidence = handPosePrediction.labelProbabilities[handPosePrediction.label]!
      
          if confidence > 0.9 {
             renderHandPoseEffect(name: handPosePrediction.label)
          }
      }
      
      func renderHandPoseEffect(name: String) {
      	switch name {
              case "One": 
                  if effectNode == nil {
                     effectNode = addParticleNode(for: .one)
                  }
              default:
      			removeAllParticleNode()
      	}
      }
    • 12:25 - Getting tip of index finger to use as anchor

      let landmarkConfidenceThreshold: Float = 0.2
      
      let indexFingerName = VNHumanHandPoseObservation.JointName.indexTip
      
      let width = viewportSize.width
      let height = viewportSize.height
      
      if let indexFingerPoint = try? observation.recognizedPoint(indexFingerName),
         indexFingerPoint.confidence > landmarkConfidenceThreshold {
          
          let normalizedLocation = indexFingerPoint.location
          indexFingerTipLocation = CGPoint((x: normalizedLocation.x * width,
                                            y: normalizedLocation.y * height))
      } else {
          indexFingerTipLocation = nil
      }
    • 15:47 - Getting hand chirality

      // Working with chirality
      
      let handPoseRequest = VNDetectHumanHandPoseRequest()
      try handler.perform([handPoseRequest])
      let detectedHandPoses = handPoseRequest.results!
      
      for hand in detectedHandPoses where hand.chirality == .right {
          // Take action on every right hand, or prune the results
      }
    • 22:16 - Hand action classification by accumulating queue of hand poses

      var queue = [MLMultiArray]()
      // . . .
      frameCounter += 1
      if frameCounter % 2 == 0 {
          let hands: [(MLMultiArray, VNHumanHandPoseObservation.Chirality)] = getHands()
          for (pose, chirality) in hands where chirality == .right {
              queue.append(pose)
              queue = Array(queue.suffix(queueSize))
              queueSamplingCounter += 1
              if queue.count == queueSize && queueSamplingCounter % queueSamplingCount == 0 {
                  let poses = MLMultiArray(concatenating: queue, axis: 0, dataType: .float32)
                  let prediction = try? handActionModel?.prediction(poses: poses)
                  guard let label = prediction?.label, 
                    let confidence = prediction?.labelProbabilities[label] else { continue }
                  if confidence > handActionConfidenceThreshold {
                      DispatchQueue.main.async {
                          self.renderer?.renderHandActionEffect(name: label)
                      }
                  }
              }
          }
      }

Developer Footer

  • Videos
  • WWDC21
  • Classify hand poses and actions with Create ML
  • Open Menu Close Menu
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store
    Open Menu Close Menu
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • Icon Composer
    • SF Symbols
    Open Menu Close Menu
    • Accessibility
    • Accessories
    • Apple Intelligence
    • Audio & Video
    • Augmented Reality
    • Business
    • Design
    • Distribution
    • Education
    • Games
    • Health & Fitness
    • In-App Purchase
    • Localization
    • Maps & Location
    • Machine Learning & AI
    • Security
    • Safari & Web
    Open Menu Close Menu
    • Documentation
    • Downloads
    • Sample Code
    • Videos
    Open Menu Close Menu
    • Help Guides & Articles
    • Contact Us
    • Forums
    • Feedback & Bug Reporting
    • System Status
    Open Menu Close Menu
    • Apple Developer
    • App Store Connect
    • Certificates, IDs, & Profiles
    • Feedback Assistant
    Open Menu Close Menu
    • Apple Developer Program
    • Apple Developer Enterprise Program
    • App Store Small Business Program
    • MFi Program
    • Mini Apps Partner Program
    • News Partner Program
    • Video Partner Program
    • Security Bounty Program
    • Security Research Device Program
    Open Menu Close Menu
    • Meet with Apple
    • Apple Developer Centers
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Academies
    • WWDC
    Read the latest news.
    Get the Apple Developer app.
    Copyright © 2026 Apple Inc. All rights reserved.
    Terms of Use Privacy Policy Agreements and Guidelines