Skip to content

Annotating a FiftyOne Dataset in Potato

Send a FiftyOne view to Potato for several annotators, then load back one merged label per sample with a Krippendorff's alpha agreement report.

Potato works as a FiftyOne annotation backend. view.annotate(..., backend="potato") writes a FiftyOne view out as a Potato project, and dataset.load_annotations() brings the merged labels back. Several annotators can label each sample. Loading the run gives each sample one merged label, writes each annotator's own labels to separate fields when you ask for them, and stores an agreement report on the dataset. The backend has shipped since Potato 2.12.0 and covers classifications, boxes, polygons, polylines, keypoints, and segmentation masks on images, plus box tracks on videos.

FiftyOne, from Voxel51, can hand a view (a subset of a dataset, such as dataset.take(200)) to an external annotation tool and read the labels back, through a backend registered by name (checked on 2026-11-29). The Potato backend is a Python class that FiftyOne loads. You work from FiftyOne's own annotate() and load_annotations() calls and never run a Potato import or export command.

Install and register the backend

The backend needs FiftyOne in the same environment as Potato. The fiftyone extra installs fiftyone>=1.0. The all extra leaves FiftyOne out because FiftyOne brings its own MongoDB and a large dependency tree:

bash
pip install "potato-annotation[fiftyone]"

FiftyOne finds a backend by name in fo.annotation_config.backends and loads the class named by the entry's config_cls (FiftyOne's annotation integration docs and fiftyone/utils/annotations.py, checked on 2026-11-29). Register Potato once per session in code:

python
import fiftyone as fo
 
fo.annotation_config.backends["potato"] = {
    "config_cls": "potato.integrations.fiftyone_backend.PotatoBackendConfig",
}

To register Potato once per machine instead, add the same entry to ~/.fiftyone/annotation_config.json:

json
{
    "backends": {
        "potato": {
            "config_cls": "potato.integrations.fiftyone_backend.PotatoBackendConfig"
        }
    }
}

Send a view to Potato

A run starts from FiftyOne. The call below sends 200 samples to Potato, asks for boxes of three classes, and asks for three annotators per sample:

python
import fiftyone as fo
 
dataset = fo.load_dataset("street-scenes")
view = dataset.take(200)
 
view.annotate(
    "round1",
    backend="potato",
    label_field="ground_truth",
    label_type="detections",
    classes=["car", "person", "bicycle"],
    project_dir="potato-round1",
    annotations_per_item=3,
)

annotate() writes a Potato project to project_dir and returns without starting a server. The project folder holds config.yaml, the data file data/samples.jsonl, a media/ folder, a README.md, and fiftyone_run.json, the manifest that load_annotations() reads later. Start Potato from the folder that contains the project, with a relative path to the config:

bash
potato start potato-round1/config.yaml -p 8000

Potato loads a config only from inside the directory where the server starts. The potato start command therefore runs from the project's parent. Passing launch_editor=True to annotate() runs the same command in the background, logs to potato-server.log inside the project, and opens http://localhost:<port>/ in a browser.

For a detections field with two attributes, the backend writes the following config:

yaml
# yaml-language-server: $schema=https://potatoannotator.readthedocs.io/en/latest/schemas/potato-config.schema.json
port: 8000
annotation_task_name: 'street-scenes: round1'
task_dir: .
output_annotation_dir: annotation_output/
data_files:
- data/samples.jsonl
item_properties:
  id_key: id
  text_key: image_url
user_config:
  allow_all_users: true
  users: []
site_dir: default
pre_annotation:
  enabled: true
  field: predictions
  allow_modification: true
max_annotations_per_item: 3
annotation_schemes:
- annotation_type: image_annotation
  name: ground_truth
  description: Ground truth
  source_field: image_url
  tools:
  - bbox
  labels:
  - name: car
  - name: person
  - name: bicycle
  attributes:
  - name: occluded
    type: bool
  - name: state
    type: select
    options:
    - parked
    - moving

The scheme takes the FiftyOne field's name, and the description is the field name in sentence case. The pre_annotation block appears only when some sample already has labels in the field. The generated config passes Potato 2.14.0's validate_cli --strict, and you can edit the config before starting the server, for example to add an adjudication block.

Options

The backend reads five options of its own, passed to annotate() beside FiftyOne's arguments:

