Dora Node for detecting objects in images using YOLOv8
This node is used to detect objects in images using YOLOv8.
YAML
- id: object_detection
build: pip install ../../dora-yolo
path: dora-yolo
inputs:
image: webcam/image
outputs:
- bbox
env:
MODEL: yolov5n.pt
Inputs
image: Arrow array containing the base image
## Image data
image_data: UInt8Array # Example: pa.array(img.ravel())
metadata = {
"width": 640,
"height": 480,
"encoding": str, # bgr8, rgb8
}
## Example
node.send_output(
image_data, {"width": 640, "height": 480, "encoding": "bgr8"}
)
## Decoding
storage = event["value"]
metadata = event["metadata"]
encoding = metadata["encoding"]
width = metadata["width"]
height = metadata["height"]
if encoding == "bgr8":
channels = 3
storage_type = np.uint8
frame = (
storage.to_numpy()
.astype(storage_type)
.reshape((height, width, channels))
)
Outputs
bbox: an arrow array containing the bounding boxes, confidence scores, and class names of the detected objects
bbox: {
"bbox": np.array, # flattened array of bounding boxes
"conf": np.array, # flat array of confidence scores
"labels": np.array, # flat array of class names
}
encoded_bbox = pa.array([bbox], {"format": "xyxy"})
decoded_bbox = {
"bbox": encoded_bbox[0]["bbox"].values.to_numpy().reshape(-1, 4),
"conf": encoded_bbox[0]["conf"].values.to_numpy(),
"labels": encoded_bbox[0]["labels"].values.to_numpy(zero_copy_only=False),
}
Example
Check example at examples/python-dataflow
License
This project is licensed under Apache-2.0. Check out NOTICE.md for more information.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dora_yolo-0.5.0.tar.gz
(3.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dora_yolo-0.5.0.tar.gz.
File metadata
- Download URL: dora_yolo-0.5.0.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1ac4287d0082d0b8b59c8ecc32cc38ef760b20a37876864dcab12b22ebb811a
|
|
| MD5 |
08868c639b9e8650c12af1d150993654
|
|
| BLAKE2b-256 |
f69a89cbefa5b0808b00ee69c994d00f90a784c0cd366df2bb5c08a4b35700f6
|
File details
Details for the file dora_yolo-0.5.0-py3-none-any.whl.
File metadata
- Download URL: dora_yolo-0.5.0-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d096b089421e82bd2f5b12bbfac7be0389dd640fd7f2199640586a85c1a0cc60
|
|
| MD5 |
46abbb76386f4346c045776811d9d48c
|
|
| BLAKE2b-256 |
3654628ebe62639ee0c8f2e5c7fa6f659dc2095612b4a750454d4fe5b8ef7b97
|