v0.22.2
Added
-
Run-free ("model v2") predictions. Predictions can now be uploaded and read directly against a
Model, with noModelRunorDatasetinvolved — the concept is(model, dataset_item) -> prediction. New methods onModel:Model.upload_predictions(predictions, update=False, batch_size=5000, ...)— upserts predictions onto the model (box/polygon/cuboidonly), targetingmodel/{id}/predictions, and reusing the existingPredictionUploaderbatching machinery. Synchronous only for now:asynchronous=TrueraisesNotImplementedError.Model.predictions_loc(dataset_item_id),Model.predictions_refloc(reference_id),Model.predictions_iloc(i)— model-scoped reads returning the same shape as theirDatasetequivalents.Model.copy_predictions_from_run(model_run_id)— synchronously backfills the run-free store from an existing model run, returning a dict{model_id, model_run_ids, predictions_copied, predictions_skipped_unsupported}.
-
Model-anchored benchmark evaluations.
NucleusClient.create_benchmark_evaluation_v2()accepts amodel_id(aprj_*id or aModel) as an alternative tomodel_run_id; the model-anchored flow evaluates the model's run-free predictions and ignores model runs. Provide exactly one of the two.EvaluationV2now exposes an optionalmodel_idfield alongsidemodel_run_id. -
list_evaluations_v2accepts a model.NucleusClient.list_evaluations_v2()takes exactly one ofmodel_run_id(run_*) ormodel_id(prj_*or aModel). The model-anchored path hitsGET model/{id}/evaluationsV2and returns that model's run-free evaluations. -
Model.model_runs(). Lists the ids of every model run for a model — the model-scoped counterpart toDataset.model_runs(), which only lists a single dataset's runs. Passinclude_versions=Trueto union runs across the model's version lineage (its version root and all descendants). Results are scoped server-side to runs on datasets you can read.run_ids = model.model_runs()
Server dependency: requires the
GET /nucleus/model/:modelId/modelRunroute in scaleapi. Unit tests pass regardless; live calls 404 until that deploys.
Changed
- The existing run-based prediction paths (
Dataset.upload_predictions,ModelRun.add_predictions,create_benchmark_evaluation_v2(model_run_id=...)) are unchanged and continue to work; the model-centric methods are purely additive.
Deprecated
- Model-run-anchored Evaluation V2 is deprecated in favor of the run-free (
model_id) path.Benchmark.create_evaluation_v2()gains amodel_idargument (run-free anchor) to matchcreate_benchmark_evaluation_v2(). Passingmodel_run_idtocreate_benchmark_evaluation_v2(),Benchmark.create_evaluation_v2(), orlist_evaluations_v2()now emits aDeprecationWarning; all keep working.EvaluationV2.model_run_idis documented as deprecated (it isNoneon run-free evaluations). On the leaderboard,LeaderboardRankingEntry/LeaderboardF1CurveEntrymodel_run_idandmodel_run_nameare deprecated and nowOptional(they areNonefor run-free evaluations — previouslymodel_run_idwas a required field and would fail to parse), andcollapse="allRuns"onleaderboard_ranking()is discouraged. Prefer anchoring on and identifying evaluations bymodel_id. allowed_label_matcheson Evaluation V2.create_evaluation_v2_preset(),update_evaluation_v2_preset(),create_benchmark_evaluation_v2(), andBenchmark.create_evaluation_v2()still acceptallowed_label_matches/allowed_label_matches_idfor backwards compatibility, but they now emit aDeprecationWarning. Userollup_groupsinstead.AllowedLabelMatchand the corresponding fields onEvaluationV2/EvaluationV2Presetare likewise marked deprecated.
Removed
allowed_label_matchesremoved from the EvaluationV2 surface (breaking). The run-free (model-source) eval path — the one this SDK now steers toward — rejectsallowedLabelMatchesserver-side (400, "use rollupGroups"); it only survives as a legacy fallback on the deprecated model-run path, whererollupGroupswins anyway. Removed theAllowedLabelMatchclass (and its top-level export), theallowed_label_matches/allowed_label_matches_idarguments fromcreate_benchmark_evaluation_v2(),Benchmark.create_evaluation_v2(),create_evaluation_v2_preset(), andupdate_evaluation_v2_preset(), and theallowed_label_matches*fields fromEvaluationV2andEvaluationV2Preset. Userollup_groups(:class:RollupGroup) exclusively.dataset_iddropped from the EvaluationV2 surface (breaking). An evaluation is no longer anchored on a single dataset — a model run now carries a set of datasets and a benchmark's items may span several — so the backend no longer returns a denormalized dataset on evaluations or leaderboards. RemovedEvaluationV2.dataset_id, anddataset_id/dataset_namefromLeaderboardRankingEntryandLeaderboardF1CurveEntry, matching the current backend responses. Without this,EvaluationV2.from_jsonraisedKeyError: 'dataset_id'on every model-anchored (run-free) benchmark evaluation, since those payloads never carry adataset_id.
Fixed
Model.predictions_loc/predictions_refloc/predictions_ilocnow actually parse their responses. The run-free read endpoints return a flat{"predictions": [...]}list (each element carrying its own"type"), butformat_prediction_responseonly understood the legacy type-keyed{"annotations": {"box": [...]}}shape, so these methods returned the raw payload unparsed instead of the documented{"box": [...], "polygon": [...], "cuboid": [...]}dict.