You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Analyze image container scans image for sexual content, violence, hate, and selfharm with multi-severity levels. In this article, you learn how to download, install, and run a content safety to image container.
16
+
The analyze image container scans images for sexual content, violence, hate, and self-harm with multi-severity levels. This guide shows how to download, install, and run a content safety image container.
17
17
18
18
For more information about prerequisites, validating that a container is running, running multiple containers on the same host, and running disconnected containers, see [Install and run content safety containers with Docker](./install-run-container.md).
19
19
20
-
## Container images
20
+
## Specify a container image
21
21
22
-
The content safety analyze image container image for all supported versions can be found on the [Microsoft Container Registry (MCR)](https://mcr.microsoft.com/en-us/product/azure-cognitive-services/contentsafety/image-analyze/tags) syndicate. It resides within the `azure-cognitive-services/contentsafety` repository and is named `image-analyze`.
22
+
The content safety analyze image container image for all supported versions can be found on the [Microsoft Container Registry (MCR)](https://mcr.microsoft.com/product/azure-cognitive-services/contentsafety/image-analyze/tags) syndicate. It resides in the `azure-cognitive-services/contentsafety` repository and is named `image-analyze`.
23
23
24
24
25
-
25
+
<!--
26
26
**to do: update MCR screenshot** **[to-do]** update MCR screenshot for AACS image analyze image. the MCR release is in progress, expect to finish by EOD 9/20 PST. the MCR link is https://mcr.microsoft.com/en-us/product/azure-cognitive-services/contentsafety/image-analyze/tags
27
+
-->
27
28
28
29
29
-
The fully qualified container image name is, `mcr.microsoft.com/en-us/product/azure-cognitive-services/contentsafety/image-analyze`. Either append a specific version or append `:latest` to get the most recent version.
30
+
The fully qualified container name is, `mcr.microsoft.com/en-us/product/azure-cognitive-services/contentsafety/image-analyze`. Append a specific container version, or append `:latest` to get the most recent version. For example:
30
31
31
32
| Version | Path |
32
33
|-----------|------------|
33
34
| Latest |`mcr.microsoft.com/azure-cognitive-services/contentsafety/image-analyze:latest`<br/><br/>The `latest` tag pulls the latest image. |
You need the [prerequisites](./install-run-container.md#prerequisites) including required hardware. Also see the [recommended allocation of resources](./install-run-container.md#host-computer-requirements-and-recommendations)
39
-
for each content safety container.
39
+
Make sure you meet the [prerequisites](./install-run-container.md#prerequisites), including required hardware. Also see the [recommended allocation of resources](./install-run-container.md#host-computer-requirements-and-recommendations) section for each content safety container.
40
40
41
41
Use the [docker pull](https://docs.docker.com/engine/reference/commandline/pull/) command to download a container image from Microsoft Container Registry:
Use the [docker run](https://docs.docker.com/engine/reference/commandline/run/) command to run the container.
51
51
@@ -55,12 +55,12 @@ The following table represents the various `docker run` parameters and their cor
55
55
56
56
| Parameter | Description |
57
57
|---------|---------|
58
-
|`{ENDPOINT_URI}`| The endpoint is required for metering and billing. For more information, see [billing arguments](content safety-container-howto.md#billing-arguments). |
59
-
|`{API_KEY}`| The API key is required. For more information, see [billing arguments](content safety-container-howto.md#billing-arguments). |
58
+
|`{ENDPOINT_URI}`| The endpoint is required for metering and billing. For more information, see [billing arguments](./install-run-container.md#billing-arguments). |
59
+
|`{API_KEY}`| The API key is required. For more information, see [billing arguments](./install-run-container.md#billing-arguments). |
60
60
61
-
When you run the content safety to image container, configure the port, memory, and CPU according to the content safety to image container [requirements and recommendations](content safety-container-howto.md#container-requirements-and-recommendations).
61
+
When you run the content safety analyze image container, configure the port, memory, and CPU according to the [requirements and recommendations](./install-run-container.md#container-requirements-and-recommendations).
62
62
63
-
Here's an example`docker run` command with placeholder values. You must specify the `ENDPOINT_URI` and `API_KEY` values:
63
+
Here's a sample`docker run` command with placeholder values. You must specify the `ENDPOINT_URI` and `API_KEY` values:
64
64
65
65
```bash
66
66
docker run --rm -it -p 5000:5000 --gpus all \
@@ -72,17 +72,16 @@ ApiKey={API_KEY}
72
72
73
73
This command:
74
74
* Runs an `image-analyze` container from the container image.
75
-
*`--gpus all` Use all available GPU resources. Content safety container requires CUDA for optimal performance. See more in [host requirements and recommendations](./install-run-container.md#host-computer-requirements-and-recommendations). Also make sure your host install[NVIDIA container toolkit](./install-run-container.md#installing-the-nvidia-container-toolkit).
75
+
*Uses allavailable GPU resources (by specifying `--gpus all`). Content safety containers require CUDA for optimal performance. Learn more in [host requirements and recommendations](./install-run-container.md#host-computer-requirements-and-recommendations). Also make sure your host installs[NVIDIA container toolkit](./install-run-container.md#installing-the-nvidia-container-toolkit).
76
76
* Exposes TCP port 5000 and allocates a pseudo-TTY for the container.
77
77
* Automatically removes the container after it exits. The container image is still available on the host computer.
78
78
79
79
# [Disconnected container](#tab/disconnected)
80
80
81
-
To run disconnected containers (not connected to the internet), you must submit [this request form](https://aka.ms/csdisconnectedcontainers) and wait for approval. For more information about applying and purchasing a commitment plan to use containers in disconnected environments, see [Use containers in disconnected environments](../../../containers/disconnected-containers.md) in the Azure AI services documentation.
81
+
To run disconnected containers (not connected to the internet), you must submit a [request form](https://aka.ms/csdisconnectedcontainers) and wait for approval. For more information about applying and purchasing a commitment plan to use containers in disconnected environments, see [Use containers in disconnected environments](../../../containers/disconnected-containers.md) in the Azure AI services documentation.
82
82
83
-
If you're approved to run the container disconnected from the internet, the following example shows the formatting of the `docker run` command to use, with placeholder values. Replace these placeholder values with your own values.
83
+
If you're approved to run the disconnected container, the following example shows the formatting of the `docker run` command to use, with placeholder values. Replace these values with your own values.
84
84
85
-
The `DownloadLicense=True` parameter in your `docker run` command downloads a license file to enable your Docker container to run when it isn't connected to the internet. It also contains an expiration date, after which the license file is invalid to run the container. You can only use a license file with the appropriate container that you're approved for. For example, you can't use a license file for a `content safety-to-image` container with a `neural-image-to-content safety` container.
86
85
87
86
| Placeholder | Description |
88
87
|-------------|-------|
@@ -103,7 +102,10 @@ DownloadLicense=True \
103
102
Mounts:License={CONTAINER_LICENSE_DIRECTORY}
104
103
```
105
104
106
-
Once the license file is downloaded, you can run the container in a disconnected environment. The following example shows the formatting of the `docker run` command you use, with placeholder values. Replace these placeholder values with your own values.
105
+
The `DownloadLicense=True` parameter in your `docker run` command downloads a license file to enable your Docker container to run when it isn't connected to the internet. It also contains an expiration date, after which the license file is invalid to run the container. You can only use a license file with the appropriate container that you're approved for. For example, you can't use a license file for a `content safety-to-image` container with a `neural-image-to-content-safety` container.
106
+
107
+
108
+
Once the license file is downloaded, you can run the container in a disconnected environment. The following example shows the formatting of the `docker run` command you use, with placeholder values. Replace these values with your own values.
107
109
108
110
Wherever the container is run, the license file must be mounted to the container and the location of the license folder on the container's local filesystem must be specified with `Mounts:License=`. An output mount must also be specified so that billing usage records can be written.
Content safety containers provide a default directory for writing the license file and billing log at runtime. The default directories are /license and /output respectively.
132
+
Content safety containers provide a default directory for writing the license file and billing log at runtime. The default directories are `/license` and `/output` respectively.
131
133
132
-
When you're mounting these directories to the container with the `docker run -v` command, make sure the local machine directory is set ownership to `user:group nonroot:nonroot` before running the container.
134
+
When you're mounting these directories to the container with the `docker run -v` command, make sure the local machine directory has set ownership to `user:group nonroot:nonroot` before running the container.
133
135
134
-
Here's a sample command to set file/directory ownership.
136
+
Here's a sample command to set file/directory ownership:
Once the container is up and running, you can validate its operation by sending a request to the REST endpoint deployed within the container. To do this, follow below article. Note, you need to replace the endpoint URL with the Docker URL specific to your container deployment. Also, ensure that you're using host authentication, rather than key-based authentication.
Once the container is up and running, you can validate its operation by sending a request to the REST endpoint deployed within the container. To do this, follow the steps in the quickstart. Note, you need to replace the endpoint URL with the Docker URL specific to your container deployment. Also, ensure that you're using host authentication, rather than key-based authentication.
0 commit comments