Skip to content

Commit

Permalink
Merge pull request #37 from antoniomtz/loss-prevention-logic
Browse files Browse the repository at this point in the history
docs: loss prevention business logic
  • Loading branch information
antoniomtz authored Oct 29, 2024
2 parents 6a65d42 + 5f3cd92 commit 8ccccbc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs_src/use-cases/loss-prevention/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,29 @@ To find all supported classes by YOLOv8, you can find them in this file `src/ext
CLASS_IDS="0,2"
```

## MQTT Inference Export and ROI Detection

This applicaiton enables monitoring object entry and exit within a defined Region of Interest (ROI), allowing real-time event tracking and external message handling.
The `yolov8s_roi.json` pipeline exports the inference data through MQTT using mosquitto broker defined in the `docker-compose.yml` file.

To change the default MQTT URL, edit the file `src/pipelines/yolov8s_roi.sh` and update the variable `MQTT_HOST="127.0.0.1:1883"`.

We have developed a business logic application in `src/app/loss_prevention.py` that tracks objects entering and exiting a defined ROI, generating corresponding events.

To configure the app to connect to external MQTT broker, modify the `src/docker-compose.yml` and change the following env variables:

| Variable | Default | Description |
|------------|----------------|------------------------------------------|
| `MQTT_URL` | `127.0.0.1` | MQTT Broker URL |
| `MQTT_PORT`| `1883` | MQTT Broker Port |
| `MQTT_TOPIC` | `event/detection` | Topic for publishing inference data |
| `ROI_NAME` | `BASKET` | The name of the ROI used to filter objects |


The following diagram illustrates the containers running:

[![MQTT export](./images/mqtt-diagram.jpg)](./images/mqtt-diagram.jpg)


For enviroments variables, follow the same tutorial as the automated self checkout [HERE](../automated-self-checkout/advanced.md)

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8ccccbc

Please sign in to comment.