Skip to content

Commit 7dd6a5f

Browse files
committed
object model section
1 parent 0075879 commit 7dd6a5f

File tree

1 file changed

+27
-28
lines changed
  • articles/cognitive-services/Face/QuickStarts

1 file changed

+27
-28
lines changed

articles/cognitive-services/Face/QuickStarts/go-sdk.md

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -39,43 +39,39 @@ Begin using the Face service by creating an Azure resource. Choose the resource
3939
* A [trial resource](https://azure.microsoft.com/try/cognitive-services/#decision) (no Azure subscription needed):
4040
* Valid for seven days, for free. After signing up, a trial key and endpoint will be available on the [Azure website](https://azure.microsoft.com/try/cognitive-services/my-apis/).
4141
* This is a great option if you want to try Face service, but don’t have an Azure subscription.
42-
<!-- Link to the 'create' blade in the azure portal -->
43-
* A [ Face service resource](https://ms.portal.azure.com/#create/Microsoft.CognitiveServicesAnomalyDetector):
42+
* A [ Face service resource](https://ms.portal.azure.com/#create/Microsoft.CognitiveServicesFace):
4443
* Available through the Azure portal until you delete the resource.
4544
* Use the free pricing tier to try the service, and upgrade later to a paid tier for production.
46-
<!-- remove the below text if your service is not supported by the multi-service option. -->
4745
* A [Multi-Service resource](https://ms.portal.azure.com/#create/Microsoft.CognitiveServicesAllInOne):
4846
* Available through the Azure portal until you delete the resource.
4947
* Use the same key and endpoint for your applications, across multiple Cognitive Services.
5048

51-
5249
### Create an environment variable
5350

5451
>[!NOTE]
5552
> The endpoints for non-trial resources created after July 1, 2019 use the custom subdomain format shown below. For more information and a complete list of regional endpoints, see [Custom subdomain names for Cognitive Services](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-custom-subdomains).
5653
5754
Using your key and endpoint from the resource you created, create two environment variables for authentication:
58-
<!-- replace the below variable names with the names expected in the code sample.-->
59-
* `PRODUCT_NAME_KEY` - The resource key for authenticating your requests.
60-
* `PRODUCT_NAME_ENDPOINT` - The resource endpoint for sending API requests. It will look like this:
55+
* `FACE_SUBSCRIPTION_KEY` - The resource key for authenticating your requests.
56+
* `FACE_ENDPOINT` - The resource endpoint for sending API requests. It will look like this:
6157
* `https://<your-custom-subdomain>.api.cognitive.microsoft.com`
6258

6359
Use the instructions for your operating system.
6460
<!-- replace the below endpoint and key examples -->
6561
#### [Windows](#tab/windows)
6662

6763
```console
68-
setx PRODUCT_NAME_KEY <replace-with-your-product-name-key>
69-
setx PRODUCT_NAME_ENDPOINT <replace-with-your-product-name-endpoint>
64+
setx FACE_SUBSCRIPTION_KEY <replace-with-your-product-name-key>
65+
setx FACE_ENDPOINT <replace-with-your-product-name-endpoint>
7066
```
7167

7268
After you add the environment variable, restart the console window.
7369

7470
#### [Linux](#tab/linux)
7571

7672
```bash
77-
export PRODUCT_NAME_KEY=<replace-with-your-product-name-key>
78-
export PRODUCT_NAME_ENDPOINT=<replace-with-your-product-name-endpoint>
73+
export FACE_SUBSCRIPTION_KEY=<replace-with-your-product-name-key>
74+
export FACE_ENDPOINT=<replace-with-your-product-name-endpoint>
7975
```
8076

8177
After you add the environment variable, run `source ~/.bashrc` from your console window to make the changes effective.
@@ -85,8 +81,8 @@ After you add the environment variable, run `source ~/.bashrc` from your console
8581
Edit your `.bash_profile`, and add the environment variable:
8682

8783
```bash
88-
export PRODUCT_NAME_KEY=<replace-with-your-product-name-key>
89-
export PRODUCT_NAME_ENDPOINT=<replace-with-your-product-name-endpoint>
84+
export FACE_SUBSCRIPTION_KEY=<replace-with-your-product-name-key>
85+
export FACE_ENDPOINT=<replace-with-your-product-name-endpoint>
9086
```
9187

9288
After you add the environment variable, run `source .bash_profile` from your console window to make the changes effective.
@@ -104,7 +100,7 @@ cd my-app
104100
Your workspace will contain three folders:
105101

106102
* **src** - This directory will contain source code and packages. Any packages installed with the `go get` command will go here.
107-
* **pkg** - This directory will contain the compiled Go package objects. These files all have an `.a` extension.
103+
* **pkg** - This directory will contain the compiled Go package objects. These files all have a `.a` extension.
108104
* **bin** - This directory will contains the binary executable files that are created when you run `go install`.
109105

110106
> [!TIP]
@@ -115,13 +111,13 @@ Your workspace will contain three folders:
115111
Next, install the client library for Go:
116112

117113
```bash
118-
go get -u <library-location-or-url>
114+
go get -u https://github.com/Azure/azure-sdk-for-go/tree/master/services/cognitiveservices/v1.0/face
119115
```
120116

121117
or if you use dep, within your repo run:
122118

123119
```bash
124-
dep ensure -add <library-location-or-url>
120+
dep ensure -add https://github.com/Azure/azure-sdk-for-go/tree/master/services/cognitiveservices/v1.0/face
125121
```
126122

127123
### Create a Go application
@@ -135,31 +131,34 @@ touch sample-app.go
135131

136132
Open `sample-app.go` in your preferred IDE or text editor. Then add the package name and import the following libraries:
137133

138-
```Go
139-
package main
134+
[!code-go[](~/cognitive-services-quickstart-code/go/Face/FaceQuickstart.go?name=snippet_imports)]
140135

141-
import (
142-
"..."
143-
"..."
144-
)
145-
```
136+
Next, you'll begin adding code to carry out different Face service operations.
146137

147138
## Object model
148139

149140
The following classes and interfaces handle some of the major features of the Face service Go SDK.
150141

151142
|Name|Description|
152143
|---|---|
153-
| | |
144+
|[BaseClient](https://godoc.org/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/face#BaseClient) | This class represents your authorization to use the Face service, and you need it for all Face functionality. You instantiate it with your subscription information, and you use it to produce instances of other classes. |
145+
|[Client](https://godoc.org/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/face#Client)|This class handles the basic detection and recognition tasks that you can do with human faces. |
146+
|[DetectedFace](https://godoc.org/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/face#DetectedFace)|This class represents all of the data that was detected from a single face in an image. You can use it to retrieve detailed information about the face.|
147+
|[ListClient](https://godoc.org/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/face#ListClient)|This class manages the cloud-stored **FaceList** constructs, which store an assorted set of faces. |
148+
|[PersonGroupPersonClient](https://godoc.org/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/face#PersonGroupPersonClient)| This class manages the cloud-stored **Person** constructs, which store a set of faces that belong to a single person.|
149+
|[PersonGroupClient](https://godoc.org/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/face#PersonGroupClient)| This class manages the cloud-stored **PersonGroup** constructs, which store a set of assorted **Person** objects. |
150+
|[SnapshotClient](https://godoc.org/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/face#SnapshotClient)|This class manages the Snapshot functionality. You can use it to temporarily save all of your cloud-based Face data and migrate that data to a new Azure subscription. |
154151

155152
## Code examples
156153

157154
These code samples show you how to complete basic tasks using the Face service client library for Go:
158155

159-
* [Authenticate the client](#)
160-
* [Example task 1 (anchor link)](#)
161-
* [Example task 2 (anchor link)](#)
162-
* [Example task 3 (anchor link)](#)
156+
* [Authenticate the client](#authenticate-the-client)
157+
* [Detect faces in an image](#detect-faces-in-an-image)
158+
* [Find similar faces](#find-similar-faces)
159+
* [Create and train a person group](#create-and-train-a-person-group)
160+
* [Identify a face](#identify-a-face)
161+
* [Take a snapshot for data migration](#take-a-snapshot-for-data-migration)
163162

164163
## Authenticate the client
165164

0 commit comments

Comments
 (0)