Я использую VNDetectHumanBodyPoseRequest для обнаружения тела по изображению, которое находится в ресурсах xcode (я загружаю с веб-сайта изображения), но получаю ошибку ниже:
2021- 12-24 21:50:19.945976+0800 Угадай мое упражнение[91308:4258893] [эспрессо] [Espresso::handle_ex_plan] исключение = Исключение эспрессо: «Ошибка ввода-вывода»: отсутствует путь к весам cnn_human_pose.espresso.weights status = -2
Невозможно выполнить запрос: Ошибка Domain=com.apple.vis Code= 9 «Невозможно настроить запрос в VNDetectHumanBodyPoseRequest» UserInfo={NSLocalizedDescription=Невозможно настроить запрос в VNDetectHumanBodyPoseRequest}.
Ниже приведен мой код:
let image = UIImage(named: "image2")
guard let cgImage = image?.cgImage else{return}
let requestHandler = VNImageRequestHandler(cgImage: cgImage)
let request = VNDetectHumanBodyPoseRequest(completionHandler: bodyPoseHandler)
do {
// Perform the body pose-detection request.
try requestHandler.perform([request])
} catch {
print("Unable to perform the request: \(error).")
}
func bodyPoseHandler(request: VNRequest, error: Error?) {
guard let observations =
request.results as? [VNHumanBodyPoseObservation] else {
return
}
let poses = Pose.fromObservations(observations)
self.drawPoses(poses, onto: self.simage!)
// Process each observation to find the recognized body pose points.
}
Подробнее здесь: https://stackoverflow.com/questions/704 ... oserequest