Deprecated¶
These features are phased out due to better alternatives or potential issues in future versions. Deprecated functionalities are typically supported for multiple subsequent releases, providing time for users to transition to updated methods.
sv.box_non_max_suppression,sv.mask_non_max_suppression,sv.oriented_box_non_max_suppression,sv.box_soft_non_max_suppression,sv.mask_soft_non_max_suppression,sv.oriented_box_soft_non_max_suppressionandsv.box_weighted_box_fusionare deprecated insupervision-0.33.0and will be removed insupervision-0.36.0. Usesv.Detections.with_nms,with_soft_nmsorwith_fusion. For five-column predictions, omitclass_idand passclass_agnostic=True. Pass the originaloverlap_metricexplicitly. Useoverlap_on="mask"for mask suppression oroverlap_on="box"for box or oriented-box suppression. Fusion supports axis-aligned boxes, oriented boxes and masks. Useoverlap_on="mask"(the default for detections with masks) to fuse by mask overlap, oroverlap_on="box"to fuse axis-aligned detections by their boxes and unite their masks. Detections carrying both masks and oriented boxes are unsupported by fusion. To retain the surviving row indices, setdetections.data["index"] = np.arange(len(detections))beforewith_nmsand readdata["index"]afterwards. To retrieve all decayed Soft-NMS scores, passscore_threshold=Noneand read the returnedconfidence.sv.box_non_max_merge,sv.mask_non_max_mergeandsv.oriented_box_non_max_mergestay: they are the public way to get merge groups.- Importing from
supervision.detection.utils.iou_and_nmsis deprecated insupervision-0.33.0and will be removed insupervision-0.36.0. Import the IoU functions and overlap enums fromsupervision.detection.utils.iou, and the suppression, merge and fusion functions fromsupervision.detection.utils.nms. Names exported from the top-levelsupervisionpackage are not affected. - Passing
overlap_metricormask_dimensionpositionally tosv.mask_non_max_mergeis deprecated insupervision-0.30.0and will be removed insupervision-0.33.0. Pass both by keyword instead. - Passing a
list[sv.Color]ascolorortext_colortosv.VertexLabelAnnotatoris deprecated insupervision-0.32.0and will be removed insupervision-0.35.0. Pass a singlesv.Color, or asv.ColorPalettetogether withcolor_lookup=sv.ColorLookup.KEYPOINT. resolve_color,resolve_color_idx, andget_color_by_indexinsupervision.annotators.utilsare deprecated insupervision-0.32.0and will be removed insupervision-0.35.0.resolve_coloris also still importable fromsupervision.annotators.core; that copy is deprecated insupervision-0.32.0too and will be removed insupervision-0.35.0. Pass asv.ColorPalettewithcolor_lookupto the annotators instead.load_coco_annotationsimported fromsupervision.dataset.coreandget_detection_size_categoryimported fromsupervision.metrics.mean_average_recallare deprecated insupervision-0.32.0and will be removed insupervision-0.35.0. Import them fromsupervision.dataset.formats.cocoandsupervision.metrics.utils.object_size.- Omitting
mask_rasterizerinsv.DetectionDataset.from_cocofor files with polygon segmentation is deprecated insupervision-0.32.0. The default changes from"supervision"to"pycocotools"no earlier thansupervision-0.35.0. Passmask_rasterizerexplicitly.
Removed¶
0.32.0¶
KeyPoints.confidenceand theconfidenceargument ofKeyPoints()were removed as ofsupervision-0.32.0. UseKeyPoints.keypoint_confidenceinstead.- The public
validate_*helper functions (insupervision.validators,supervision.detection.vlm,supervision.detection.core,supervision.annotators.utils,supervision.metrics.detection, andPercentageBarAnnotator.validate_custom_values) were removed as ofsupervision-0.32.0. Supervision internals use private_validate_*helpers. merge_inner_detection_object_pair,merge_inner_detections_objects, andmerge_inner_detections_objects_without_iouinsupervision.detection.corewere removed as ofsupervision-0.32.0.
0.31.0¶
sv.ByteTrackwas removed as ofsupervision-0.31.0. UseByteTrackTrackerfrom the externaltrackerspackage (pip install trackers) instead; its update method isupdate(), notupdate_with_detections().- The
supervision.keypointmodule was removed as ofsupervision-0.31.0. Import fromsupervision.key_pointsinstead. create_tilesinsupervision.utils.imagewas removed as ofsupervision-0.31.0.overlay_imageinsupervision.utils.imagewas removed as ofsupervision-0.31.0.ensure_cv2_image_for_annotation,ensure_pil_image_for_annotation, andensure_cv2_image_for_processinginsupervision.utils.conversionwere removed as ofsupervision-0.31.0.- The keypoint validation utilities
validate_keypoint_confidenceandvalidate_keypoints_fieldsinsupervision.validatorswere removed as ofsupervision-0.31.0. - The
normalized_xyxyargument ofsv.denormalize_boxeswas removed as ofsupervision-0.31.0. Usexyxyinstead. - The
supervision.dataset.utilsimport path forsv.rle_to_maskandsv.mask_to_rlewas removed as ofsupervision-0.31.0. Import fromsupervision.detection.utils.converters(or top-levelsv.rle_to_mask/sv.mask_to_rle) instead. sv.LMMwas removed as ofsupervision-0.31.0. Usesv.VLMinstead.sv.Detections.from_lmmwas removed as ofsupervision-0.31.0. Usesv.Detections.from_vlminstead.- The legacy
MeanAveragePrecisionclass insupervision.metrics.detectionwas removed as ofsupervision-0.31.0. Usesupervision.metrics.mean_average_precision.MeanAveragePrecision(sv.metrics.MeanAveragePrecision) instead, which matchespycocotools.
0.27.0¶
overlap_ratio_whparameter insv.InferenceSlicerhas been removed. Use the pixel-basedoverlap_whparameter instead.overlap_filter_strategyparameter insv.InferenceSlicerhas been removed. Useoverlap_strategyinstead.
0.26.0¶
- The
sv.DetectionDataset.imagesproperty has been removed insupervision-0.26.0. Please loop over images withfor path, image, annotation in dataset:, as that does not require loading all images into memory. Also, constructingsv.DetectionDatasetwith parameterimagesasDict[str, np.ndarray]is deprecated and has been removed insupervision-0.26.0. Please pass a list of pathsList[str]instead. - The name
sv.BoundingBoxAnnotatoris deprecated and has been removed insupervision-0.26.0. It has been renamed tosv.BoxAnnotator.
0.24.0¶
- The
frame_resolution_whparameter insv.PolygonZonehas been removed. - Supervision installation methods
"headless"and"desktop"were removed, as they are no longer needed.pip install supervision[headless]will install the base library and harmlessly warn of non-existent extras.
0.23.0¶
- The
track_buffer,track_thresh, andmatch_threshparameters inByteTrackare deprecated and were removed as ofsupervision-0.23.0. Uselost_track_buffer,track_activation_threshold, andminimum_matching_thresholdinstead. - The
triggering_positionparameter insv.PolygonZonewas removed as ofsupervision-0.23.0. Usetriggering_anchorsinstead.
0.22.0¶
sv.Detections.from_roboflowis removed as ofsupervision-0.22.0. UseDetections.from_inferenceinstead.- The method
sv.Color.white()was removed as ofsupervision-0.22.0. Use the constantsv.Color.WHITEinstead. - The method
sv.Color.black()was removed as ofsupervision-0.22.0. Use the constantsv.Color.BLACKinstead. - The method
sv.Color.red()was removed as ofsupervision-0.22.0. Use the constantsv.Color.REDinstead. - The method
sv.Color.green()was removed as ofsupervision-0.22.0. Use the constantsv.Color.GREENinstead. - The method
sv.Color.blue()was removed as ofsupervision-0.22.0. Use the constantsv.Color.BLUEinstead. - The method
sv.ColorPalette.default()was removed as ofsupervision-0.22.0. Use the constantColorPalette.DEFAULTinstead. sv.BoxAnnotatorwas removed as ofsupervision-0.22.0, howeversv.BoundingBoxAnnotatorwas immediately renamed tosv.BoxAnnotator. UseBoxAnnotatorandLabelAnnotatorinstead of the oldsv.BoxAnnotator.- The method
sv.FPSMonitor.__call__was removed as ofsupervision-0.22.0. Use the attributesv.FPSMonitor.fpsinstead.