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 701 B

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