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

Example: use Google\Cloud\ServiceBuilder; $cloud = new ServiceBuilder(); $vision = $cloud->vision(); $imageResource = fopen(__DIR__ .'/assets/family-photo.jpg', 'r'); $image = $vision->image($imageResource, [ 'safeSearch' ]); $annotation = $vision->annotate($image); $safeSearch = $annotation->safeSearch();
상속: extends AbstractFeature, use trait Google\Cloud\CallTrait, use trait LikelihoodTrait
파일 보기 프로젝트 열기: GoogleCloudPlatform/gcloud-php

공개 메소드들

메소드 설명
__construct ( array $info ) Create a SafeSearch annotation result
isAdult ( string $strength = self::STRENGTH_LOW ) : boolean Check whether the image contains adult content.
isMedical ( string $strength = self::STRENGTH_LOW ) : boolean Check whether the image contains medical content
isSpoof ( string $strength = self::STRENGTH_LOW ) : boolean Check whether the image was modified to make it appear funny or offensive.
isViolent ( string $strength = self::STRENGTH_LOW ) : boolean Check whether the image contains violent content

메소드 상세

__construct() 공개 메소드

This class is instantiated internally and is used to represent the result of Cloud Vision's SafeSearch annotation feature. It should not be instantiated directly. For complete usage instructions, please refer to {@see \Google\Cloud\Vision\Annotation::safeSearch()}.
public __construct ( array $info )
$info array The SafeSearch annotation result

isAdult() 공개 메소드

Example: if ($safeSearch->isAdult()) { echo "Image contains adult content."; }
public isAdult ( 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

isMedical() 공개 메소드

Example: if ($safeSearch->medical()) { echo "Image contains medical content."; }
public isMedical ( 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

isSpoof() 공개 메소드

Example: if ($safeSearch->isSpoof()) { echo "Image contains spoofed content."; }
public isSpoof ( 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

isViolent() 공개 메소드

Example: if ($safeSearch->isViolent()) { echo "Image contains violent content."; }
public isViolent ( 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