Skip to content

Commit 374b779

Browse files
authored
Merge pull request #175167 from jfilcik/patch-3
Clarifying and extending the visualization instructions
2 parents 810efa1 + 757e70f commit 374b779

File tree

1 file changed

+40
-10
lines changed

1 file changed

+40
-10
lines changed

articles/cognitive-services/Computer-vision/spatial-analysis-logging.md

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,49 @@ Spatial Analysis includes a set of features to monitor the health of the system
1818

1919
## Enable visualizations
2020

21-
To enable a visualization of AI Insights events in a video frame, you need to use the `.debug` version of a [Spatial Analysis operation](spatial-analysis-operations.md) on a desktop machine. The visualization is not possible on Azure Stack Edge devices. There are four debug operations available.
21+
To enable a visualization of AI Insight events in a video frame, you need to use the `.debug` version of a [Spatial Analysis operation](spatial-analysis-operations.md) on a desktop machine or Azure VM. The visualization is not possible on Azure Stack Edge devices. There are four debug operations available.
2222

23-
If your device is not an Azure Stack Edge device, edit the deployment manifest file for [desktop machines](https://github.com/Azure-Samples/cognitive-services-sample-data-files/blob/master/ComputerVision/spatial-analysis/DeploymentManifest_for_non_ASE_devices.json) to use the correct value for the `DISPLAY` environment variable. It needs to match the `$DISPLAY` variable on the host computer. After updating the deployment manifest, redeploy the container.
23+
If your device is a local desktop machine or Azure GPU VM (with remote desktop enabled), then then you can switch to `.debug` version of any operation and visualize the output.
2424

25-
After the deployment has completed, you might have to copy the `.Xauthority` file from the host computer to the container, and restart it. In the sample below, `peopleanalytics` is the name of the container on the host computer.
26-
27-
```bash
28-
sudo docker cp $XAUTHORITY peopleanalytics:/root/.Xauthority
29-
sudo docker stop peopleanalytics
30-
sudo docker start peopleanalytics
31-
xhost +
32-
```
25+
1. Open the desktop either locally or by using a remote desktop client on the host computer running Spatial Analysis.
26+
2. In the terminal run `xhost +`
27+
3. Update the [deployment manifest](https://github.com/Azure-Samples/cognitive-services-sample-data-files/blob/master/ComputerVision/spatial-analysis/DeploymentManifest_for_non_ASE_devices.json) under the `spaceanalytics` module with the value of the `DISPLAY` environment variable. You can find its value by running `echo $DISPLAY` in the terminal on the host computer.
28+
```
29+
"env": {
30+
"DISPLAY": {
31+
"value": ":11"
32+
}
33+
}
34+
```
35+
4. Update the graph in the deployment manifest you want to run in debug mode. In the example below, we update the operationId to cognitiveservices.vision.spatialanalysis-personcrossingpolygon.debug. A new parameter `VISUALIZER_NODE_CONFIG` is required to enable the visualizer window. All operations are available in debug flavor. When using shared nodes, use the cognitiveservices.vision.spatialanalysis.debug operation and add `VISUALIZER_NODE_CONFIG` to the instance parameters.
3336
37+
```
38+
"zonecrossing": {
39+
"operationId" : "cognitiveservices.vision.spatialanalysis-personcrossingpolygon.debug",
40+
"version": 1,
41+
"enabled": true,
42+
"parameters": {
43+
"VIDEO_URL": "Replace http url here",
44+
"VIDEO_SOURCE_ID": "zonecrossingcamera",
45+
"VIDEO_IS_LIVE": false,
46+
"VIDEO_DECODE_GPU_INDEX": 0,
47+
"DETECTOR_NODE_CONFIG": "{ \"gpu_index\": 0 }",
48+
"CAMERACALIBRATOR_NODE_CONFIG": "{ \"gpu_index\": 0}",
49+
"VISUALIZER_NODE_CONFIG": "{ \"show_debug_video\": true }",
50+
"SPACEANALYTICS_CONFIG": "{\"zones\":[{\"name\":\"queue\",\"polygon\":[[0.3,0.3],[0.3,0.9],[0.6,0.9],[0.6,0.3],[0.3,0.3]], \"threshold\":35.0}]}"
51+
}
52+
}
53+
```
54+
55+
5. Redeploy and you will see the visualizer window on the host computer
56+
6. After the deployment has completed, you might have to copy the `.Xauthority` file from the host computer to the container and restart it. In the sample below, `peopleanalytics` is the name of the container on the host computer.
57+
58+
```bash
59+
sudo docker cp $XAUTHORITY peopleanalytics:/root/.Xauthority
60+
sudo docker stop peopleanalytics
61+
sudo docker start peopleanalytics
62+
xhost +
63+
```
3464
3565
## Collect system health telemetry
3666

0 commit comments

Comments
 (0)