示例#1
0
 def facesFactory(image: ImageForRedetection) -> List[Face]:
     faces = [
         Face(image.image.coreImage,
              DetectionFloat(bBox.coreRectF, 1.0))
         for bBox in image.bBoxes
     ]
     return faces
示例#2
0
def _createCoreFaces(image: ImageForRedetection) -> List[Face]:
    """
    Create core faces for redetection
    Args:
        image: image and bounding boxes for redetection
    Returns:
        Face object list. one object for one bbox
    """
    return [Face(image.image.coreImage, DetectionFloat(bBox.coreRectF, 1.0)) for bBox in image.bBoxes]
 def test_estimate_head_pose_by_image_and_bounding_box_empty_bounding_box(self):
     """
     Estimating head pose by image and empty bounding box
     """
     fakeDetection = DetectionFloat(RectFloat(0.0, 0.0, 0.0, 0.0), 0.9)
     bBox = BoundingBox(fakeDetection)
     with pytest.raises(LunaSDKException) as exceptionInfo:
         TestHeadPose.headPoseEstimator.estimateByBoundingBox(bBox, self.image)
     self.assertLunaVlError(exceptionInfo, LunaVLError.InvalidDetection)