Post

Replies

Boosts

Views

Activity

Reply to Action Classifier code
I had the same question, but for one specific part I didn't know how to build. There's a line in the demo code like this: &#9;/// Extracts poses from a frame.   func processFrame(_ samplebuffer: CMSampleBuffer) throws -> [MLMultiArray] {     // Perform Vision body pose request     let framePoses = extractPoses(from: samplebuffer) <---- this &#9;&#9;.... I tried to perform the Vision body pose request as follows:   func extractPoses(from sampleBuffer: CMSampleBuffer) -> [MLMultiArray] {     let requestHandler = VNImageRequestHandler(cmSampleBuffer: sampleBuffer, orientation: .down)     let request = VNDetectHumanBodyPoseRequest(completionHandler: bodyPoseHandler)     do {       // Perform the body pose-detection request.       try requestHandler.perform([request])     } catch {       print("Unable to perform the request: \(error).")     }   } How can I return a VNRecognizedPointsObservation given the request is asynchronous? I could use VNDetectHumanBodyPoseRequest() without the completionHandler but then this doesn't guarantee the result will always be available.. Hope you can help me out!
Jul ’20
Reply to How to transform Vision body tracking coordinates
I fixed the skeleton, it's now visible, but there is considerable lag and jerkiness in the movement. captureConnection?.videoOrientation = .portrait ... let requestHandler = VNImageRequestHandler(cmSampleBuffer: sampleBuffer, orientation: .down) ... var recognizedPoints = recFacePoints.merging(recTorsoPoints) { (current, _) in current } recognizedPoints = recognizedPoints.merging(recLeftArmPoints) { (current, _) in current } recognizedPoints = recognizedPoints.merging(recRightArmPoints) { (current, _) in current } recognizedPoints = recognizedPoints.merging(recLeftLegPoints) { (current, _) in current } recognizedPoints = recognizedPoints.merging(recRightLegPoints) { (current, _) in current } were the changes I made
Jun ’20