Skip to main content

Dora Node for object detection with dora YOLOv8

Project description

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 ../../node-hub/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.

Project details


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.3.10rc1.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dora_yolo-0.3.10rc1-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file dora_yolo-0.3.10rc1.tar.gz.

File metadata

  • Download URL: dora_yolo-0.3.10rc1.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.2

File hashes

Hashes for dora_yolo-0.3.10rc1.tar.gz
Algorithm Hash digest
SHA256 64a756920237b3bf6d54713f04e0cfd022b914a954c47f16ed4f142984153b03
MD5 d19b0866f49c411854654e4efb9e6bc5
BLAKE2b-256 ea43902f87a7b322fa7bd9273c78f9204f3a8f8e7d831476188d09ffb4008962

See more details on using hashes here.

File details

Details for the file dora_yolo-0.3.10rc1-py3-none-any.whl.

File metadata

File hashes

Hashes for dora_yolo-0.3.10rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 30f903567bcfc1f41d429bf16c58cc7e713593ed96e8648a61e9a4fda6af9c27
MD5 179f6976ea6fb9bfcfcd42f74761432f
BLAKE2b-256 5e9ba583f151bd1904f6aa3f3a1c24f1952ae993e8dad5feadc0b765d29e8454

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page