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
Показать файл Открыть проект

Открытые методы

Метод Описание
__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