Skip to content

Commit

Permalink
Update README for Vision going beta (#387)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbausor authored and dwsupplee committed Mar 7, 2017
1 parent 3c2c02d commit 3128001
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ This client supports the following Google Cloud Platform services at a [Beta](#v
* [Google Stackdriver Logging](#google-stackdriver-logging-beta) (Beta)
* [Google Cloud Datastore](#google-cloud-datastore-beta) (Beta)
* [Google Cloud Storage](#google-cloud-storage-beta) (Beta)
* [Google Cloud Vision](#google-cloud-vision-beta) (Beta)

This client supports the following Google Cloud Platform services at an [Alpha](#versioning) quality level:
* [Google Cloud Natural Language](#google-cloud-natural-language-alpha) (Alpha)
* [Google Cloud Pub/Sub](#google-cloud-pubsub-alpha) (Alpha)
* [Google Cloud Speech](#google-cloud-speech-alpha) (Alpha)
* [Google Cloud Translation](#google-cloud-translation-alpha) (Alpha)
* [Google Cloud Vision](#google-cloud-vision-alpha) (Alpha)

If you need support for other Google APIs, please check out the [Google APIs Client Library for PHP](https://github.com/google/google-api-php-client).

Expand Down Expand Up @@ -167,6 +167,38 @@ $storage->registerStreamWrapper();
$contents = file_get_contents('gs://my_bucket/file_backup.txt');
```

## Google Cloud Vision (Beta)

- [API Documentation](http://googlecloudplatform.github.io/google-cloud-php/#/docs/latest/vision/visionclient)
- [Official Documentation](https://cloud.google.com/vision/docs)

#### Preview

```php
require 'vendor/autoload.php';

use Google\Cloud\Vision\VisionClient;

$vision = new VisionClient([
'projectId' => 'my_project'
]);

// Annotate an image, detecting faces.
$image = $vision->image(
fopen('/data/family_photo.jpg', 'r'),
['faces']
);

$annotation = $vision->annotate($image);

// Determine if the detected faces have headwear.
foreach ($annotation->faces() as $key => $face) {
if ($face->hasHeadwear()) {
echo "Face $key has headwear.\n";
}
}
```

## Google Cloud Translation (Alpha)

- [API Documentation](http://googlecloudplatform.github.io/google-cloud-php/#/docs/latest/translate/translateclient)
Expand Down Expand Up @@ -318,38 +350,6 @@ foreach ($results as $result) {
}
```

## Google Cloud Vision (Alpha)

- [API Documentation](http://googlecloudplatform.github.io/google-cloud-php/#/docs/latest/vision/visionclient)
- [Official Documentation](https://cloud.google.com/vision/docs)

#### Preview

```php
require 'vendor/autoload.php';

use Google\Cloud\Vision\VisionClient;

$vision = new VisionClient([
'projectId' => 'my_project'
]);

// Annotate an image, detecting faces.
$image = $vision->image(
fopen('/data/family_photo.jpg', 'r'),
['faces']
);

$annotation = $vision->annotate($image);

// Determine if the detected faces have headwear.
foreach ($annotation->faces() as $key => $face) {
if ($face->hasHeadwear()) {
echo "Face $key has headwear.\n";
}
}
```

## Caching Access Tokens

By default the library will use a simple in-memory caching implementation, however it is possible to override this behavior by passing a [PSR-6](http://www.php-fig.org/psr/psr-6/) caching implementation in to the desired client.
Expand Down

0 comments on commit 3128001

Please sign in to comment.