Buffer Interprocess Sharing: Examples - C++ to Python

From RidgeRun Developer Wiki


Previous: Examples/Python Index Next: Examples/Docker Containers






Introduction

BIPS was conceived with the idea of communicating C++-based video capture applications communicating with AI algorithms in Python. For instance, using GStreamer to capture video from a sensor in a Jetson platform and consuming the video feed in a PyTorch application.


Considering the examples provided in C++ and Python, the use case will be

  • One-to-one communication

The example binaries are compiled after building. If the build directory is build:

├── python
|   └── examples
|       └── one-to-one
|           ├── consumer.py
|           └── producer.py
└── src
    └── examples
        └── one-to-one
            ├── consumer
            └── producer

Executable options

Consider the examples provided before:

Running the examples

One-to-one example

1. Open two different terminals: one for the producer and another for the consumer.

2. In terminal 1, execute the producer:

./producer

3. In terminal 2, execute the consumer (be sure of being in the python/examples/one-to-one directory:

python3 consumer.py



Previous: Examples/Python Index Next: Examples/Docker Containers