roboflow / supervision

We write your reusable computer vision tools. 💜
https://supervision.roboflow.com
MIT License
17.06k stars 1.3k forks source link

overlay_image() function #1301

Closed Bhavay-2001 closed 3 hours ago

Bhavay-2001 commented 1 week ago

Search before asking

Bug

The overlay_image function used in the CropAnnotator class here has different arguments as compared to the parameters in the overlay_image function defined over here

Environment

No response

Minimal Reproducible Example

import supervision as sv
from inference import get_model
import cv2

model = get_model(model_id="yolov8n-seg-640")
image = cv2.imread('/content/highway.jpg')
results = model.infer(image)[0]
detections = sv.Detections.from_inference(results)

crop_annotator = sv.CropAnnotator()
annotated_frame = crop_annotator.annotate(
    scene=image.copy(),
    detections=detections
)
cv2.imshow(annotated_frame)

Additional

No response

Are you willing to submit a PR?

LinasKo commented 5 days ago

Confirming the bug: https://colab.research.google.com/drive/1liqwH6p_rPbNrV2D1jPPe8pOmoA0DCME?usp=sharing

@Bhavay-2001, if you're still keen, feel free to open a PR with the fix!