Posts

Post not yet marked as solved
0 Replies
394 Views
I use VNDetectHumanBodyPoseRequest to detect body from an image which in xcode assets(I download from image website), But I get error below: 2021-12-24 21:50:19.945976+0800 Guess My Exercise[91308:4258893] [espresso] [Espresso::handle_ex_plan] exception=Espresso exception: "I/O error": Missing weights path cnn_human_pose.espresso.weights status=-2 Unable to perform the request: Error Domain=com.apple.vis Code=9 "Unable to setup request in VNDetectHumanBodyPoseRequest" UserInfo={NSLocalizedDescription=Unable to setup request in VNDetectHumanBodyPoseRequest}. Below is my codes: 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. }
Posted
by zhouxinle.
Last updated
.
Post not yet marked as solved
1 Replies
260 Views
(void)viewDidLayoutSubviews{   [super viewDidLayoutSubviews];   UIButton* button =[[UIButton alloc] initWithFrame:CGRectMake(0, 200, [UIScreen mainScreen].bounds.size.width, 300)];   [button setBackgroundColor:[UIColor orangeColor]];   [button addTarget:self action:@selector(clicked:) forControlEvents:UIControlEventTouchUpInside];     [self.view addSubview:button]; } I just add a UIButton with 300 height. When I run in iphone 6 plus and iphone XR, the UIButton's height in iphone 6 plus is biggger than in iphone XR. Why?
Posted
by zhouxinle.
Last updated
.