Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README for Vision going beta #387

Merged
merged 1 commit into from
Mar 7, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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