← All extensions

Ultralytics Snippets

v0.0.2 · by Ayberk Gezer · added 3 November 2026

Ultralytics snippets for Zed IDE.

Snippets

How to install

With Forge Super installed, the button above opens the app on this extension, where you press Install. Nothing is installed until you do.

You can also open the Extensions panel in the app and search for Ultralytics Snippets. The extension's id is ultralytics-snippets.

Don't have Forge Super yet? Download it here.

README

From the extension's repository, written by its authors and not by Mentenaz. See the source.

Ultralytics Zed Snippets

Ultralytics snippets for Zed IDE.

Installation

Method 1

  1. Go to Extensions menu in Zed IDE
  2. Search for "ultralytics-zed-snippets"
  3. Click "Install"

Method 2

  1. Clone this repo:
git clone https://github.com/ayberkgezer/ultralytics-zed-snippets.git
  1. Go to Extensions menu in Zed IDE
  2. Click "Install Dev Extension"
  3. Select the folder you cloned

Usage

Start typing ultra. in a Python file to see the available snippets. Snippets are organized into categories:

  • ultra.yolo-*: YOLO model operations
  • ultra.sam-*: SAM model operations
  • ultra.util-*: Utility functions
  • ultra.result-*: Working with results
  • ultra.kwargs-*: Method arguments
  • ultra.example-*: Complete examples
  • ultra.import-*: Import statements

Import

Import snippets are for common objects that would be imported from the Ultralytics library.

AliasDescription
ultra.import-modelAdd line to import Ultralytics YOLO
ultra.import-assetsImport Ultralytics ASSETS directory constant.
ultra.import-resultsImport Ultralytics Results class (usually for type hinting).
ultra.import-annotatorImport Ultralytics auto_annotate function.
ultra.import-coco2yoloImport Ultralytics function to convert annotations from COCO to YOLO format.
ultra.import-bbox2segImport Ultralytics function to convert horizontal bounding boxes to segmentation contours.
ultra.import-seg2bboxImport Ultralytics function to convert segmentation contours into horizontal bounding boxes.
ultra.import-box-convertImport Ultralytics function for converting bounding box coordinates.
ultra.import-formatsImport Ultralytics supported file formats constant.
ultra.import-task-resultImport task-based results class (generally helpful for type hinting).

Results

These snippets will provide shortcuts for working with ultralytics.engine.results.Results objects returned from model inference. See the [Working with Results][pred results] of the documentation and the [Results class] reference page for more information.

AliasDescription
ultra.result-class-strConvert class indices to class string names for a single image result.
ultra.result-dataGet result data array of detections from a single image result.
ultra.result-loopIterate prediction results from an Ultralytics model.
ultra.result-box-xyxyGet pixel-value (x1, y1, x2, y2) bounding box coordinates from a single image result.
ultra.result-box-xywhGet pixel-value (x-center, y-center, w, h) bounding box coordinates from a single image result.
ultra.result-mask-binaryGet binary segmentation masks from a single image result. NOTE: [N, H, W] shape, with inference H, W dimensions.
ultra.result-mask-contoursGet segmentation contours with pixel value xy or normalized xyn coordinates.
ultra.result-obb-xywhrGet OBB rotated bounding boxes in pixel value [x, y, w, h, r] coordinates as torch.Tensor array.
ultra.result-orig-imageGet original image from a single image result.
ultra.result-filter-classFilter prediction results by class ID. Using classes keyword argument for prediction should be preferred.

Models

Shortcuts for initializing pretrained [Ultralytics models][models], like [YOLOv8].

AliasDescriptionReference
ultra.yolo-modelShortcut to initialize YOLO model.[YOLOv5], [YOLOv8], [YOLOv9], [YOLOv10], [YOLO-World]
ultra.yolo-exportShortcut to export YOLO model weights.[Model Export]
ultra.sam-modelShortcut to initialize SAM.[SAM]
ultra.mobileam-modelShortcut to initialize MobileSAM.[Mobile SAM]
ultra.fastam-modelShortcut to initialize FastSAM.[FastSAM]
ultra.nas-modelShortcut to initialize YOLO-NAS model.[YOLO-NAS]
ultra.rtdetr-modelShortcut to initialize RTDETR model.[RTDETR]
ultra.yolo-world-modelShortcut to initialize YOLO-world model, with class prompts.[YOLO-World]
ultra.sam2-bboxesShortcut to initialize YOLO-World model with text prompts.[SAM2]
ultra.sam2-pointsShortcut to initialize YOLO-World model with text prompts.[SAM2]

Utilities

AliasDescriptionReference
ultra.util-auto-annotateUse Ultralytics auto_annotate function to generate annotations.[auto_annotator fucntion][auto ann]
ultra.util-annotatorUse Ultralytics Annotator class to draw box annotations[Annotator class][ann]
ultra.util-make-divisibleUse Ultralytics make_divisible function to make a number divisible by another.[make_divisible function][divisible]
ultra.util-callbackShortcut for adding custom model callback for a defined function.[callbacks][callbacks]

Examples

The Example snippets are more "complete" blocks of code that can be used for boilerplate demonstrations.

PrefixDescription
ultra.example-predict-filter-classUltralytics basic YOLO object detection predict with filtered classes example.
ultra.example-result-filter-classFilter prediction results by class ID. Using "classes" keyword argument for prediction should be preferred.
ultra.example-yolo-predictSetup Ultralytics YOLO to perform predict (simple).
ultra.example-yolo-valSetup Ultralytics YOLO to perform validation (simple).
ultra.example-yolo-trainSetup Ultralytics YOLO to perform training (simple).
ultra.example-yolo-predict-kwordsSetup Ultralytics YOLO to perform inference, show all inference keyword arguments and their default values.
ultra.example-yolo-train-kwordsSetup Ultralytics YOLO for training, with all keyword arguments and their default values.
ultra.example-sam-predictSetup Ultralytics SAM to perform inference (simple).
ultra.example-sam2Example showing use of SAM2 with bounding box and point prompts.
ultra.example-mobile-sam-predictSetup Ultralytics MobileSAM to perform inference (simple).
ultra.example-fast-sam-predictSetup Ultralytics FastSAM to perform inference (simple).
ultra.example-nas-predictSetup Ultralytics NAS to perform inference (simple).
ultra.example-rtdetr-predictSetup Ultralytics RT-DETR to perform inference (simple).
ultra.example-callbackExample showing how to add a custom callback function.
ultra.example-track-loop-persistExample of how to open video, loop frames, and maintain tracked object IDs.
ultra.example-track-kwordsExample showing all keyword arguments available for track mode.

KWARGS

Use these to insert the various model methods defined in [modes] with all keyword arguments, default values, and commented descriptions quickly into your code. Includes model as default variable, but is an editable field accessible using tab stops.

PrefixDescriptionReference
ultra.kwargs-predictSnippet using model predict method, including all keyword arguments and defaults.[predict]
ultra.kwargs-trainSnippet using model train method, including all keyword arguments and defaults.[train]
ultra.kwargs-trackSnippet using model track method, including all keyword arguments and defaults.[track]
ultra.kwargs-valSnippet using model val method, including all keyword arguments and defaults.[val]

Credits and Attribution

This project is an adaptation of the VSCode plugin called ultralytics-snippets created by Burhan-Q. The original project is licensed under AGPL-3.0. All content structure, descriptions, and snippet design have been adapted for Zed IDE from the original VSCode extension. Full credit for the original concept, structure, and content goes to the original author.

Original source: Github - ultralytics-snippets