PHP 클래스 Google\Cloud\Vision\Annotation\Face

Example: use Google\Cloud\ServiceBuilder; $cloud = new ServiceBuilder(); $vision = $cloud->vision(); $imageResource = fopen(__DIR__ .'/assets/family-photo.jpg', 'r'); $image = $vision->image($imageResource, [ 'FACE_DETECTION' ]); $annotation = $vision->annotate($image); $faces = $annotation->faces(); $face = $faces[0];
또한 보기: https://cloud.google.com/vision/reference/rest/v1/images/annotate#faceannotation FaceAnnotation
상속: extends AbstractFeature, use trait Google\Cloud\CallTrait, use trait LikelihoodTrait
파일 보기 프로젝트 열기: GoogleCloudPlatform/gcloud-php

공개 메소드들

메소드 설명
__construct ( array $info ) Create an Face result.
hasHeadwear ( string $strength = self::STRENGTH_LOW ) : boolean Check whether the person is wearing headwear.
isAngry ( string $strength = self::STRENGTH_LOW ) : boolean Check whether the face is angry.
isBlurred ( string $strength = self::STRENGTH_LOW ) : boolean Check whether the face is blurred.
isJoyful ( string $strength = self::STRENGTH_LOW ) : boolean Check whether the face is joyful.
isSorrowful ( string $strength = self::STRENGTH_LOW ) : boolean Check whether the face is sorrowful.
isSurprised ( string $strength = self::STRENGTH_LOW ) : boolean Check whether the face is surprised.
isUnderExposed ( string $strength = self::STRENGTH_LOW ) : boolean Check whether the face is under exposed.
landmarks ( ) : Landmarks Returns an object detailing facial landmarks and their location.

메소드 상세

__construct() 공개 메소드

This class is created internally by {@see \Google\Cloud\Vision\Annotation}. See {@see \Google\Cloud\Vision\Annotation::faces()} for full usage details. This class should not be instantiated outside the externally.
public __construct ( array $info )
$info array The face annotation result

hasHeadwear() 공개 메소드

Example: if ($face->hasHeadwear()) { echo "Face has Headwear"; }
public hasHeadwear ( string $strength = self::STRENGTH_LOW ) : boolean
$strength string [optional] Value should be one of "low", "medium" or "high". Recommended usage is via `Face::STRENGTH_*` constants. Higher strength will result in fewer `true` results, but fewer false positives. **Defaults to** `"low"`.
리턴 boolean

isAngry() 공개 메소드

Example: if ($face->isAngry()) { echo "Face is Angry"; }
public isAngry ( string $strength = self::STRENGTH_LOW ) : boolean
$strength string [optional] Value should be one of "low", "medium" or "high". Recommended usage is via `Face::STRENGTH_*` constants. Higher strength will result in fewer `true` results, but fewer false positives. **Defaults to** `"low"`.
리턴 boolean

isBlurred() 공개 메소드

Example: if ($face->isBlurred()) { echo "Face is Blurred"; }
public isBlurred ( string $strength = self::STRENGTH_LOW ) : boolean
$strength string [optional] Value should be one of "low", "medium" or "high". Recommended usage is via `Face::STRENGTH_*` constants. Higher strength will result in fewer `true` results, but fewer false positives. **Defaults to** `"low"`.
리턴 boolean

isJoyful() 공개 메소드

Example: if ($face->isJoyful()) { echo "Face is Joyful"; }
public isJoyful ( string $strength = self::STRENGTH_LOW ) : boolean
$strength string [optional] Value should be one of "low", "medium" or "high". Recommended usage is via `Face::STRENGTH_*` constants. Higher strength will result in fewer `true` results, but fewer false positives. **Defaults to** `"low"`.
리턴 boolean

isSorrowful() 공개 메소드

Example: if ($face->isSorrowful()) { echo "Face is Sorrowful"; }
public isSorrowful ( string $strength = self::STRENGTH_LOW ) : boolean
$strength string [optional] Value should be one of "low", "medium" or "high". Recommended usage is via `Face::STRENGTH_*` constants. Higher strength will result in fewer `true` results, but fewer false positives. **Defaults to** `"low"`.
리턴 boolean

isSurprised() 공개 메소드

Example: if ($face->isSurprised()) { echo "Face is Surprised"; }
public isSurprised ( string $strength = self::STRENGTH_LOW ) : boolean
$strength string [optional] Value should be one of "low", "medium" or "high". Recommended usage is via `Face::STRENGTH_*` constants. Higher strength will result in fewer `true` results, but fewer false positives. **Defaults to** `"low"`.
리턴 boolean

isUnderExposed() 공개 메소드

Example: if ($face->isUnderExposed()) { echo "Face is Under Exposed"; }
public isUnderExposed ( string $strength = self::STRENGTH_LOW ) : boolean
$strength string [optional] Value should be one of "low", "medium" or "high". Recommended usage is via `Face::STRENGTH_*` constants. Higher strength will result in fewer `true` results, but fewer false positives. **Defaults to** `"low"`.
리턴 boolean

landmarks() 공개 메소드

Example: $leftEye = $face->landmarks()->leftEye();
public landmarks ( ) : Landmarks
리턴 Google\Cloud\Vision\Annotation\Face\Landmarks