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.

no_webcam.py 691 B

12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. import time
  4. import urllib.request
  5. import numpy as np
  6. from dora import Node
  7. print("Hello from no_webcam.py")
  8. req = urllib.request.urlopen("https://ultralytics.com/images/zidane.jpg")
  9. arr = np.asarray(bytearray(req.read()), dtype=np.uint8)
  10. node = Node()
  11. start = time.time()
  12. while time.time() - start < 20:
  13. # Wait next dora_input
  14. event = node.next()
  15. match event["type"]:
  16. case "INPUT":
  17. print("received input", event["id"])
  18. node.send_output("image", arr.tobytes())
  19. case "STOP":
  20. print("received stop")
  21. case other:
  22. print("received unexpected event:", other)

DORA (Dataflow-Oriented Robotic Architecture) is middleware designed to streamline and simplify the creation of AI-based robotic applications. It offers low latency, composable, and distributed datafl