Skip to content

Pre-label an image dataset from text prompts

Segment a folder of images in batches with sam3 from text prompts, export the confident labels as COCO and YOLO-seg, and put everything else in a review queue with crops. Runs can be resumed, repeated without paying twice, and every image has a cost row.

Models: sam3, sam-lite · Without a key: Smoke run · Languages: Python, Go · Try in Playground (opens in a new tab) · Source on GitHub (opens in a new tab)

A new detection or segmentation dataset needs labels, and drawing them from scratch is the expensive part. A text prompt such as dog finds most instances for a few hundredths of a credit, but the answer is a guess with a score, and a pre-labelled dataset is only useful if three things hold:

  • the confident labels can be used as they are, in the formats training code reads (COCO, YOLO-seg);
  • the uncertain ones are not lost and not silently accepted: a person looks at them, quickly, with a crop;
  • a run over thousands of images survives a dropped connection, an expired batch or a restart without paying for the same image twice.

This example is that workflow for the 60 images, 4 classes (Dog, Cat, Bird, Boat) of the dataset in datasets/. Four of the images are committed as the smoke set.

images/ + manifest.json
| sha256 of every file
v
POST /v1/images free; handle = img_<sha256>, so repeats cost nothing
|
v batches of 100, up to 2 in flight, key = round + index + sha256 of the request body
POST /v1/batch/segment 4 text prompts per image, filter.minScore 0.3, event stream
| expired / retryable items -> next round, cut stream -> same key again
v
routing by score
>= 0.6 accept ----> coco.json, yolo/labels/*.txt + data.yaml
0.3 .. 0.6 review ----> coco-review.json, review/queue.csv + review/crops/*.jpg
class expected, nothing found -> review (reason empty_but_expected)
|
v
result.json (routing, calls) costs.csv (one row per image)
  1. Scan the manifest and compute the sha256 of every file; refuse a file that does not match the manifest.
  2. With a key, upload each distinct file once. This is free, and the handle is derived from the file contents, so uploading again is harmless. On the free tier there is no upload and no handle: the image goes inline as base64.
  3. With a key, cut the images into batches of at most 100 and send each as one POST /v1/batch/segment event stream. A batch takes one rate-limit token; the images in it run one after another on the server. On the free tier there are no batch endpoints, so each image is its own request.
  4. Each image carries 4 text prompts (dog, cat, bird, boat). filter.minScore is the review threshold (0.3), so the API returns everything a reviewer might want and nothing below it.
  5. Route every instance by score, and every expected-but-empty class by the manifest’s expectedClasses.
  6. Export what other tools read, and write the cost of every image.

Two more modes use the same pipeline. --exemplar is for a class that text does not describe: draw one box around an example in an image, and the model finds more like it in that image. --boxes with --model sam-lite turns the boxes of an existing detector into masks.

Setup and run in each language

Commands for the smoke set, run from the repository root. The smoke set needs no API key: it runs on the free tier. The full set needs a key; the cap makes the client refuse calls that could exceed it.

Requires: Python 3.12, uv 0.5

cd use-cases/01-dataset-prelabelling/python
uv sync --frozen
uv run --frozen python main.py --manifest ../../../datasets/smoke/01-dataset-prelabelling/manifest.json --out out
# Full set: the full dataset is a release asset of the repository and needs an API key; unpack it and pass its manifest.
export FOLDBUN_API_KEY="fbs_..."
export FOLDBUN_MAX_CREDITS=42
uv run --frozen python main.py --manifest ../assets/full.json --out out
cd use-cases/01-dataset-prelabelling/python
uv run main.py --manifest ../../../datasets/smoke/01-dataset-prelabelling/manifest.json --out out

The smoke set needs no key and no sign-up: it runs on the free tier, one request per image with the image inline, and the run prints its list price (2.8 credits) labelled “free tier, not charged”. The free tier is shared and limited per minute and per day, so when the server answers 429 the client waits for Retry-After and carries on. The full set needs FOLDBUN_API_KEY: it is large, and it uses uploads and batches, which the free tier does not offer. Without the key the program says so and exits with code 2. With a key every call is charged at the list price; set FOLDBUN_MAX_CREDITS to make the client refuse any call that could pass your own limit. Set FOLDBUN_PROJECT_ID to count the calls against your own project (see how the recipes authenticate (opens in a new tab)).

Option Default Meaning
--concurrency N 2 batches in flight at once (requests in flight on the free tier); an account may have 1 to 4 open batches, and a 429 too_many_batches is waited out
--batch-size N 100 images per batch request (the API allows 1,000 items and 600 s per event stream)
--accept / --review 0.6 / 0.3 accept from this score; between the two goes to review; below --review is not requested
--rounds N 3 how often expired or failed items are sent again
--resume off skip images finished by an earlier run in the same --out directory
--limit N all only the first N manifest items
--masks off also request masks; COCO segmentations become RLE and keep holes
--exemplar FILE exemplar mode, see below
--boxes FILE --model sam-lite box mode, see below

Besides id and image, a manifest item may carry prompts (default: the prompts of the manifest’s classes), sha256 and expectedClasses, the image-level labels you already have (for example from folder names). An expected class with no detection becomes a review row.

Files written to --out:

File Content
result.json per image: status, routing result, ledger rows (contract/result.schema.json)
coco.json accepted labels, COCO instances format, one score per annotation
coco-review.json the review detections in the same format, for tools that import pre-annotations
yolo/labels/*.txt, yolo/data.yaml accepted labels as YOLO segmentation; link or copy the images to yolo/images/
review/queue.csv, review/crops/ one row and one JPEG crop per label to check
costs.csv list price, charged credits, cache, timing and counts per image
raw/ the answer of every finished image; --resume reads it

Exemplar mode takes a JSON file with one example per image. Images without an entry are not sent. Positive boxes are examples of the class, negative boxes are look-alikes to leave out; the boxes add no charge, and an image costs one prompt.

{ "class": "Bird", "items": { "16774edaeacc5aed": { "positive": [[162, 121, 894, 685]], "negative": [] } } }

Box mode takes a CSV of boxes x1,y1,x2,y2 in image pixels, with the class in label. Each box is one object prompt for sam-lite, at 0.01 credits per box plus the image encoding.

uv run main.py --manifest ... --out out-boxes --boxes detections.csv --model sam-lite

The full set is a release asset. Extract 01-dataset-prelabelling-full.tar.gz into assets/ (see assets/full.json) and pass assets/full.json with FOLDBUN_API_KEY set; evaluate.py then scores the run against assets/truth.json.

go/ produces the same result.json, exports and costs.csv from the same arguments, and is written the way a long-running batch job would be. The Python version keeps one file per image in raw/; the Go version differs in three ways:

  • Checkpoint file. checkpoint.jsonl in --out gets one line per finished image, written and synced as soon as the image arrives rather than at the end of the batch. --resume reads it, skips images whose request is unchanged and reports their calls as replayed. A last line cut short by a crash is ignored.
  • Context cancellation. The whole run takes a context.Context. Once it is cancelled no new batch or round starts, and waits between rounds end at once.
  • Stopping on SIGINT or SIGTERM. The batches in flight finish and are checkpointed, the exports and result.json are written with what exists, and the program exits with 0. Images that were never sent have the error code interrupted; run again with --resume to finish them. A second signal ends the program immediately.
cd use-cases/01-dataset-prelabelling/go
go run . --manifest ../../../datasets/smoke/01-dataset-prelabelling/manifest.json --out out

The standard library is the only dependency, so review crops are written for JPEG and PNG images (EXIF orientation is applied); an image in another format is segmented as usual, and its review rows have an empty crop. go test ./... covers the routing thresholds, the half-pixel polygon shift, batch key derivation and the checkpoint round trip.

The files are small and meant to be copied: main.py (arguments, wiring, result.json), batches.py (scan, upload, batches, resume), routing.py (score bands), exports.py (COCO, YOLO, review queue, costs), plus the two client files. The Go version follows the same split (main.go, batches.go, routing.go, exports.go) and adds crop.go for the review crops.

The client reads the optional key, the project ID and the base URL from the environment and never prints the key:

Source: python/main.py (opens in a new tab)

client = sc.StackClient(max_concurrency=cfg.concurrency) # FOLDBUN_API_KEY (optional), FOLDBUN_API_BASE, FOLDBUN_MAX_CREDITS
if client.free and len(items) > FREE_MAX_ITEMS:
client.require_key(f"the free tier is meant for trying a recipe on a few items, and this manifest has {len(items)}")

Every file is hashed before anything is sent. The manifest’s own sha256, when present, is checked, so a changed image fails early instead of producing labels for the wrong file:

Source: python/batches.py (opens in a new tab)

def scan(items, base):
"""Read every image once: sha256 (checked against the manifest when it has one), size and content type."""
units = []
for item in items:
path = base / item["image"]
data = path.read_bytes()
digest = hashlib.sha256(data).hexdigest()
if item.get("sha256") and item["sha256"] != digest:
raise ValueError(f"{item['id']}: sha256 of {item['image']} does not match the manifest")
units.append(Unit(item, path, digest, len(data)))
return units

With a key, uploads are free, and the handle is img_ plus the sha256 of the image. The same file uploaded twice is one handle:

Source: python/batches.py (opens in a new tab)

def upload_all(client, units, workers):
"""Upload every distinct file once (free). The handle is `img_<sha256>`, so repeated files share one upload."""
by_sha = {}
for u in units:
by_sha.setdefault(u.sha256, []).append(u)
def one(group):
first = group[0]
info = client.upload(first.path.read_bytes(), CONTENT_TYPES.get(first.path.suffix.lower(), "image/jpeg"))
for u in group:
u.handle, u.width, u.height = info["id"], info["width"], info["height"]
with ThreadPoolExecutor(workers) as pool:
list(pool.map(one, by_sha.values()))

One image becomes one batch item. The prompts are the classes; minScore is the review threshold; overlap removal stays inside a class; polygons come without holes because COCO polygons cannot carry them:

Source: python/main.py (opens in a new tab)

def build_prompts(unit, cfg, by_prompt, extra):
"""The API prompts of one image, and the class each prompt stands for."""
if cfg.mode == "exemplar":
ex = extra["items"].get(unit.id)
if not ex or not ex.get("positive"):
return [], []
boxes = [{"box": b, "positive": True} for b in ex["positive"]] + [{"box": b, "positive": False} for b in ex.get("negative", [])]
return boxes, [extra["class"]] * len(boxes)
if cfg.mode == "boxes":
rows = extra.get(unit.id, [])
return [{"box": r["box"]} for r in rows], [r["label"] for r in rows]
texts = unit.item.get("prompts") or list(by_prompt)
return [{"text": t} for t in texts], [by_prompt.get(t, t) for t in texts]
def build_body(unit, cfg):
"""The body of POST /v1/segment without `model` (one batch item). The image is an uploaded handle with a key,
inline base64 on the free tier."""
defaults = {"geometry": ["polygon", "mask"] if cfg.masks else ["polygon"], "polygon": {"tolerancePx": 1.0, "holes": False}}
options = {"defaults": defaults}
if cfg.mode != "boxes": # filters and overlap removal belong to search prompts; box prompts are one object each
defaults["filter"] = {"minScore": cfg.review} # take everything from the review threshold up: low scores are routed, not lost
options["nms"] = {"iou": 0.7, "metric": "mask", "scope": "group"} # one object found twice under the same class
if cfg.masks:
options["maskSize"] = 4096 # the grid is never larger than the image, so masks come at image size
image = {"id": unit.handle} if unit.handle else sc.image_base64(unit.path.read_bytes())
return {"image": image, "prompts": unit.prompts, "options": options}

The idempotency key of a batch is made of the round, the index and the sha256 of the request body. The same manifest and options give the same keys, so a repeat replays what finished (replayed: true, not charged). Changing an option changes the body and the key, which is what keeps a changed item from colliding with an old one (idempotency_conflict):

Source: python/batches.py (opens in a new tab)

def batch_key(round_no, index, body):
"""Idempotency key of a batch: round, index and the sha256 of the request body (which holds image sha256 handles,
prompts and options). The same manifest and options give the same keys, so a repeated run replays finished items."""
digest = hashlib.sha256(canonical(body).encode()).hexdigest()
return f"prelabel-r{round_no}-{index:04d}-{digest[:32]}"

The batch loop reads the event stream. A stream that ends without its summary was cut, so the same body is sent again under the same key (up to three sends). An item that still has no outcome after that may already be charged, so it is never sent under a new key: it ends as the error outcome_unknown. Each ok item gets the ledger row the client has just written; items that came back expired or error are recorded as such:

Source: python/batches.py (opens in a new tab)

for attempt in range(1, STREAM_ATTEMPTS + 1):
summary = None
try:
for event, data in client.batch("segment", body, key, tag=tag):
if event == "progress":
log(f" batch {tag}: {data['done']} done, {data['remaining']} remaining")
elif event == "summary":
summary = data
elif event == "item":
unit = units[data["index"]]
cur = out[unit.id]
if data["status"] == "ok":
row = client.calls(tag)[-1] # the client records the item's ledger row just before it yields the event
cur["calls"].append(row)
if cur["result"] is None: # a replay after a cut stream repeats items we already hold
cur.update(status="ok", result=data["result"], error=None)
on_ok(unit, cur) # checkpoint the item now, not at the end of the batch
elif cur["result"] is None:
if (data.get("error") or {}).get("code") == "insufficient_balance":
raise sc.StackError(402, "insufficient_balance", data["error"]["message"])
err = data.get("error") or {"code": "expired", "message": "the batch time limit passed before this item finished"}
cur.update(status=data["status"], error=local_error(err["code"], err["message"]))
except sc.StackError as err:
if err.code in FATAL_CODES or not (err.retryable or err.code == "batch_timeout"):
raise
log(f" batch {tag}: {err.code}, attempt {attempt} of {STREAM_ATTEMPTS}")
if summary is not None:
break
if attempt < STREAM_ATTEMPTS:
time.sleep(min(2**attempt, 10))
# An item that still has no outcome may already be run and charged, so it is not sent under a new key in a later
# round: it ends as an error that says so, and running the same command again replays it from the same key.
for unit in units:
cur = out[unit.id]
if cur["status"] == "no_result":
message = "the stream ended before this item's outcome arrived, and every repeat under the same key failed too"
cur.update(status="error", error=local_error("outcome_unknown", message + "; it was not sent under a new key because it may already be charged"))

Rounds: images that expired or failed with a retryable code (the server did not charge them) go into new batches (new body, new key); an image whose outcome never arrived does not, see above. Non-retryable errors, such as invalid_image, stay as errors and are listed in result.json:

Source: python/batches.py (opens in a new tab)

def run_all(client, units, cfg, raw_dir):
"""Run every unit to an outcome: checkpoint (with --resume), then batches, then new rounds for what expired or failed."""
raw_dir.mkdir(parents=True, exist_ok=True)
outcomes = {}
if cfg.resume:
for u in units:
done = load_checkpoint(raw_dir, u)
if done:
outcomes[u.id] = done
log(f"resume: {len(outcomes)} of {len(units)} items are already finished")
pending = [u for u in units if u.id not in outcomes]
for round_no in range(1, cfg.rounds + 1):
if not pending:
break
outcomes.update(run_round(client, cfg, pending, round_no, raw_dir))
pending = [u for u in pending if retryable(outcomes[u.id])] # expired or failed with a retryable code: next round
if pending and round_no < cfg.rounds:
time.sleep(min(cfg.retry_wait * round_no, 30))
return outcomes

Routing is a few lines. The thresholds are options because the right ones depend on the classes:

Source: python/routing.py (opens in a new tab)

def route(score, cfg):
"""The band of a score: "accept", "review", or None when it is below the review threshold."""
if score >= cfg.accept:
return "accept"
if score >= cfg.review or cfg.mode == "boxes": # a box the user supplied is never dropped, only checked
return "review"
return None
def detections(unit, result, cfg):
"""Detections of one item (sorted by score), and the expected classes for which nothing was found."""
found = []
for inst in result["instances"]:
band = route(inst["score"], cfg)
if band is None:
continue
idx = inst.get("prompt", 0)
rings = [part["outer"] for part in inst.get("polygon", [])]
found.append(Detection(unit.labels[idx], inst["score"], inst["bbox"], inst["area"], band, rings, inst.get("mask") if cfg.masks else None, idx))
found.sort(key=lambda d: (-d.score, d.bbox))
seen = {d.cls for d in found}
missing = [c for c in unit.item.get("expectedClasses", []) if c not in seen]
return found, missing

The polygon vertices of the API are pixel centres, so every exported vertex gets +0.5 to land on the pixel grid that COCO and YOLO use. Boxes are already pixel edges. COCO bbox is [x, y, width, height]:

Source: python/exports.py (opens in a new tab)

def coco_annotation(ann_id, image_id, cat_id, det, width, height):
x1, y1, x2, y2 = det.bbox
if det.mask: # --masks: a COCO RLE at the size of the image (the mask grid can be smaller)
rle = det.mask if det.mask["size"] == [height, width] else coco_rle.resize(det.mask, height, width)
segmentation, area = {"size": rle["size"], "counts": rle["counts"]}, coco_rle.area(rle)
else:
segmentation, area = [grid_ring(r) for r in det.polygon], det.area
return {
"id": ann_id,
"image_id": image_id,
"category_id": cat_id,
"bbox": [x1, y1, x2 - x1, y2 - y1], # [x, y, width, height]
"area": area,
"segmentation": segmentation,
"iscrowd": 0,
"score": round(det.score, 4),
}
def write_coco(path, records, classes, band, description):
"""COCO instances file of the detections routed to `band`. Every image is listed, also those without annotations."""
cats = {name: i + 1 for i, name in enumerate(classes)}
doc = {
"info": {"description": description, "version": "1.0", "date_created": datetime.now(UTC).strftime("%Y-%m-%dT%H:%M:%SZ")},
"licenses": [],
"images": [],
"categories": [{"id": i, "name": name} for name, i in cats.items()],
"annotations": [],
}
for n, rec in enumerate(records, 1):
doc["images"].append({"id": n, "file_name": rec["file"], "width": rec["width"], "height": rec["height"]})
for det in rec["detections"]:
if det.route == band and (det.polygon or det.mask):
doc["annotations"].append(coco_annotation(len(doc["annotations"]) + 1, n, cats[det.cls], det, rec["width"], rec["height"]))
path.write_text(json.dumps(doc, indent=1) + "\n")

YOLO-seg writes one normalised polygon per line, one line per part. An image without labels gets an empty file, which YOLO reads as a background image:

Source: python/exports.py (opens in a new tab)

def write_yolo(root, records, classes):
"""YOLO segmentation labels of the accepted detections: `labels/<image>.txt`, one line per polygon part:
`class x1 y1 x2 y2 ...` normalised to 0..1, and `data.yaml`. An image without detections gets an empty file."""
labels = root / "labels"
labels.mkdir(parents=True, exist_ok=True)
for rec in records:
lines = []
for det in rec["detections"]:
if det.route != "accept":
continue
for ring in det.polygon:
pts = grid_ring(ring)
norm = [min(1.0, max(0.0, v / (rec["width"] if i % 2 == 0 else rec["height"]))) for i, v in enumerate(pts)]
lines.append(f"{classes.index(det.cls)} " + " ".join(f"{v:.6f}" for v in norm))
(labels / (Path(rec["file"]).stem + ".txt")).write_text("\n".join(lines) + ("\n" if lines else ""))
names = "\n".join(f" {i}: {json.dumps(name)}" for i, name in enumerate(classes))
(root / "data.yaml").write_text(
f"# Put or link the images in yolo/images; labels/ holds the matching .txt files.\npath: .\ntrain: images\nval: images\nnames:\n{names}\n"
)

The review queue is a CSV that a spreadsheet or an annotation tool can load, with a crop per row, and rows for images where an expected class found nothing:

Source: python/exports.py (opens in a new tab)

def write_review(root, records):
"""`queue.csv` plus one crop per row. Rows: detections between the review and accept thresholds (`low_score`), and
expected classes with no detection (`empty_but_expected`, the crop is the whole image). Returns the number of rows."""
(root / "crops").mkdir(parents=True, exist_ok=True)
rows = []
for rec in records:
n = 0
for det in rec["detections"]:
if det.route == "review":
n += 1
rows.append((rec, f"{rec['id']}-{n:02d}", det.cls, "low_score", round(det.score, 4), det.bbox))
for cls in rec["missing"]:
n += 1
rows.append((rec, f"{rec['id']}-{n:02d}", cls, "empty_but_expected", "", None))
with (root / "queue.csv").open("w", newline="") as fh:
out = csv.writer(fh)
out.writerow(QUEUE_FIELDS)
for rec, qid, cls, reason, score, box in rows:
save_crop(rec["path"], box, root / "crops" / f"{qid}.jpg")
out.writerow([qid, rec["id"], rec["file"], cls, reason, score, *(box or ["", "", "", ""]), f"crops/{qid}.jpg"])
return len(rows)

costs.csv is built from the ledger rows of each image, so it also shows replays and cache hits:

Source: python/exports.py (opens in a new tab)

def write_costs(path, items):
"""One row per image: what the call cost at list price and what was charged (0 when replayed), timing and counts."""
with path.open("w", newline="") as fh:
out = csv.writer(fh)
out.writerow(COST_FIELDS)
for it in items:
calls = it["calls"]
out_ = it["output"] or {}
counts = out_.get("counts", {})
out.writerow(
[
it["id"],
it["status"],
round(sum(c["list"] for c in calls if not c["replayed"]), 6),
round(sum(c["charged"] for c in calls), 6),
any(c["replayed"] for c in calls),
",".join(sorted({c["cache"] for c in calls if c["cache"]})),
sum(c["queueMs"] for c in calls),
sum(c["processingMs"] for c in calls),
len(out_.get("instances", [])),
counts.get("accept", 0),
counts.get("review", 0),
]
)

tests/test_prelabelling.py runs the program against the fake API and checks the files against their formats: COCO ids, categories, boxes inside the image, polygon rings of at least 3 vertices at half-pixel positions inside the box; with --masks, RLE segmentations that decode (clients/python/coco_rle.py, tested against pycocotools vectors) to the annotation’s area and box; YOLO lines with an integer class, an even number of coordinates in 0 to 1 and a data.yaml whose names match. The tests also cover resume, expired items, a cut stream and both extra modes. The COCO files were not loaded into pycocotools or an annotation tool in this repository.

The numbers below are measured on the 60-image set with sam3; the block stays empty until a maintainer records a run. They vary a little between runs, because a cached image encoding can change a result slightly.

How the numbers are made (evaluate.py):

  • Precision and recall per class at IoU 0.5, the Open Images way: a class counts only on images where it is verified present or verified absent. On images where the class is not verified, a detection is neither right nor wrong. precision@0.5 and recall@0.5 use accepted labels only; *_with_review also include the review band.
  • review_share is the share of the review queue among all detections plus empty-but-expected rows. review_true_positive_share says how many review detections turned out to be right, which tells whether reviewing is worth the effort.
  • cost_per_1000_images is the planning price per 1,000 images: the list price of the calls with the image encoding fee counted on every call. A call that finds the encoding of its image still cached is priced without that fee, and a cache hit is not promised, so plan with this number; cost_per_1000_images_this_run is what the recorded run was actually priced at, and encoding_cache_hit_share the share of its calls that hit the cache. Throughput is not published: it depends on the network path between the client and the API (evaluate.py --timing prints it for a run of your own).
Metric Value
precision@0.5.Bird 0.8846
recall@0.5.Bird 0.7667
precision_with_review@0.5.Bird 0.8621
recall_with_review@0.5.Bird 0.8333
precision@0.5.Boat 0.6579
recall@0.5.Boat 0.8929
precision_with_review@0.5.Boat 0.4464
recall_with_review@0.5.Boat 0.8929
precision@0.5.Cat 0.96
recall@0.5.Cat 1
precision_with_review@0.5.Cat 0.8276
recall_with_review@0.5.Cat 1
precision@0.5.Dog 0.8889
recall@0.5.Dog 0.9231
precision_with_review@0.5.Dog 0.8276
recall_with_review@0.5.Dog 0.9231
precision@0.5.macro 0.8478
recall@0.5.macro 0.8957
precision_with_review@0.5.macro 0.7409
recall_with_review@0.5.macro 0.9123
review_share 0.1973
review_images_share 0.25
review_true_positive_share 0.0741
review_detections_evaluated 27
images 60
images_ok 60
cost_per_1000_images 700
cost_per_1000_images_this_run 225
encoding_cache_hit_share 0.95

An image with 4 text prompts costs one image encoding (0.5) and 4 prompts (4 x 0.05): 0.70 credits at list price, so about 700 credits per 1,000 images. The encoding fee is waived when the same image was encoded shortly before, for example when a run is repeated with other prompts; do not plan on it. In exemplar mode an image costs 0.55 (one prompt, however many boxes). In box mode with sam-lite it costs 0.2 plus 0.01 per box. Replayed items are not charged. Uploads are free. These are the list prices a keyed run is charged; a smoke run on the free tier costs nothing.

Run Calls List price (credits) Charged (credits)
smoke 4 2.8 2.8
full 60 13.5 13.5
  • Text prompts work for common categories. Rare, fine-grained or specialist classes (medical, industrial defects) have lower recall: measure on a small sample before labelling thousands of images, and consider --exemplar.
  • A box or mask is a proposal. The review queue exists because scores are not probabilities; it does not replace a final human check of the exported set.
  • Very small objects (below about 1/50 of the short image side) are often missed, and crowds that overlap heavily can be merged into one instance.
  • COCO polygons have no holes, so objects with holes are filled in coco.json and in YOLO files. Use --masks for RLE segmentations that keep them. The YOLO export always uses polygons.
  • In box mode the score is the model’s predicted mask IoU, not a detector confidence, and no box is dropped: anything below --accept goes to review.
  • An exemplar box applies to the image it is drawn on. It finds more instances in that image; it does not teach the model a class for the rest of the dataset.
  • Images in a batch run one after another: a batch of 100 images is minutes, not seconds, and at most 600 s fit in one event stream. Items that do not fit expire and are sent again in the next round.
  • Idempotency keys are kept for 24 hours. --resume uses the local raw/ copy, so it works later, but an item that finished on the server and was never received before a crash can be charged again.
  • Review rows and crops are for people. Cropping uses Pillow, the only dependency.
  • See Segmentation with text prompts (opens in a new tab) and Post-processing (opens in a new tab) in the documentation.

The 60 images are a sample of the Open Images Dataset V7 validation set. Annotations are CC BY 4.0 (Google LLC) and the images are CC BY 2.0 by their authors; the committed smoke images and their attribution are in datasets/smoke/01-dataset-prelabelling/, the rest in datasets/attribution/ATTRIBUTION-01-dataset-prelabelling.csv. The offline fixtures in fixtures/ are synthetic: they were drawn by fixtures/synthesize.py from the ground-truth boxes and are not model output. Rights holders can request removal of an image or dataset through the contact page (opens in a new tab).