Download the PHP package gdevilbat/google-cloud-vision-php without Composer
On this page you can find all versions of the php package gdevilbat/google-cloud-vision-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gdevilbat/google-cloud-vision-php
More information about gdevilbat/google-cloud-vision-php
Files in gdevilbat/google-cloud-vision-php
Package google-cloud-vision-php
Short Description A simple php library for the google cloud vision API
License MIT
Informations about the package google-cloud-vision-php
google-cloud-vision-php
Overview
Performs Label detection, face detection, Logo detection, explicit content detection, landmark detection, optical character recogition and web detection on images. You can read more about Google cloud vision here https://cloud.google.com/vision/
Getting Started
You will need a google account to use this API so if you do not already have an account with google, head over there and create one
Installation
Enable the API
To start using the google cloud vision api, follow the instructions here to enable the api for your google account https://cloud.google.com/vision/docs/before-you-begin
Authentication
You must set up an Api key to authenticate your requests. Follow the instructions here https://support.google.com/cloud/answer/6158862?hl=en to set up an API key for your project on google cloud platform console
Usage
Note : You can create as many as 16 Annotate image requests to be sent with the request object
The function takes a Google Cloud Storage image location, or publicly-accessible image URL. Alternatively you can use which takes a base64 encoded image string.
You can set as many features as are available to the annotateImageRequest by calling the function on the annotateImageRequest which takes any of the following enum parameters ; TYPE_UNSPECIFIED, FACE_DETECTION, LANDMARK_DETECTION, LOGO_DETECTION, LABEL_DETECTION, TEXT_DETECTION, DOCUMENT_TEXT_DETECTION, SAFE_SEARCH_DETECTION, IMAGE_PROPERTIES, CROP_HINTS, WEB_DETECTION.
Optionally, you can set the image context for each annotateImageRequest object like so
Finally, the GoogleCloudVision request object takes an array of AnnotateImageRequest objects as the first parameter and the api key as the second parameter
Response object
If successful, you will receive a json object response in the format below;