Skip to content

Commit 816f2b4

Browse files
authored
Update computer-vision-how-to-install-containers.md
1 parent eff04ef commit 816f2b4

File tree

1 file changed

+161
-1
lines changed

1 file changed

+161
-1
lines changed

articles/cognitive-services/Computer-vision/computer-vision-how-to-install-containers.md

Lines changed: 161 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,37 @@ Use the [docker run](https://docs.docker.com/engine/reference/commandline/run/)
129129

130130
[Examples](computer-vision-resource-container-config.md#example-docker-run-commands) of the `docker run` command are available.
131131

132+
# [Version 3.2 model 2021-09-30-preview](#tab/version-3-2-model-2021-09-30-preview)
133+
134+
```bash
135+
docker pull mcr.microsoft.com/azure-cognitive-services/vision/read:3.2-model-2021-09-30-preview
136+
```
137+
138+
```bash
139+
docker run --rm -it -p 5000:5000 --memory 18g --cpus 8 \
140+
mcr.microsoft.com/azure-cognitive-services/vision/read:3.2-model-2021-09-30-preview \
141+
Eula=accept \
142+
Billing={ENDPOINT_URI} \
143+
ApiKey={API_KEY}
144+
```
145+
146+
This command:
147+
148+
* Runs the Read OCR container from the container image.
149+
* Allocates 8 CPU core and 18 gigabytes (GB) of memory.
150+
* Exposes TCP port 5000 and allocates a pseudo-TTY for the container.
151+
* Automatically removes the container after it exits. The container image is still available on the host computer.
152+
153+
You can alternatively run the container using environment variables:
154+
155+
```bash
156+
docker run --rm -it -p 5000:5000 --memory 18g --cpus 8 \
157+
--env Eula=accept \
158+
--env Billing={ENDPOINT_URI} \
159+
--env ApiKey={API_KEY} \
160+
mcr.microsoft.com/azure-cognitive-services/vision/read:3.2-model-2021-09-30-preview
161+
```
162+
132163
# [Version 3.2](#tab/version-3-2)
133164

134165
```bash
@@ -210,6 +241,10 @@ To find your connection string:
210241

211242
The container provides REST-based query prediction endpoint APIs.
212243

244+
# [Version 3.2 model 2021-09-30-preview](#tab/version-3-2-model-2021-09-30-preview)
245+
246+
Use the host, `http://localhost:5000`, for container APIs. You can view the Swagger path at: `http://localhost:5000/swagger/vision-v3.2-read-model-2021-09-30-preview/swagger.json`.
247+
213248
# [Version 3.2](#tab/version-3-2)
214249

215250
Use the host, `http://localhost:5000`, for container APIs. You can view the Swagger path at: `http://localhost:5000/swagger/vision-v3.2-read/swagger.json`.
@@ -220,8 +255,133 @@ Use the host, `http://localhost:5000`, for container APIs. You can view the Swag
220255

221256
---
222257

223-
### Asynchronous read
258+
### Asynchronous Read
259+
260+
# [Version 3.2 model 2021-09-30-preview](#tab/version-3-2-model-2021-09-30-preview)
261+
262+
You can use the `POST /vision/v3.2/read/analyze` and `GET /vision/v3.2/read/operations/{operationId}` operations in concert to asynchronously read an image, similar to how the Computer Vision service uses those corresponding REST operations. The asynchronous POST method will return an `operationId` that is used as the identifer to the HTTP GET request.
263+
224264

265+
From the swagger UI, select the `Analyze` to expand it in the browser. Then select **Try it out** > **Choose file**. In this example, we'll use the following image:
266+
267+
![tabs vs spaces](media/tabs-vs-spaces.png)
268+
269+
When the asynchronous POST has run successfully, it returns an **HTTP 202** status code. As part of the response, there is an `operation-location` header that holds the result endpoint for the request.
270+
271+
```http
272+
content-length: 0
273+
date: Fri, 04 Sep 2020 16:23:01 GMT
274+
operation-location: http://localhost:5000/vision/v3.2/read/operations/a527d445-8a74-4482-8cb3-c98a65ec7ef9
275+
server: Kestrel
276+
```
277+
278+
The `operation-location` is the fully qualified URL and is accessed via an HTTP GET. Here is the JSON response from executing the `operation-location` URL from the preceding image:
279+
280+
```json
281+
{
282+
"status": "succeeded",
283+
"createdDateTime": "2021-02-04T06:32:08.2752706+00:00",
284+
"lastUpdatedDateTime": "2021-02-04T06:32:08.7706172+00:00",
285+
"analyzeResult": {
286+
"version": "3.2.0",
287+
"readResults": [
288+
{
289+
"page": 1,
290+
"angle": 2.1243,
291+
"width": 502,
292+
"height": 252,
293+
"unit": "pixel",
294+
"lines": [
295+
{
296+
"boundingBox": [
297+
58,
298+
42,
299+
314,
300+
59,
301+
311,
302+
123,
303+
56,
304+
121
305+
],
306+
"text": "Tabs vs",
307+
"appearance": {
308+
"style": {
309+
"name": "handwriting",
310+
"confidence": 0.96
311+
}
312+
},
313+
"words": [
314+
{
315+
"boundingBox": [
316+
68,
317+
44,
318+
225,
319+
59,
320+
224,
321+
122,
322+
66,
323+
123
324+
],
325+
"text": "Tabs",
326+
"confidence": 0.933
327+
},
328+
{
329+
"boundingBox": [
330+
241,
331+
61,
332+
314,
333+
72,
334+
314,
335+
123,
336+
239,
337+
122
338+
],
339+
"text": "vs",
340+
"confidence": 0.977
341+
}
342+
]
343+
},
344+
{
345+
"boundingBox": [
346+
286,
347+
171,
348+
415,
349+
165,
350+
417,
351+
197,
352+
287,
353+
201
354+
],
355+
"text": "paces",
356+
"appearance": {
357+
"style": {
358+
"name": "handwriting",
359+
"confidence": 0.746
360+
}
361+
},
362+
"words": [
363+
{
364+
"boundingBox": [
365+
286,
366+
179,
367+
404,
368+
166,
369+
405,
370+
198,
371+
290,
372+
201
373+
],
374+
"text": "paces",
375+
"confidence": 0.938
376+
}
377+
]
378+
}
379+
]
380+
}
381+
]
382+
}
383+
}
384+
```
225385

226386
# [Version 3.2](#tab/version-3-2)
227387

0 commit comments

Comments
 (0)