ArgumentDefaultMeaning
project_dir./potato-<anno_key>Where the Potato project is written
annotations_per_item2How many annotators label each sample, written to the config as max_annotations_per_item. Must be at least 1
media"copy""copy" copies each image or video into the project's media/ folder. "reference" serves the files from their current folder (see who can reach the project)
annotator_fieldsFalseOn load, also writes each annotator's labels to <label_field>_<username>
port8000The port that launch_editor=True starts Potato on

FiftyOne's own arguments set the task. label_field and label_type name the field and its type, classes lists the labels, attributes adds per-object attributes, mask_targets names the classes of a segmentation field, and launch_editor starts the server. A field with no classes is refused. Pass classes=[...], or annotate a field that already has labels.

Label types

Each FiftyOne label type becomes one Potato scheme:

FiftyOne label_typePotato scheme
classificationSingle choice (radio), with the image shown above the question
classificationsMultiple choice (multiselect), with the image shown above the question
detection, detectionsimage_annotation with the box tool
polygon, polygonsimage_annotation with the polygon tool
polyline, polylinesimage_annotation with the polyline tool
keypoint, keypointsimage_annotation with the keypoint-set tool, points in skeleton order, when the field has a skeleton (dataset.skeletons[field] or dataset.default_skeleton). Without a skeleton, the landmark tool, one point per object
segmentationimage_annotation with the brush and eraser, one mask per class in the field's mask_targets
detections on a video frame field (frames.<name>)video_annotation in tracking mode

Video datasets take only frame-level detections fields. The Potato backend declares no support for sample-level video fields, and FiftyOne raises an error for a sample-level field on a video dataset before calling the backend. Scalar fields are not supported either. An unsupported label type raises an error before the backend writes anything.

Existing labels become pre-annotations

Labels already in an image field go to annotators as pre-annotations to correct. The written config turns on pre_annotation with allow_modification: true, and Potato stores a pre-annotation as an answer only once an annotator saves. A FiftyOne polyline with several shapes becomes one Potato object per shape. A keypoint that FiftyOne marks missing (NaN) becomes an unlabeled point with visibility 0, and the point comes back as NaN on load.

Existing tracks on a video frame field are not shown to annotators. Loading adds the new tracks beside the old ones rather than replacing them, and the backend logs a warning at annotate() time when the field already has labels.

Attributes

Attributes on boxes, polygons, polylines, keypoints, and video tracks become a panel beside the selected object:

python
dataset.annotate(
    "round2",
    backend="potato",
    label_field="ground_truth",
    label_type="detections",
    classes=["car", "person"],
    attributes={
        "occluded": {"type": "checkbox"},
        "state": {"type": "select", "values": ["parked", "moving"]},
    },
)

FiftyOne's attribute types map to Potato controls as follows:

FiftyOne attribute typePotato attribute
select, radioselect, a choice from values (required)
checkboxbool, a checkbox
texttext, a text box

Existing attribute values are filled in, and a default on the attribute spec carries over. On load, each label gets the attribute values back as label fields, such as detection["state"]. Masks take no attributes. In the project the backend writes, a video track's attribute has one value for the whole track, and every frame's detection carries that value on load.

Masks

A segmentation field's classes come from its mask_targets, taken from annotate(mask_targets=...), dataset.mask_targets[field], or dataset.default_mask_targets. The value 0 is background and gets no class. Existing masks are filled in one class at a time. On load, the per-class masks are combined into one Segmentation, and where two classes overlap, the class with the higher value in mask_targets wins.

Potato reads integer mask targets only. RGB targets ("#rrggbb" keys) raise an error before anything is written. Instance masks on detections are not supported. The backend sends a detection's box to Potato and leaves the instance mask out.

Video tracks

A frames.<name> detections field becomes a tracking task. Annotators draw a box on one frame, move to a later frame, and draw the box again, and Potato interpolates between the keyframes. The backend calls compute_metadata() on the view and gives Potato the most common frame rate among the videos.

On load, every frame from a track's first keyframe to its last gets a detection. Boxes between keyframes are interpolated linearly, or held for a track set to constant interpolation. Each detection carries the track's number as index, and the frames the annotator drew carry keyframe=True.

Loading labels back into FiftyOne

When the annotators have finished, load the run and read the report:

python
dataset.load_annotations("round1")
print(dataset.info["potato_agreement"]["round1"])

load_annotations() reads every annotator's saved answers from annotation_output/<user>/user_state.json in the project, merges the answers into one label per sample, and writes the merged labels to the field.

Majority merge rules by label type

