Search by

thangman22 / google-cloud-vision-php

thangman22

There is no license information available for the latest version (1.02) of this package.

This package's canonical repository appears to be gone and the package has been frozen as a result. Email us for help if needed.

Package info

github.com/thangman22/google-cloud-vision-php

Type:vcs

pkg:composer/thangman22/google-cloud-vision-php

Statistics

Installs: 53 609

Dependents: 0

Suggesters: 0

Stars: 24

Open Issues: 5

1.02 2016-12-24 04:19 UTC

This package is not auto-updated.

Last update: 2026-06-27 05:40:31 UTC


README

Build Status

GoogleCloudVisionPHP

This project hosts the PHP library for the various RESTful based Google Cloud Vision API(s) [Read about Google Cloud Vision API] (https://cloud.google.com/vision/)

##Features

  • Support almost feature of Google Cloud Vision API (Version 1)
  • Auto encode images to based64

##how to get service key Google Cloud Vision API Document

##Requirements

  • PHP >= 5.4 with cURL extension

##Installation Add this to your composer.json

"require": {
        "thangman22/google-cloud-vision-php": "*"
    }

##Example

use GoogleCloudVisionPHP\GoogleCloudVision;

$gcv = new GoogleCloudVision();

// Follow instruction from Google Cloud Vision Document
$gcv->setKey("[Key from Google]");

$gcv->setImage("[File path]");

// 1 is Max result
$gcv->addFeature("LABEL_DETECTION", 1);

$gcv->addFeatureUnspecified(1);
$gcv->addFeatureFaceDetection(1);
$gcv->addFeatureLandmarkDetection(1);
$gcv->addFeatureLogoDetection(1);
$gcv->addFeatureLabelDetection(1);
$gcv->addFeatureOCR(1);
$gcv->addFeatureSafeSeachDetection(1);
$gcv->addFeatureImageProperty(1);

//Optinal
$gcv->setImageContext(array("languageHints"=>array("th")));

$response = $gcv->request();