You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 1.4 kB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Python Dataflow Example
  2. This examples shows how to create and connect dora nodes in Python.
  3. ## Overview
  4. The [`dataflow.yml`](./dataflow.yml) defines a simple dataflow graph with the following three nodes:
  5. - a webcam node, that connects to your webcam and feed the dataflow with webcam frame as jpeg compressed bytearray.
  6. - a window plotting node, that will retrieve the webcam image and plot it.
  7. The same dataflow is implemented for a `dynamic-node` in [`dataflow_dynamic.yml`](./dataflow_dynamic.yml). It contains
  8. the same nodes as the previous dataflow, but the plot node is a dynamic node. See the next section for more
  9. information on how to start such a dataflow.
  10. ## Getting started
  11. After installing Rust, `dora-cli` and `Python >3.11`, you will need to **activate** (or create and **activate**) a
  12. [Python virtual environment](https://docs.python.org/3/library/venv.html).
  13. Then, you will need to install the dependencies:
  14. ```bash
  15. cd examples/python-dataflow
  16. dora build ./dataflow.yml --uv (or dora build ./dataflow_dynamic.yml --uv)
  17. ```
  18. It will install the required dependencies for the Python nodes.
  19. Then you can run the dataflow:
  20. ```bash
  21. dora run ./dataflow.yml --uv (or dora start ./dataflow_dynamic.yml --uv)
  22. ```
  23. **Note**: if you're running the dynamic dataflow, you will need to start manually the opencv-plot node:
  24. ```bash
  25. # activate your virtual environment in another terminal
  26. python opencv-plot --name plot
  27. ```