google / cloud-vision
Cloud Vision Client for PHP
Requires
- php: ^8.0
- google/cloud-core: ^1.52.7
- google/gax: ^1.34.0
Requires (Dev)
- erusev/parsedown: ^1.6
- google/cloud-storage: ^1.12
- phpdocumentor/reflection: ^5.3.3
- phpdocumentor/reflection-docblock: ^5.3
- phpspec/prophecy-phpunit: ^2.0
- phpunit/phpunit: ^9.0
- squizlabs/php_codesniffer: 2.*
Suggests
- ext-grpc: The gRPC extension enables use of the performant gRPC transport
- ext-protobuf: Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions.
- google/cloud-storage: Annotate images stored in Google Cloud Storage
- dev-main
- v1.10.1
- v1.10.0
- v1.9.4
- v1.9.3
- v1.9.2
- v1.9.1
- v1.9.0
- v1.8.1
- v1.8.0
- v1.7.6
- v1.7.5
- v1.7.4
- v1.7.3
- v1.7.2
- v1.7.1
- v1.7.0
- v1.6.8
- v1.6.7
- v1.6.6
- v1.6.5
- v1.6.4
- v1.6.3
- v1.6.2
- v1.6.1
- v1.6.0
- v1.5.10
- v1.5.9
- v1.5.8
- v1.5.7
- v1.5.6
- v1.5.5
- v1.5.4
- v1.5.3
- v1.5.2
- v1.5.1
- v1.5.0
- v1.4.0
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.1
- v1.1.0
- v1.0.2
- v1.0.1
- v1.0.0
- v0.25.1
- v0.25.0
- v0.24.1
- v0.24.0
- v0.23.0
- v0.22.5
- v0.22.4
- v0.22.3
- v0.22.2
- v0.22.1
- v0.22.0
- v0.21.1
- v0.21.0
- v0.20.0
- v0.19.3
- v0.19.2
- v0.19.1
- v0.19.0
- v0.18.0
- v0.17.2
- v0.17.1
- v0.17.0
- v0.16.0
- v0.15.4
- v0.15.3
- v0.15.2
- v0.15.1
- v0.15.0
- v0.14.2
- v0.14.1
- v0.14.0
- v0.13.0
- v0.12.0
- v0.11.4
- v0.11.3
- v0.11.2
- v0.11.1
- v0.11.0
- v0.10.2
- v0.10.1
- v0.10.0
- v0.9.1
- v0.9.0
- v0.8.2
- v0.8.1
- v0.8.0
- v0.7.0
- v0.6.1
- v0.6.0
- v0.5.0
- v0.4.1
- v0.4.0
- v0.3.0
- v0.2.0
- v0.1.0
This package is auto-updated.
Last update: 2024-11-06 22:01:43 UTC
README
Idiomatic PHP client for Cloud Vision.
NOTE: This repository is part of Google Cloud PHP. Any support requests, bug reports, or development contributions should be directed to that project.
Allows developers to easily integrate vision detection features within applications, including image labeling, face and landmark detection, optical character recognition (OCR), and tagging of explicit content.
Installation
To begin, install the preferred dependency manager for PHP, Composer.
Now install this component:
$ composer require google/cloud-vision
Authentication
Please see our Authentication guide for more information on authenticating your client. Once authenticated, you'll be ready to start making requests.
Sample
require 'vendor/autoload.php'; use Google\Cloud\Vision\V1\Feature\Type; use Google\Cloud\Vision\V1\ImageAnnotatorClient; use Google\Cloud\Vision\V1\Likelihood; $client = new ImageAnnotatorClient(); // Annotate an image, detecting faces. $annotation = $client->annotateImage( fopen('/data/photos/family_photo.jpg', 'r'), [Type::FACE_DETECTION] ); // Determine if the detected faces have headwear. foreach ($annotation->getFaceAnnotations() as $faceAnnotation) { $likelihood = Likelihood::name($faceAnnotation->getHeadwearLikelihood()); echo "Likelihood of headwear: $likelihood" . PHP_EOL; }
Version
This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in any minor or patch releases. We will address issues and requests with the highest priority.
Next Steps
- Understand the official documentation.
- Take a look at in-depth usage samples.