MCPcopy Create free account

hub / github.com/roboflow/supervision / functions

Functions1,714 in github.com/roboflow/supervision

↓ 2 callersMethodcreate_class_members
Create index elements for the dataset.
src/supervision/metrics/mean_average_precision.py:284
↓ 2 callersFunctioncreate_yolo_dataset
Create a synthetic YOLO-format dataset on disk. Generates dummy images with YOLO-format annotations, `data.yaml` file, and directory str
tests/helpers.py:360
↓ 2 callersFunctiondetect
Detect objects in a frame using Inference model, filtering detections by class ID and confidence threshold. Args: frame (np.
examples/count_people_in_zone/inference_example.py:63
↓ 2 callersFunctiondetect
Detect objects in a frame using a YOLO model, filtering detections by class ID and confidence threshold. Args: frame (np.nda
examples/count_people_in_zone/ultralytics_example.py:61
↓ 2 callersFunctionedit_distance
Calculates the minimum number of single-character edits required to transform one string into another. Allowed operations are insertion,
src/supervision/detection/utils/vlms.py:4
↓ 2 callersFunctionextract_ultralytics_masks
(yolov8_results: Any)
src/supervision/detection/utils/internal.py:18
↓ 2 callersFunctionfindCodeBlockForCopyButton
(copyButton)
docs/javascripts/pycon_copy.js:125
↓ 2 callersFunctionfrom_florence_2
Parse results from the Florence 2 multi-model model. https://huggingface.co/microsoft/Florence-2-large Args: result: dict contai
src/supervision/detection/vlm.py:495
↓ 2 callersFunctionfrom_google_gemini_2_0
Parse and scale bounding boxes from Google Gemini style [JSON output](https://ai.google.dev/gemini-api/docs/vision?lang=python). The JSO
src/supervision/detection/vlm.py:591
↓ 2 callersFunctionfrom_moondream
Parse and scale bounding boxes from moondream JSON output. The JSON is expected to have a key "objects" with a list of dictionaries: {
src/supervision/detection/vlm.py:855
↓ 2 callersFunctionfrom_paligemma
Parse bounding boxes from paligemma-formatted text, scale them to the specified resolution, and optionally filter by classes. Args:
src/supervision/detection/vlm.py:215
↓ 2 callersMethodfrom_rgb_tuple
Create a Color instance from an RGB tuple. Args: color_tuple: A tuple representing the color in RGB format, where each
src/supervision/draw/color.py:149
↓ 2 callersMethodfrom_sam3
Creates a Detections instance from [SAM 3](https://github.com/facebookresearch/sam3) inference result. Supports both PVS and
src/supervision/detection/core.py:718
↓ 2 callersMethodfrom_value
(cls, value: ModelSize | str)
examples/time_in_zone/rfdetr_naive_stream_example.py:32
↓ 2 callersMethodfrom_value
(cls, value: ModelSize | str)
examples/time_in_zone/rfdetr_file_example.py:32
↓ 2 callersMethodfrom_value
(cls, value: ModelSize | str)
examples/time_in_zone/rfdetr_stream_example.py:28
↓ 2 callersMethodfrom_vlm
Creates a Detections object from the given result string based on the specified Vision Language Model (VLM). | Name
src/supervision/detection/core.py:1461
↓ 2 callersMethodget_annotation_ids
Get annotation ids that satisfy given filter conditions. Args: img_ids: ids of the images that we want to retrieve.
src/supervision/metrics/mean_average_precision.py:314
↓ 2 callersMethodget_annotations
Get annotations with the specified ids. Args: ids: integer ids specifying annotations. Returns: ann
src/supervision/metrics/mean_average_precision.py:445
↓ 2 callersFunctionget_bbox_size_category
Get the size category of a bounding boxes array. Args: xyxy: The bounding boxes array shaped (N, 4). Returns: The size
src/supervision/metrics/utils/object_size.py:85
↓ 2 callersMethodget_image_ids
Get image ids that satisfy given filter conditions. Args: img_ids: ids of the images to retrieve. cat_ids: i
src/supervision/metrics/mean_average_precision.py:414
↓ 2 callersFunctionget_instance_variables
Get the public variables of a class instance. Args: instance: The instance of a class include_properties: Whether to include
src/supervision/utils/internal.py:169
↓ 2 callersFunctionget_labels_text
Retrieves the text labels for the detections. If `custom_labels` are provided, they are used. Otherwise, the labels are extracted from t
src/supervision/annotators/utils.py:235
↓ 2 callersFunctionget_mask_size_category
Get the size category of detection masks. Args: mask: The mask array shaped (N, H, W), or a :class:`~supervision.detecti
src/supervision/metrics/utils/object_size.py:126
↓ 2 callersFunctionget_obb_size_category
Get the size category of a oriented bounding boxes array. Args: xyxyxyxy: The bounding boxes array shaped (N, 4, 2). Returns:
src/supervision/metrics/utils/object_size.py:168
↓ 2 callersFunctionget_polygon_center
Calculate the center of a polygon. The center is calculated as the center of the solid figure formed by the points of the polygon Args:
src/supervision/geometry/utils.py:7
↓ 2 callersMethodget_top_k
Retrieve the top k class IDs and confidences, ordered in descending order by confidence. Args: k: The number
src/supervision/classification/core.py:166
↓ 2 callersFunctiongroup_coco_annotations_by_image_id
( coco_annotations: list[CocoDict], )
src/supervision/dataset/formats/coco.py:84
↓ 2 callersFunctiongroup_within
(global_indices: npt.NDArray[np.int_])
src/supervision/detection/utils/iou_and_nms.py:1230
↓ 2 callersFunctioninitiate_polygon_zones
( polygons: list[np.ndarray], triggering_anchors: Iterable[sv.Position] = [sv.Position.CENTER], )
examples/traffic_analysis/inference_example.py:62
↓ 2 callersFunctioninitiate_polygon_zones
( polygons: list[np.ndarray], triggering_anchors: Iterable[sv.Position] = [sv.Position.CENTER], )
examples/traffic_analysis/ultralytics_example.py:60
↓ 2 callersMethodint
(self)
tests/helpers.py:260
↓ 2 callersFunctionis_data_equal
Compares the data payloads of two Detections instances. Args: data_a, data_b: The data payloads of the instances. Returns:
src/supervision/detection/utils/internal.py:202
↓ 2 callersMethodlist
(cls)
src/supervision/detection/utils/iou_and_nms.py:35
↓ 2 callersFunctionmask_to_polygons
Converts a binary mask to a list of polygons. Args: mask: A binary mask represented as a 2D NumPy array of shape `(H, W)`,
src/supervision/detection/utils/converters.py:307
↓ 2 callersFunctionmeasure_peak_bytes
Wrapper that runs *func* under tracemalloc and returns peak allocation. tracemalloc captures every Python-level allocation — numpy buffers, list
examples/compact_mask/benchmark.py:240
↓ 2 callersFunctionmerge_class_lists
(class_lists: list[list[str]])
src/supervision/dataset/utils.py:80
↓ 2 callersFunctionmerge_data
Merges the data payloads of a list of Detections instances. Warning: Assumes that empty detections were filtered-out before passing data to
src/supervision/detection/utils/internal.py:241
↓ 2 callersFunctionmock_detections_list
(boxes_list)
tests/metrics/test_mean_average_recall.py:383
↓ 2 callersFunctionmove_boxes
Args: xyxy: An array of shape `(n, 4)` containing the bounding boxes coordinates in format `[x1, y1, x2, y2]` offset:
src/supervision/detection/utils/boxes.py:164
↓ 2 callersFunctionmy_custom_processing_function
( image: np.ndarray, param_a: int, param_b: str, )
tests/utils/test_conversion.py:20
↓ 2 callersMethodpad
(self, padding: int)
src/supervision/geometry/core.py:188
↓ 2 callersFunctionparse_polygon_points
(polygon: Element)
src/supervision/dataset/formats/pascal_voc.py:339
↓ 2 callersFunctionprimeClipboardButton
(copyButton, strippedText)
docs/javascripts/pycon_copy.js:108
↓ 2 callersMethodprocess_frame
(self, frame: np.ndarray)
examples/traffic_analysis/inference_example.py:159
↓ 2 callersMethodprocess_frame
(self, frame: np.ndarray)
examples/traffic_analysis/ultralytics_example.py:156
↓ 2 callersFunctionprocess_roboflow_result
Parse a Roboflow API or Inference package result into detection arrays. The returned ``data`` dict always contains ``CLASS_NAME_DATA_FIELD`` as a
src/supervision/detection/utils/internal.py:54
↓ 2 callersMethodre_activate
(self, new_track: STrack, frame_id: int)
src/supervision/tracker/byte_tracker/single_object_track.py:100
↓ 2 callersFunctionread_json_file
Read a json file and return a dict. Args: file_path: The file path as a string or Path object. Returns: A dict of annot
src/supervision/utils/file.py:142
↓ 2 callersFunctionread_txt_file
Read a text file and return a list of strings without newline characters. Optionally skip empty lines. Args: file_path: The file
src/supervision/utils/file.py:92
↓ 2 callersFunctionresize_masks
Resize all masks in the array to have a maximum dimension of max_dimension, maintaining aspect ratio. Args: masks: 3D array of b
src/supervision/detection/utils/masks.py:263
↓ 2 callersFunctionresolve_color_idx
( detections: Detections, detection_idx: int, color_lookup: ColorLookup | npt.NDArray[np.int_] = C
src/supervision/annotators/utils.py:40
↓ 2 callersFunctionresolve_text_background_xyxy
( center_coordinates: tuple[int, int], text_wh: tuple[int, int], position: Position, )
src/supervision/annotators/utils.py:80
↓ 2 callersFunctionrgba_to_hex
Converts an RGBA tuple (0-255 each) to a hex color string. Args: rgba: RGBA values in range 0-255. Returns: Hex color s
src/supervision/annotators/utils.py:412
↓ 2 callersFunctionrun_command
(command: list)
examples/time_in_zone/scripts/stream_from_file.py:86
↓ 2 callersFunctionsnap_boxes
Shifts `label` bounding boxes into the frame so that they are fully contained within the given resolution, prioritizing the top/left edge.
src/supervision/annotators/utils.py:266
↓ 2 callersFunctionsub_tracks
Returns a list of tracks from track_list_a after removing any tracks that share the same internal_track_id with tracks in track_list_b.
src/supervision/tracker/byte_tracker/core.py:363
↓ 2 callersFunctionsum_over_mask
( indices: npt.NDArray[np.floating], axis: tuple[list[int], list[int]] )
src/supervision/detection/utils/masks.py:137
↓ 2 callersMethodtlbr_to_tlwh
(tlbr: npt.NDArray[np.float32])
src/supervision/tracker/byte_tracker/single_object_track.py:174
↓ 2 callersMethodupdate
( self, detections_all: sv.Detections, detections_in_zones: list[sv.Detections],
examples/traffic_analysis/inference_example.py:36
↓ 2 callersMethodwriterow
(self, row: Iterable[Any])
src/supervision/detection/tools/csv_sink.py:28
↓ 1 callersMethod__post_init__
(self)
src/supervision/key_points/core.py:298
↓ 1 callersMethod_accumulate
Accumulate per image evaluation results and store the result in self.results
src/supervision/metrics/mean_average_precision.py:825
↓ 1 callersFunction_aggregate_images_shape
( images: list[npt.NDArray[np.uint8]], mode: Literal["min", "max", "avg"] )
src/supervision/utils/image.py:728
↓ 1 callersFunction_append_result
Append one scenario result as a JSON line to *path*. ``math.nan`` (used for skipped dense timings) is serialised as ``null`` so the file is v
examples/compact_mask/benchmark.py:1060
↓ 1 callersFunction_arrays_almost_equal
( arr1: np.ndarray, arr2: np.ndarray, threshold: float = 0.99 )
tests/dataset/formats/test_yolo.py:32
↓ 1 callersMethod_average_precisions_per_class
Compute the average precision, given the recall and precision curves. Source: https://github.com/rafaelpadilla/Object-Detection-Metri
src/supervision/metrics/detection.py:1067
↓ 1 callersFunction_box_to_polygon
(box: npt.NDArray[np.float32])
src/supervision/dataset/formats/yolo.py:41
↓ 1 callersFunction_build_ydl_opts
(output_path: str | None, file_name: str | None)
examples/time_in_zone/scripts/download_from_youtube.py:12
↓ 1 callersMethod_calculate_anchor_in_frame
Calculate insertion anchor in frame to position the center of the count image. Args: line_zone: The line counter object
src/supervision/detection/line_zone.py:481
↓ 1 callersMethod_compute_anchor_sides
Find if detections' anchors are within the limit of the line zone and which anchors are on its left and right side. Assumes:
src/supervision/detection/line_zone.py:248
↓ 1 callersMethod_compute_average_recall_for_classes
( self, matches: npt.NDArray[np.bool_], prediction_indices: npt.NDArray[np.int32],
src/supervision/metrics/mean_average_recall.py:471
↓ 1 callersMethod_compute_confusion_matrix
Compute the confusion matrix for each class and IoU threshold. Assumes the matches and prediction_class_ids are sorted by confidence
src/supervision/metrics/mean_average_recall.py:539
↓ 1 callersMethod_compute_confusion_matrix
Compute the confusion matrix for each class and IoU threshold. Assumes the matches and prediction_class_ids are sorted by confidence
src/supervision/metrics/recall.py:307
↓ 1 callersMethod_compute_confusion_matrix
Compute the confusion matrix for each class and IoU threshold. Assumes the matches and prediction_class_ids are sorted by confidence
src/supervision/metrics/f1_score.py:347
↓ 1 callersMethod_compute_confusion_matrix
Compute the confusion matrix for each class and IoU threshold. Assumes the matches and prediction_class_ids are sorted by confidence
src/supervision/metrics/precision.py:351
↓ 1 callersMethod_compute_f1_for_classes
Compute F1 scores from concatenated stats across all images. ``unique_classes`` is the union of GT and predicted classes so that pred
src/supervision/metrics/f1_score.py:259
↓ 1 callersMethod_compute_iou
Compute the IoU between the targets and predictions for a given image and category. Args: img_id: The image id.
src/supervision/metrics/mean_average_precision.py:659
↓ 1 callersMethod_compute_precision_for_classes
Compute precision scores from concatenated stats across all images. ``unique_classes`` is the union of GT and predicted classes so that
src/supervision/metrics/precision.py:262
↓ 1 callersMethod_compute_recall
Broadcastable function, computing the recall from the confusion matrix. Args: confusion_matrix: shape (N, ..., 3), where
src/supervision/metrics/mean_average_recall.py:602
↓ 1 callersMethod_compute_recall_for_classes
( self, matches: npt.NDArray[np.bool_], prediction_confidence: npt.NDArray[np.float32]
src/supervision/metrics/recall.py:239
↓ 1 callersMethod_decompose_covariance
Eigendecompose a 2x2 covariance, returning sorted (eigenvalues, vectors).
src/supervision/key_points/annotators.py:315
↓ 1 callersFunction_detections
()
tests/test_validate_deprecations.py:33
↓ 1 callersMethod_draw_basic_label
Draw the count label on the frame. For example: "out: 7". The label contains horizontal text and is not rotated. Args:
src/supervision/detection/line_zone.py:545
↓ 1 callersMethod_draw_labels
( self, scene: npt.NDArray[np.uint8], labels: list[str], label_properties: npt
src/supervision/annotators/core.py:1387
↓ 1 callersMethod_draw_labels
( self, draw: ImageDraw.ImageDraw, labels: list[str], label_properties: npt.ND
src/supervision/annotators/core.py:1701
↓ 1 callersMethod_draw_labels
Draw the labels, explaining what each color represents, with automatically computed positions. Args: scene: The
src/supervision/annotators/core.py:3226
↓ 1 callersMethod_draw_oriented_label
Draw the count label on the frame. For example: "out: 7". The label is oriented to match the line angle. Args: f
src/supervision/detection/line_zone.py:588
↓ 1 callersFunction_draw_texts
( images: list[npt.NDArray[np.uint8]], titles: list[str | None] | None, titles_anchors: list[Point
src/supervision/utils/image.py:816
↓ 1 callersMethod_drop_extra_matches
Deduplicate matches. If there are multiple matches for the same true or predicted box, only the one with the highest IoU is kept.
src/supervision/metrics/detection.py:577
↓ 1 callersFunction_establish_grid_size
( images: list[npt.NDArray[np.uint8]], grid_size: tuple[int | None, int | None] | None, )
src/supervision/utils/image.py:739
↓ 1 callersMethod_evaluate_image
Perform evaluation for single category and image. Args: img_id: The image id. cat_id: The category id.
src/supervision/metrics/mean_average_precision.py:700
↓ 1 callersFunction_fake_seg_callback
Return two non-overlapping segmentation detections for any tile.
tests/detection/test_inference_slicer_compact.py:18
↓ 1 callersFunction_generate_tiles
( images: list[npt.NDArray[np.uint8]], grid_size: tuple[int, int], single_tile_size: tuple[int, in
src/supervision/utils/image.py:767
↓ 1 callersMethod_get_by_2d_bool_mask
Filter keypoints using a 2D boolean mask of shape `(n, m)`. This method selects the **same set of keypoints from every object**, so e
src/supervision/key_points/core.py:830
↓ 1 callersMethod_get_covariances
(self, key_points: KeyPoints)
src/supervision/key_points/annotators.py:298
↓ 1 callersMethod_get_image
Assumes that image is in dataset.
src/supervision/dataset/core.py:101
↓ 1 callersMethod_get_image
Assumes that image is in dataset.
src/supervision/dataset/core.py:766
↓ 1 callersMethod_get_label_properties
( self, detections: Detections, labels: list[str], )
src/supervision/annotators/core.py:1333
↓ 1 callersMethod_get_label_properties
( self, draw: ImageDraw.ImageDraw, detections: Detections, labels: list[str] )
src/supervision/annotators/core.py:1649
← previousnext →301–400 of 1,714, ranked by callers