# Run the reference solutions
The following reference solutions use multiple microservices to implement the end-to-end use case.
- PPE: Personal protective equipment
- RZ: Restricted zone
## Personal protective equipment (PPE)
The personal protective equipment (PPE) solution enhances workplace safety by automatically detecting and verifying the use of PPE
by running AI-based analytics on real-time video feeds collected by network-connected cameras through RTSP.
Utilizing advanced computer vision and deep learning algorithms, this solution identifies various types
of PPE, such as helmets and safety vests, ensuring compliance with safety regulations. It helps
organizations maintain a safer work environment by ensuring all personnel are equipped with the necessary
protective gear.

### Key features
- Real-time detection: Utilizes AI-powered image recognition to monitor and verify the use of PPE on-site.
- Configurable alerts: Clients can configure various alert triggers via HTTP, enabling customized notifications
based on specific safety requirements.
- Alert querying: Provides an HTTP interface to query alerts, enabling clients to review and manage safety
compliance data efficiently.
The PPE reference solution uses the following microservices:
- **qimsdk-ppe**: This microservice constructs an AI pipeline using the Qualcomm Intelligent Multimedia SDK (IM SDK).
It employs two daisy-chained detection models. The first detects persons and then the cropped frame of
the detected person is sent to the accessory detection model.
The processed streams generate detection metadata which is published to Redis in the detection channel
as JSON data.
- **pas**: The person analytic microservice processes AI inference data and compares it with the configured
alert triggers to generate alerts.
- **paapii**: The people analytics API (PAAPI) microservice exposes a web service you can use to configure alert triggers. For
example, the model that ships with this sample microservice detects PPE like helmets and safety vests.
You can set up a trigger to require one or both of these accessories and generate an alert if a person
is detected without the necessary accessories. The web service also has APIs to poll for triggered alerts.
- **nginx**: nginx serves as the reverse proxy. It manages incoming API requests and routes the HTTP people-analytics
endpoints to PAAPI.
- **mariadb**: MariaDB is used as the database to store processed triggers and other relevant data. The PAAPI
container interacts with MariaDB to store and retrieve data which can then be accessed by the client/UI
through API calls.
- **redis**: Redis acts as the message broker in this architecture. It facilitates communication between
different microservices by publishing and subscribing to channels.
### Steps to run
Prerequisites
- The EVK, RTSP camera (optional), and host computer are connected to the same network.
- The EVK is connected to a display.
- Qualcomm Dragonwing™ RB3 Gen 2: HDMI
- Qualcomm IQ-9075: DP
- If using the RTSP camera, note camera’s address, for example, `rtsp://user:mypassword@192.168.0.11:554/Streaming/Channels/101`.
1. Download the [use-cases folder](https://git.codelinaro.org/clo/le/solutions-microservices/-/tree/a38fb8cf0858205ffd5ecce5ddcf713f5ecec23a/use-cases)
by selecting **Code > Download this directory**.

This contains `docker-compose` for the PPE reference solution, common configurations, and other `docker-compose` dependencies.
2. Unzip and push code to the device.
1. SSH to the EVK.
ssh root@
Copy to clipboard
2. Enter the password.
oelinux123
Copy to clipboard
3. From the host computer, copy the `use-cases` contents to the device.
scp -r use-cases root@:/etc/
Copy to clipboard
3. Download the models from Qualcomm AI Hub and copy them to the EVK.
1. [Person-Foot-Detection-Quantized](https://aihub.qualcomm.com/iot/models/foot_track_net)
1. Click **Download model**.
2. Select `TFLite` as the runtime.
3. Select `w8a8` as the precision.
4. Click **Download model**.

2. [PPE-Detection-Quantized](https://aihub.qualcomm.com/iot/models/gear_guard_net)
1. Click **Download model**.
2. Select `TFLite` as the runtime.
3. Select `w8a8` as the precision.
4. Click **Download model**.

3. Once the models are downloaded, copy the models to the device.
1. From the host comupter, copy the downloaded models to the device:
scp foot_track_net-person-foot-detection-w8a8.tflite root@:/etc/models/foot_track_net_quantized.tflite
Copy to clipboard
scp gear_guard_net-ppe-detection-w8a8.tflite root@:/etc/models/gear_guard_net_quantized.tflite
Copy to clipboard
4. Select your video source.
The video source can be changed by setting the following variables in the device shell before running the use-case.
- `INPUT_TYPE`: `video` (for offline video) or `rtsp` (for RTSP camera input)
- `INPUT_URL`: Location of the offline video file or the camera address depending on which `INPUT_TYPE` is selected.
By default, `INPUT_TYPE` is `video` and `INPUT_URL` is the location of sample-video prepackaged in the container (`/opt/sample-videos/person_sample_video.mp4`)
along with the model and label files.
Tab video (offline video file)
Tab rtsp (RSTP camera input)
No modifications are needed. You can directly run the reference solution.
From the `/etc/use-cases/ppe/` directory in the device shell, run:
export INPUT_TYPE=rtsp
Copy to clipboard
export INPUT_URL=rtsp://:@:/
Copy to clipboard
5. Run the PPE reference solution.
Start the solution using `docker-compose`. From the `/etc/use-cases/ppe/` directory in the device shell, run:
docker-compose -f docker-compose-.yml up -d
Copy to clipboard
Tip
The directory contains multiple docker compose files. Choose the one that matches your device and use case, for example,
`docker-compose-qcs6490` for Qualcomm Dragonwing™ RB3 Gen 2.
6. Check that all microservices are running. In the device shell, run:
docker ps
Copy to clipboard
This shows all running, PPE-related microservices.
You should see the output on the HDMI display and RTSP output on *rtsp://<device-ip>:8900/live*
7. Set and query the status of alert triggers using the exposed HTTP interface.
See the [PPE OpenAPI specification](https://git.codelinaro.org/clo/le/solutions-microservices/-/blob/iot-solutions.lnx.1.0/analytics/people-analytics/people-analytics-api/data/api/openapi.yaml).
1. Set triggers. In the host computer’s terminal, run:
curl -X POST "http:///people-analytics/v1/api/config/alerts/fov" -H "accept: */*" -H "Content-Type: application/json" -d "{\"monitor_id\":\"0\",\"trigger_id\":\"1\",\"trigger_name\":\"Person lacking hard hat and vest\",\"trigger_condition\":\"required_accessories\",\"params\":[{\"name\":\"accessories\",\"value\":\"vest, hardhats\"}]}"
Copy to clipboard
2. Get triggers. In the host computer’s terminal, run:
curl -X GET "http:///people-analytics/v1/api/config/alerts/fov?monitorId=0" -H "accept: application/json"
Copy to clipboard
3. Get alerts. In the host computer’s terminal, run:
$curl -X GET "http:///people-analytics/v1/api/alerts/fov?monitorIds=0&fromTime=0&toTime=2723670939" -H "accept: application/json"
Copy to clipboard
Note
This example gets alerts from 0 to year 2056.
To get alerts with EPOCH in 1980 January 6 02:03:35.662 to 02:03:38.662, run:
curl -X GET "http:///people-analytics/v1/api/alerts/fov?monitorIds=0&fromTime=315972218.662&toTime=328761633" -H "accept: application/json"
Copy to clipboard
Note
Ensure time is EPOCH in the seconds format (for example: `2723670939`) or the milliseconds format with decimals (for example: `315972215.662`).
4. Delete triggers. In the host computer’s terminal, run:
curl -X DELETE "http:///people-analytics/v1/api/config/alerts/fov?triggerId=1" -H "accept: application/json"
Copy to clipboard
5. Listen to Redis messages published on various channels. In the device shell, run:
docker exec -it redis redis-cli
Copy to clipboard
This allows you to run any Redis command in the CLI.
PSUBSCRIBE detection.ppe:0
Copy to clipboard
This pattern subscribes to the `detection.ppe:0` channel to listen to Redis messages published there.
8. Stop the solution. From the `/etc/use-cases/ppe` directory in the device shell, , run:
docker-compose -f docker-compose-.yml down
Copy to clipboard
## Restricted zone (RZ)
The restricted zone (RZ) microservice in end-to-end AI video pipelines is designed to enhance security by monitoring and controlling
access to sensitive or restricted areas. This microservice uses advanced computer vision and machine learning techniques
to identify unauthorized entry and ensure that only authorized personnel can access these zones.
### Key features
- Configurable zones of interest: Clients can define multiple zones of interest for each camera feed through an HTTP
interface.
- AI-based region detection: Advanced AI models accurately detect individuals inside or outside the configured zones
in real-time video streams.
- Flexible alert configuration: Clients can set up alerts based on the minimum or maximum number of people detected
within or outside the specified zones of interest.
### Software architecture

### Services
The RZ solution uses 7 containers running together to demonstrate this end-to-end use case.
- **qimsdk-docker**: This microservice constructs an AI pipeline using the Qualcomm IM SDK. It employs AI models to
track the location of people in the camera field of view and publish that information through Redis to the rest
of the system.
- **ras**: The region analytics microservice processes the AI inference data, compares it with the configured alert triggers
and restricted zones, and generates alerts.
- **raapi**: region analytics API (RAAPI) exposes a web service which you can use to configure restricted zones in a camera field of view and
alert triggers based on how many people need to be inside (or outside) the configured zones before an alert is
triggered.
- **nginx**: nginx serves as the reverse proxy. It manages incoming API requests and routes the HTTP endpoints to RAAPI.
- **mariadb**: MariaDB is used as the database to store processed triggers and other relevant data. The RAAPI
container interacts with MariaDB to store and retrieve data which can then be accessed by the client/UI
through API calls.
- **redis**: Redis acts as the message broker in this architecture. It facilitates communication between
different microservices by publishing and subscribing to channels.
### Steps to run
Prerequisites
- The Qualcomm Dragonwing™ RB3 Gen 2 or Qualcomm IQ-9075 EVK, RTSP camera (optional), and host computer are connected to the same network.
- The EVK is connected to a display.
- Qualcomm Dragonwing™ RB3 Gen 2: HDMI
- Qualcomm IQ-9075: DP
- If using the RTSP camera, note camera’s address, for example, `rtsp://user:mypassword@192.168.0.11:554/Streaming/Channels/101`.
1. Download the [use-cases folder](https://git.codelinaro.org/clo/le/solutions-microservices/-/tree/a38fb8cf0858205ffd5ecce5ddcf713f5ecec23a/use-cases)
by selecting **Code > Download this directory**.

This contains `docker-compose` for the RZ reference solution, common configurations, and other `docker-compose` dependencies.
2. Unzip and push code to the device.
1. SSH to the EVK.
ssh root@
Copy to clipboard
2. Enter the password.
oelinux123
Copy to clipboard
3. Copy the `use-case` contents to the EVK. From the host computer, run:
scp -r use-cases root@:/etc/
Copy to clipboard
3. Download the model from Qualcomm AI Hub and copy it to the EVK.
1. [Person-Foot-Detection-Quantized](https://aihub.qualcomm.com/iot/models/foot_track_net)
1. Click **Download model**.
2. Select `TFLite` as the runtime.
3. Select `w8a8` as the precision.
4. Click **Download model**.

1. Once the model is downloaded, copy the models to the device.
1. From the host comupter, copy the downloaded model to the device:
scp foot_track_net-person-foot-detection-w8a8.tflite root@:/etc/models/foot_track_net_quantized.tflite
Copy to clipboard
4. Select your video source.
The video source can be changed by setting the following variables in the device shell before running the use case.
- `INPUT_TYPE`: `video` (for offline video) or `rtsp` (for RTSP camera input)
- `INPUT_URL`: Location of the offline video file or the camera address depending on which `INPUT_TYPE` is selected.
By default, `INPUT_TYPE` is `video` and `INPUT_URL` is the location of sample-video prepackaged in the container (`/opt/sample-videos/person_sample_video.mp4`)
along with the model and label files.
Tab video (offline video file)
Tab rtsp (RTSP camera input)
No modifications are needed. You can directly run the reference solution.
From the `/etc/use-cases/restricted-zone/` directory in the device shell, run:
export INPUT_TYPE=rtsp
Copy to clipboard
export INPUT_URL=rtsp://:@:/
Copy to clipboard
5. Run the RZ reference solution.
Start the solution using `docker-compose`. From the `/etc/use-cases/restricted-zone/` directory in the device shell, run:
docker-compose -f docker-compose-.yml up -d
Copy to clipboard
Tip
The directory contains multiple `docker-compose` files. Choose the one that matches your device and use case,
for example, `docker-compose-qcs6490.yml`.
6. Check that all microservices are running. In the device shell, run:
docker ps
Copy to clipboard
This shows all running, RZ-related microservices.
You should see the output on the HDMI display and RTSP output on *rtsp://<device-ip>:8900/live*
7. Set and query the status of alert triggers using the exposed HTTP interface.
See the [RZ OpenAPI specification](https://git.codelinaro.org/clo/le/solutions-microservices/-/blob/iot-solutions.lnx.1.0/analytics/region-analytics/region-analytics-api/data/api/openapi.yaml).
1. Set a region. In the host computer’s terminal, run:
curl -X POST "http:///region-analytics/v1/api/config/region" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"monitor_id\":\"0\",\"region_id\":\"1\",\"region_name\":\"Rectangle covering bottom half of monitor\",\"coordinates\":[{\"x\":0,\"y\":0.5},{\"x\":1,\"y\":0.5},{\"x\":0,\"y\":1},{\"x\":1,\"y\":1}]}"
Copy to clipboard
2. Set a trigger for the region set above. In the host computer’s terminal, run:
curl -X POST "http:///region-analytics/v1/api/config/alerts/region" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"region_id\":\"1\",\"trigger_id\":\"1\",\"trigger_name\":\"Alert each time occupancy changes in region; no params needed.\",\"trigger_condition\":\"occupancy_changed\"}"
Copy to clipboard
3. Get a region. In the host computer’s terminal, run:
curl -X GET "http:///region-analytics/v1/api/config/region?monitorId=0" -H "accept: application/json"
Copy to clipboard
4. Get a trigger. In host computer’s terminal, run:
curl -X GET "http:///region-analytics/v1/api/config/alerts/region?monitorId=0" -H "accept: application/json"
Copy to clipboard
5. Get alerts from 0 to year 2056. In the host computer’s terminal, run:
curl -X GET "http:///region-analytics/v1/api/alerts/region?monitorIds=0&fromTime=0&toTime=2723670939" -H "accept: application/json"
Copy to clipboard
Note
Make sure time is EPOCH in the seconds format (for example `2723670939`) or the milliseconds format with decimals (for example `315972215.662`).
6. Delete a region. In the host computer’s terminal, run:
curl -X DELETE "http:///region-analytics/v1/api/config/region?regionId=1" -H "accept: application/json"
Copy to clipboard
7. Delete triggers. In the host computer’s terminal, run:
curl -X DELETE "http:///region-analytics/v1/api/config/alerts/region?triggerId=1" -H "accept: application/json"
Copy to clipboard
8. Listen to Redis messages published on various channels. In the device shell, run:
docker exec -it redis redis-cli
Copy to clipboard
This allows you to run Redis commands in the CLI.
PSUBSCRIBE detection.rz:0
Copy to clipboard
This pattern subscribes to the `detection.rz:0` channel to listen to Redis messages published there.
8. Stop the solution. From the `/etc/use-cases/restricted-zone/` directory in the device shell, run:
docker-compose -f docker-compose-.yml down
Copy to clipboard
Last Published: May 09, 2025
[Previous Topic
Getting Started: Running AI Workflow Samples](https://docs.qualcomm.com/bundle/publicresource/80-84692-1/topics/getting-started.md) [Next Topic
Customize and build microservices](https://docs.qualcomm.com/bundle/publicresource/80-84692-1/topics/build-and-customize-microservices.md)