Skip to content

fix: border thickness parameter usage for PercentageBarAnnotator #1906

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 22, 2025

Conversation

soumik12345
Copy link
Contributor

Description

Fixes #1905

List any dependencies that are required for this change.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How has this change been tested, please provide a testcase or example of how you tested the change?

Using the following script:

from ultralytics import YOLO
import supervision as sv
from supervision.assets import download_assets, VideoAssets


download_assets(VideoAssets.PEOPLE_WALKING)
model = YOLO("yolov8m.pt")

box_annotator = sv.BoxAnnotator()
percentage_bar_annotator = sv.PercentageBarAnnotator(border_thickness=8)

def callback(frame, _):
    results = model(frame, verbose=False)[0]
    detections = sv.Detections.from_ultralytics(results)
    detections = detections[detections.class_id == 0]
    annotated_frame = box_annotator.annotate(
        scene=frame, detections=detections
    )
    annotated_frame = percentage_bar_annotator.annotate(
        scene=annotated_frame, detections=detections
    )
    return annotated_frame

sv.process_video(
    source_path="people-walking.mp4",
    target_path="output.mp4",
    callback=callback,
    show_progress=True,
    max_frames=100,
)

@soumik12345 soumik12345 self-assigned this Jul 22, 2025
@SkalskiP SkalskiP merged commit 0c8a9d3 into develop Jul 22, 2025
20 checks passed
@soumik12345 soumik12345 deleted the fix/border_thickness branch July 22, 2025 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot set border thickness for PercentageBar
2 participants