Skip to main content

This Module will help you out in merging your bboxes if overlaps

Project description

Bounding Box Merger

Merge your AI predicted Bounding boxes to get a single bounding box for each object.

Example Usage

Merge Boxes

from bbox_merger import merge_boxes
boxes = [[0, 0, 2, 2], [1, 1, 3, 3], [4, 4, 6, 6]]
merged_boxes = merge_boxes(boxes)
print(merged_boxes)
Output: [[0.0, 0.0, 3.0, 3.0], [4.0, 4.0, 6.0, 6.0]]

Calculate IoU

from bbox_merger import calculate_iou
box1 = [0, 0, 2, 2]
box2 = [1, 1, 3, 3]
merged_boxes = calculate_iou(box1, box2)
print(merged_boxes)
Output: 0.14285714285714285

Example

  1. Before Merging Bounding Boxes Image1

  2. After Merging Bounding Boxes Image2

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

bbox_merger-0.0.11.tar.gz (3.1 kB view hashes)

Uploaded Source

Supported by

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