The merge keeps whatever a majority of a sample's annotators agreed on:

  • Classification. The class most annotators chose. A tie for first place leaves the sample's existing label in place, if the sample has one, and counts in the report as n_ties.
  • Classifications. Every class chosen by more than half of the annotators. When annotators chose classes but no class reached a majority, the sample keeps its existing labels and counts in n_ties.
  • Boxes, polygons, and polylines. Objects are matched across annotators by overlap at a threshold of 0.5, using IoU for boxes and polygons and boundary F1 for polylines. An object that more than half of the annotators drew is kept, with its most common class. A merged box is the mean of the matched boxes, and a merged polygon is the matched shape that overlaps the others most. A merged polyline is the matched line with the highest total boundary F1 against the others.
  • Keypoints and masks. The same majority rule, with keypoint sets matched by OKS, landmarks by distance, and masks by IoU. The kept object is the matched one that agrees most with the others.
  • Attributes. Each attribute takes the most common value among the matched objects.
  • Video tracks. Tracks are matched across annotators by the overlap of their frame ranges times the IoU of their boxes. A track that more than half of the annotators drew is kept, as the matched track that agrees most with the others, with the most common class.

When objects or tracks were drawn but no object reached a majority, the sample keeps its existing labels and counts in n_ties. With one annotator per sample, the merged label is that annotator's answer. When the project uses Potato's adjudication queue, an adjudicator's decision replaces the merge for that sample.

Samples nobody answered keep their existing labels with their ids unchanged. FiftyOne deletes any existing label that a backend leaves out of the download. The Potato backend therefore returns the unanswered samples' labels unchanged. A sample whose annotators all saved an empty answer loses the old labels. When every annotator of a sample deletes a wrong pre-annotated box and saves, the box leaves the dataset.

Each annotator's labels

With annotator_fields=True, each annotator's own labels are also written to <label_field>_<username>, such as ground_truth_alice. Characters other than letters, digits, and underscores in a username become underscores. The per-annotator fields let you look at one person's work in the FiftyOne app or compare two annotators side by side. Video tracks are not copied into per-annotator fields.

The agreement report

load_annotations() stores a report for each label field in dataset.info["potato_agreement"][anno_key]. The report counts only samples with two or more annotators, and lists the annotators and the sample counts beside the scores:

  • Classification. Krippendorff's alpha (nominal) and the share of annotator pairs who agreed.
  • Classifications. Krippendorff's alpha with the MASI distance, and the share of annotator pairs who chose the same set.
  • Boxes, polygons, polylines, keypoints, and masks. The geometry agreement report, split into detection (did annotators find the same objects), classification (did matched objects get the same class), and localization (were matched objects drawn in the same place).
  • Video tracks. tracks_drawn, track_match_rate (the share of tracks matched by another annotator's track), and mean_track_similarity over the matched pairs.

When Krippendorff's alpha is undefined, the report says why in alpha_note instead of giving a bare None, as happens when every annotator gave the same answer on every shared sample. n_merged, n_ties, and n_adjudicated count what the merge did. The same report is available without writing labels:

python
results = dataset.load_annotation_results("round1")
results.agreement()

Who can reach the project

The written config lets anyone who reaches the server register an account (user_config.allow_all_users: true), and Potato's default require_password asks each annotator for a password. Before sharing the URL beyond your own team, set a roster and sign-in method as User Management describes.

Potato serves images and videos at /media/ without sign-in. With media="copy", the only files under /media/ are the copies of the view's own samples, named by sample id. With media="reference", the backend sets media_directory to the deepest folder that holds every sample, and every file under that folder becomes reachable through the study's URL. Use "reference" only when that folder holds nothing else. The backend refuses "reference" only when the shared folder is exactly the filesystem root or exactly your home directory. Any other shared folder is accepted and served without sign-in, including a folder above several users' homes (such as /Users) or a broad one such as ~/Documents. Use media="copy" unless the images already sit in one folder that holds nothing else. Samples whose filepath is an http:// or https:// URL are passed through as URLs, and the browser loads each file from the URL's own host.

Troubleshooting

Path ... is outside the project directory when starting Potato. Start Potato from the folder that contains project_dir, with a relative path to the config, as in the potato start command above.

fiftyone_run.json is missing. The folder given to the run was not written by the Potato backend, or the folder moved after annotate(). The run records the absolute path of project_dir. Move the folder back to that path before loading.

results.cleanup() leaves the folder in place. The backend never deletes the project folder, because the folder holds the annotators' saved work. Remove the folder yourself once you no longer need the annotations.

Further reading

For implementation details, see the source documentation.