SwiftBox: YOLO Bounding Box Editor
Open an image inside VS Code, drag/resize the green box right on the lesion (or any object), add a second box for multi-object images, swipe through a folder, and save — coordinates are written straight to YOLO .txt, YOLO segmentation, or SwiftBox JSON. No GPU, no server, no upload.
Demo

Features
- View any image with its YOLO box drawn in green.
- Drag inside to move, drag a corner to resize.
- Draw bounding boxes (
W), polygons (P), or paint masks (B).
- Magic-click segmentation with SAM2/SAM3 (
M) — bring your own endpoint.
- Change class with number keys
0-9 (names read from classes.txt).
- Swipe prev/next image (
A / D) — auto-saves before moving.
- Crop (
C) and rotate (R) images in-place.
- Undo/redo (
Ctrl+Z / Ctrl+Y) with full history.
- Remappable keyboard shortcuts (
?).
SwiftBox auto-detects the annotation format from your existing project files. On first save in a new project, you'll be asked to choose:
| Format |
Files |
Supports |
| YOLO Detection |
labels/*.txt — cls cx cy w h |
Bounding boxes |
| YOLO Segmentation |
labels/*.txt — cls x1 y1 x2 y2 … |
Polygons + boxes |
| SwiftBox JSON |
labels.json |
Boxes + polygons + tags |
The choice is saved to .swiftbox/config.json and remembered for the project.
Expected layout
dataset/
classes.txt # one class name per line
images/
img001.jpg
img002.jpg
labels/
img001.txt # YOLO: "cls cx cy w h" (one line per box)
img002.txt
classes.txt is found by walking up parent folders (within the workspace), so per-class subfolders work too.
Usage
- Open the folder of images in VS Code.
- Right-click an image → Reopen Editor With… → SwiftBox Editor (or set
priority to default in package.json to open on click).
- Edit the box, press
Ctrl+S or Enter.
Shortcuts
| key |
action |
| drag inside |
move box |
| drag corner |
resize box |
W |
draw box |
P |
draw polygon |
B |
brush (paint mask → polygon) |
M |
magic select (SAM) |
V |
move / select |
Q |
delete selected |
Del / Backspace |
delete selected |
Tab |
cycle selected box |
0–9 |
set class of selected |
A / D |
previous / next image (auto-saves) |
C |
crop |
R |
rotate 90° |
E |
focus / dim |
Ctrl+S / Enter |
save |
Ctrl+Z / Ctrl+Y |
undo / redo |
? |
keyboard shortcuts overlay |
All shortcuts are remappable via the ? overlay.
License
MIT