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.9 kB

1 year ago
1 year ago
1 year ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # Python Dataflow Example
  2. This examples shows how to create and connect dora operators and custom 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. - an object detection node, that apply Yolo v5 on the webcam image. The model is imported from Pytorch Hub. The output is the bounding box of each object detected, the confidence and the class. You can have more info here: https://pytorch.org/hub/ultralytics_yolov5/
  7. - a window plotting node, that will retrieve the webcam image and the Yolov5 bounding box and join the two together.
  8. ## Getting started
  9. ```bash
  10. pip install -r requirements.txt
  11. cargo run --example python-operator-dataflow
  12. ```
  13. ## Installation
  14. ```bash
  15. conda create -n example_env python=3.11
  16. conda activate test_env
  17. pip install -r requirements.txt
  18. pip install -r requirements_llm.txt
  19. ```
  20. ## Run the dataflow
  21. - Start the object detection dataflow alone:
  22. ```bash
  23. dora start dataflow.yml
  24. ```
  25. - Start the llm dataflow (Only works on Windows and Linux):
  26. ```bash
  27. dora start dataflow_llm.yml
  28. ```
  29. Within the window you can ask question such as:
  30. ```bash
  31. ask how are you
  32. change bounding box plot to red
  33. change confidence value to percentage
  34. change object detection to only detect person
  35. send 200 200 200 400 to topic line
  36. record
  37. ```
  38. The keyboard, microphone, whisper node, works in a very similar fashion as the object detection dataflow and I'll let you check it out by yourself.
  39. The code modification flow works by first comparing an instruction with a vectordb of operators source code and then feeding the most similar operator to an llm with the instruction for code modification.
  40. The end result is then saved using a file saver.