ai-rectangle-to-mask

You need to be a Pro member to access the full content of this.

ai-rectangle-to-mask automatically generate a mask annotation from a rectangle annotation:

Usage

labelmetk ai-rectangle-to-mask [OPTIONS] FILE_OR_DIR...
  • --keep-original-bounding-box: Retain the original bounding box as the rectangle's coordinates, rather than creating a tight bounding box for the generated mask by AI. Default is false.
  • --model: Segment-anything model to use. One of:
    • efficientsam:10m
    • efficientsam:latest
    • sam2:large
    • sam2:latest (default)
    • sam2:small
    • sam2:tiny
    • sam:100m
    • sam:300m
    • sam:latest

Example: Generate mask for a JSON

labelmetk ai-rectangle-to-mask dogs_rectangle.json

Download an example JSON from:

dogs_rectangle.json (2.0MB)