roboflow / roboflow/supervision

[weighted_box_fussion] - an alternative for `box_non_max_suppression`

Open
#268 10 comments 1 reaction 2 assignees View on GitHub

@hardikdava is already working on this.

Since Aug 7, 2023.

API:detection enhancement Q2.2024
Dominant language
Python
Stars
50.9k
Forks
4.8k
Avg merge
1d 12h
Merged PRs (30d)
85

Description

Search before asking
  • I have searched the Supervision issues and found no similar feature requests.
Description

Current object detection models removes overlapping boxes by nms which can reduce accuracy of the final results. It can be avoided by Weighted Box Fusion which can accepts all the prediction whether from a single model or multiple models.

Reference: Weighted Box Fusion
Original Implementation: ensemble-boxes

Use case
import supervision as sv

wbf = sv.WeightedBoxFusion()

res_a = model_a(image)
det_a = sv.Detection(res_a)

res_b = model_b(image)
det_b = sv.Detection(res_b)

wbf_detections = wbf([det_a, det_b])
Additional

class WeightedBoxFusion:

	def __init__(self):
		pass
	
	def __call__(self, detections: Union[Detections, List[Detections]]) -> Detections:
		pass
		result_detections = Detections(...)
		return result_detections 

Are you willing to submit a PR?
  • Yes I'd like to help by submitting a PR!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.