Change Log
All notable changes to this project will be documented in this file.
A `name()` here means a name of THIS package, and tests/test_changelog_prose_names.py asserts that every one in the newest entry resolves - including methods and Class.method forms. An rplatypus function, or any name this package does not answer to, is written in backticks without the parentheses: that is the notation for a name being cited rather than offered, and it is what lets an entry name a function that lives elsewhere, or one that has been deleted, without telling a reader to go and call it. pyplatypus#440 says why the symmetric rule - resolving R’s names too, the way R’s own NEWS.md test resolves this package’s - is not available here: R runs the engine and can ask it; the engine cannot run R.
The scope is the newest entry alone, for the reason R’s half records: over the whole file a changelog legitimately names functions that no longer exist, and that is often why they are mentioned.
[0.8.0a86] - 2026-11-11
Changed
This package now claims and tests Python 3.14 and 3.15.
pyplatypus#471. It ran on a Python it neither claimed nor tested:0.8.0a84was installed and run end to end on 3.14.7 on a borrowed M3 Pro, which is the report#468came out of, while the classifiers stopped at 3.13 and the matrix tested 3.11 to 3.13. 3.14 was released 2025-10-07 and 3.15 on 2026-10-09, so the claim was two minors behind - the exact inverse of0.8.0a83, where the metadata claimed a platform that cannot work at all.Measured before anything was edited, because the question is whether the cells can exist:
torch cp314 wheels from 2.9.0 up, macosx_*_arm64 + manylinux_2_28 x86_64/aarch64 + win_amd64 torch cp315 wheels 2.15.0 ONLY, the same four platforms the whole tree py3.14 resolves on all three platforms this suite runs py3.15 resolves on Linux and Windows at torch 2.15.0On 3.15 the effective torch floor is 2.15.0, because nothing below it ships
cp315, andtorch>=2.7needs no edit for that to be true. Thefloors (lowest-direct)job keeps resolving 2.7.1 on its own Python.macOS and 3.15 needs a sentence, because the obvious reading of the probe is wrong:
uv pip compile --python-platform aarch64-apple-darwinrefuses, and that is the probe’s deployment target rather than the machine - the same probe refuses torch 2.15.0 on 3.14, where the M3 ran it, because arm64 wheels aremacosx_14_0from 2.12 on. The wheel exists and was read off PyPI by name.The floor does not move.
requires-pythonstays>=3.11: nothing needs 3.14, and raising it would cut off three supported minors for nothing. Python 3.10 is out of support and stays out -#470’s guard asserts that the lowest version claimed or tested equals the declared floor, so a 3.10 cell or classifier cannot come back without that line moving in the same breath.Two contexts were added and two renamed, in the same breath as the matrix, because a job’s name is what branch protection matches:
test (ubuntu-latest, 3.14)andtest (ubuntu-latest, 3.15)are new, and the off-Linux ends went from 3.13 to 3.15. Dropping the 3.10 cells cost exactly this lesson, and the comment beside the matrix now records both payments.
The R half
None beyond nothing: rplatypus forwards no metadata, so there is nothing for it to follow here and the pin stays where it is.
[0.8.0a85] - 2026-11-10
Fixed
device_report()called an Apple Silicon build CPU-only while the work ran on its GPU.pyplatypus#468, and the first finding this project has from an Apple GPU rather than from a reading:cuda_buildansweredtorch.version.cuda or "cpu-only build", and on a macOS wheelversion.cudais always falsy while that same wheel carries a workingmpsbackend. Measured on a borrowed M3 Pro, macOS 26.7.2, torch 2.15.0, wherepick_device()chosemps, the report saidcuda_build: cpu-only buildbesidebackend: mps, and a fit on both devices agreed to0.000000on all four measured figures. From R, which forwards this throughplatypus_device, it is three consecutive printed lines with the first denying the two under it.The value answers about CUDA and about nothing else now:
nonewhere there is no CUDA build. Everything the old string was reaching for is already carried by three sibling keys -backendisNone,deviceiscpu, andgpu_present_but_unusableis the one worth acting on. Making the fallback depend on the backend was rejected as a second copy of a decisionbackendalready makes, whose next wrong answer would be anxpumachine.Why nothing caught it.
tests/test_device.pyhas faked an Apple machine since0.8.0a38, andtest_an_apple_silicon_machine_uses_its_acceleratorcalleddevice_report()twice under it while asserting onlybackendanddevice. The fixture held the contradictory dictionary the whole time, which is sharper than this project’s usual fixture that never contained the case. The configuration pair over the device answer agrees because both halves are right about CUDA: the contradiction is between two values of one returned object, which that pair cannot see by construction.Four mutations, four caught, identity first - the old string, a backend-dependent fallback, a value that stops reading
version.cuda, andstr(torch.version.cuda), which yields the string"None"and is the one a reader would not predict.The R half is the pin, and the first draft of this entry had that wrong. It said a test fixture and nothing else;
platypus_deviceprints what the pinned engine returns, so an R user on an Apple machine goes on readingcuda build : cpu-only builduntil the pin moves - the fix reaches them by that and by nothing else, which is0.8.0a47’s shape rather than §3E’s default.rplatypusalso pinnedcuda_build = "cpu-only build"besidebackend = "mps"as its own Apple Silicon fixture, so the impossible pair was written down in both packages. The pin is four releases behind on purpose, so one move carries0.8.0a81through0.8.0a85.
Changed
- The README no longer mentions the 2022 releases. The author’s call, and the argument is that nobody used them on the Python side: the banner told a reader that
pip install pyplatypus==0.1.0rc2gets the old TensorFlow package, and## Installingspent two paragraphs on a route that no longer exists.0.8.0a84yanked both, so an unpinned install on a Python below 3.11 refuses on its own, and the README now says that in one sentence. A release’s history belongs in this file and in the journal rather than on the page somebody reads to get started.## Aboutkeeps the 2020 Keras package, which is what explains the version numbers restarting rather than continuing.
[0.8.0a84] - 2026-11-09
Changed
0.8.0a83decided prose only on an existence claim, and the claim was false.pyplatypus#466, the reviewer’s seventeenth pass. That release argued that no mechanism visible to a resolver can express this package cannot be installed here, so the README is the whole of the answer. PEP 592 yanking is such a mechanism, it has none of the hazards the marker and the refuse-by-name forms were rejected for, and this project had already used it once -0.3.0a14has been yanked since long before any of this.What the claim was hiding, measured before anything changed. On a Python below 3.11 an unpinned
pyplatypusfound only the two 2022 releases - the TensorFlow package this one replaced - and installed them with exit 0, from wheels, saying nothing:x86_64 macOS py3.9, py3.10 pyplatypus 0.1.0rc2 + tensorflow 2.9.1 x86_64 Linux py3.9 the same x86_64 Windows py3.9 the same0.1.0rc1and0.1.0rc2arepy2.py3-none-anywheels withrequires_python >= 3.6, and rc2 declarestensorflow (==2.9.1). The failure is silent at install and loud at first use, because no name this README teaches exists in that package.Both 2022 releases are yanked, reason “Old version”, and the four rows now refuse. Each refusal names it - “pyplatypus<=0.1.0rc2 was yanked (reason: Old version)” - over three rounds on a fresh cache, with the platforms that work as the controls: Linux at 3.10 still resolves
0.8.0a43, and 3.11, 3.13, arm64 macOS and Windows still resolve the newest. An exact pin still takes a yanked file, sopip install pyplatypus==0.1.0rc2works and warns, which is the route this README’s own banner offers.The reading flapped before it settled, and that is worth more than the fix. For several minutes the two canonical index representations disagreed in opposite directions - HTML marking the files yanked while the PEP 691 JSON did not, then the reverse - and the behavioural answer alternated 6:4 between refuses, naming the yank and installs the 2022 package. The
pypi.org/pypi/<name>/jsonrepresentation still saidyanked=Falseafter both canonical ones agreed, which is the lag §3B.9 already records. So a yank needs the same twice, at the canonical URL discipline a release does, and the intermediate state is worse than a release’s: not the version is missing but the user gets something else, depending on which edge answers.What was true and was doing the false sentence’s work: no metadata in a new release changes what a resolver does with an old one. It does not - and metadata on the old release does. The README and the manifest comment say that now, and
0.8.0a83’s entry is left as the record it is.And the pad guard’s docstring told a history that did not happen, corrected here because the commit that shipped it cannot be.
0.8.0a82unheld nothing: the sixteenth pass’s “lower end” mutation edited both ends in one pass, and the upper end’s own test -test_float_rounding_at_one_is_not_a_different_scale, there since0.8.0a81- is what caught it. Measured on three trees: the lower end alone survives at a81 and at a82, and#463’s test is the first it has ever had. What a82 added was a real hold on the upper end at the coarse scale.The R half: none beyond nothing. Prose, a comment and a test docstring;
rplatypusforwards none of it, so the pin stays at0.8.0a80- §3E, said here rather than only in a commit message.
[0.8.0a83] - 2026-11-09
Changed
An Intel Mac cannot install this package at all, and nothing here said so.
pyplatypus#459, the sixteenth review pass’s open issue, and the only finding in it that came back from a real machine rather than from a reading. torch has published no macOSx86_64wheel since 2.2.2, uploaded 2024-03-27, and the floor here is 2.7 - so on that platform no torch satisfies the one requirement that decides whether a run is possible at all. Read off PyPI and resolved withuv pip compile --python-platform x86_64-apple-darwinon 2026-11-09, with the three platforms that do work through the same probe as the controls: arm64 macOS at torch 2.11.0, Linux and Windows at 2.15.0.The platform marker the issue asked for was measured and refused, and that is the half worth keeping. A marker can only switch a requirement OFF, so the issue’s own proposal -
torch>=2.7 ; platform_system != "Darwin" or platform_machine == "arm64"- resolves to zero requirements on Intel macOS:Resolved in 1ms, exit 0, no torch, and a package that installs and then fails at import. That is the present loud failure traded for a silent one. Refusing by name would mean depending on a package that does not exist, and both candidate names answered 404 on PyPI today, so it is a dependency on whoever registers one next - fetched and built on exactly the platform being refused.And no metadata in a new release changes what a resolver does with an old one, which is the mechanism behind the report’s 1571 lines of clang: unpinned, a resolver walks backwards through the 115 published versions looking for one whose requirements can be met, and 76 of them accept Python 3.10, including the 2022 TensorFlow package. Pinned, the message is already true and already names the cause - “torch>=2.7.0 has no wheels with a matching platform tag (e.g.
macosx_13_0_x86_64)”, with the platforms that have one listed beside it. So the README is the whole of the answer, which isCLAUDE.md§8’s shape for the ~5 GB CUDA wheel and the Pascal cap: a fact the package cannot express and has to state. It is stated with the date it was true on.The floor stays at 2.7, which is the issue’s third question answered with numbers rather than with a preference. A floor is what a USER resolves, so
torch>=2.2asked forlowest-directhands torch 2.2.0 to every platform - a version nothing here has ever run, and one carrying theweights_onlyunpickler flaw (CVE-2026-24747) that the manifest would rather close than open. It also buys less than it looks: torch 2.2.2’s macOSx86_64wheels are cp38 to cp312, so againstrequires-python = ">=3.11"it would admit Python 3.11 and 3.12 and still refuse 3.13 - measured on all three.Operating System :: OS Independentis gone from the classifiers, replaced by the three operating systems CI actually runs. That label is true of the wheel -py3-none-any, which is what it is usually chosen for - and false about whether the thing installs, in front of exactly the reader this issue is about. The classifier list has no architecture axis, checked against PyPI’s own page with a name that is not on it as the control, soMacOSis as precise as a classifier can be and the qualification has to live in prose.Three claims, three readers, in
tests/test_platform_claims.py: the two floors the README quotes against the manifest that declares them, the macOS sentence’s three parts - which macOS works, which does not, and the torch version the claim is pinned to - and the operating-system classifiers against the matrixci.ymlruns, equal in both directions. Eleven mutations, eleven caught, identity first. Its own first run failed on prose that was correct, because the version pattern was greedy over the sentence’s full stop and readtorch >= 2.7.as a floor of2.7.: when a new check fails, suspect the instrument.The README’s Pascal paragraph was carrying a sentence this manifest has recorded as false since
0.8.0a64, found while editing the section above it. It said torch 2.8 and later ship CUDA 13 builds which dropped Pascal outright and that “the last torch built against CUDA 12 is 2.7.x”. What is true is the narrower claim the manifest already makes: 2.7.x is the last torch whose default PyPI wheel is a CUDA 12 build. On PyTorch’s own cu126 index builds exist up to 2.14.1, and one of them runs a GTX 1070 with the card named and availability true. The distinction is the whole reason the extra exists - neitherpipnor reticulate’spy_requiretakes an index - and the paragraph now also says thattorch==2.14.1from that index is patched against CVE-2026-24747, which 2.7.x is not.The R half: none beyond nothing. This release is prose and metadata;
rplatypusforwards neither, so the pin stays at0.8.0a80- §3E, said here rather than only in a commit message. What R does owe is a sentence of its own, because an R user meets this wall through reticulate’spy_requirewith a different message again, and that is R’s prose rather than this pin.
[0.8.0a82] - 2026-11-09
Fixed
Three sentences of
0.8.0a81’s pad refusal described the array wrongly, and every one of the three refused correctly.pyplatypus#456, the reviewer’s sixteenth pass. A refusal is where the next reader learns what a healthy run looks like, which is why an explanation that is false costs more than it looks.A signed integer’s scale was given as unsigned, and this is the one worth keeping. An
int16image was toldwhose scale is 0 to 32767, wherenumpy’s owniinfosays -32768 to 32767 - and the message’s own justification is the midpoint of a CT’s stored range is bone. A CT in Hounsfield units is exactly an array with negative values, so the sentence named a range that excludes every value the case it argues from holds. It names the dtype’s own bounds now, with the array’s own range beside them, because the two answer different questions:int16 holding -1000 to 400 was "int16, whose scale is 0 to 32767" now "int16, whose scale is -32768 to 32767 - it holds values -1000 to 400"And no midpoint is offered on that route, which is the decision rather than the fix: for values in physical units the windowing decides what grey is, so 127.5 would be the 8-bit sentence travelling to a case it is false for. It says window it and scale the result to 0-1, or pass
fillyourself in the image’s own units instead, and a test asserts 127.5 is absent.A
NaNate both ends.min()andmax()of an array holding one are themselves not a number, both range comparisons are false, and the reader was told the image held values nan to nan when its other values were 0.2 - with divide by 255 as the advice, which is no advice for aNaN. It is its own refusal now, naming the finite values, saying why there is no range to read a scale off, and coveringinfas the same complaint, which the finding did not name. An array with no finite value at all says that rather than naming an empty range.:.4grounded the reason away. An image reaching 1.000002 was refused and described as holding values 0 to 1 - a range this function ACCEPTS, so the reader was told the array is on the scale the refusal says it is not.:.9gshows the overshoot, and it also stops anint16-scale float reading as3.277e+04.Why nothing caught any of it: every fixture around this code was
uint8or a 0-1 float, so no test could reach a signed dtype, a non-finite value or the boundary at 1. §4’s fixture that never contained the case, three times in one function. Five tests now, each with its own control - the unsigned message unchanged, theinfcase, the all-NaNcase, and the boundary one order of magnitude smaller still accepted - and five mutations, five caught, identity first.The R half: none beyond nothing.
rplatypusdoes not exposefillat all and reaches this code on a route where the image has already been throughto_float, so there is no way to get a refusal from R and the pin stays at0.8.0a80- §3E, said here rather than only in a commit message.
[0.8.0a81] - 2026-11-09
The pad value is grey on a 0-1 scale and on no other, and silence now says so. pyplatypus#453 closes here - the reviewer’s fifteenth pass, F4. crop_boxes(..., fill=0.5) padded in the image’s own units whatever those were, so an 8-bit photograph letterboxed with the default came back with black bars, under the module docstring whose own argument is that “black is a legitimate pixel value in a radiograph”.
Measured on a 40x20 uint8 image of constant 200, one box:
size=None uint8 200.0000 .. 200.0
size=(16,16) fit=letterbox float32 0.5000 .. 200.0 <- 0.5 on a 0-255 scale
size=(16,16) fit=stretch float32 200.0000 .. 200.0 <- no padding, no issue
control, the same image / 255 float32 0.5000 .. 0.7843 <- 0.5 on a 0-1 scale
There is no default that is right for every range, which is the whole of the decision. For 8-bit grey is 127.5; for a 0-1 float it is 0.5; and for a CT in Hounsfield units the midpoint of the stored range is bone. So use the midpoint of the input’s range - the obvious repair, and the shape #396 took when it scaled a palette colour by what the table holds - is right for two of those three and wrong for the one this module’s sentence is about. Silence is refused instead, naming the scale it found and the value to pass; fill given explicitly still means exactly what it says in the image’s own units, so nothing changes for any caller who passes one. What changes is what silence means.
An array’s scale is its dtype’s range for an integer and its own values for a float, which is one sentence and the truth of the matter: 0.5 is not the middle of 0-255, whatever one picture happens to hold. bool is answered before that rule rather than by it, because True and False really are a 0-1 scale with 0.5 between them - and np.iinfo raises on it, so the order is load-bearing.
The float bound is calibrated at both ends, which is what CLAUDE.md §4 asks of a tolerance: float32’s eps at 1.0 is 1.19e-07, so an image that is 0-1 up to its own arithmetic can hold 1.0000001 and must not be refused; the tolerance is 1e-6, eight times that figure and six orders of magnitude below the smallest wrong scale a test pins here, 0-2. A bound below the rounding condemns correct content and a bound above the defect passes broken content, and both directions are tests.
The value is resolved once per call, from the whole image, rather than per crop. A crop taken from a dark corner of a 0-255 float picture is within 0-1 by accident, so deciding inside the loop would refuse some boxes of one call and accept others - an error that depends on which box you asked about. fit="stretch" and a call with no size pad nothing and are untouched, because fill is documented as the padding value for a letterbox.
What it did NOT cost, checked rather than assumed. DetectionEngine.crops reads through source_image, which is to_float(read_image(...)), and DetectionDataset.read the same - measured on three BCCD photographs and on pydicom’s CT_small.dcm at three windows, every one of them 0-1. So the default was right for this package’s own route and for R’s, and the defect was the direct Python caller the first paragraph of crop_boxes describes. The two internal call sites are left silent rather than passing 0.5, so the refusal covers them too if that ever stops being true; the two reductions it costs are 0.220 ms against 6.040 ms for the resize they sit beside.
Why nothing caught it is the part worth keeping. Every image fixture in tests/detection/test_crops.py was np.arange(...) / (20 * 30) - float32 already on a 0-1 scale - and a grep for uint8 over that file returned 0. All fourteen of its tests were written in the units the default assumes. CLAUDE.md §4’s fixture that never contained the case, for the seventh recorded time; the fixtures added here are the case.
And one of this package’s own guards found the refusal’s first draft out, which is the cheapest possible argument for having it. The message said to_float(read_image(...)) is what this package’s own route does, and test_every_function_an_error_message_names_is_reachable failed: to_float is importable from pyplatypus.data and not from pyplatypus, so a refusal naming it sends a reader hunting for a module path it does not give. It says dividing an 8-bit picture by 255 now. §4’s an instruction addressed to a human is code nothing runs, with an instrument on it for once.
And the return dtype, which depended on an argument and said nothing about it: a crop cut with no size keeps the image’s own dtype and one brought to a size comes back float32, both fits alike. Measured on both dtypes and both fits, written into the docstring, and held by a test rather than left as prose.
The R half: none beyond nothing - rplatypus does not expose fill at all, and its route is source_image’s, so §3E applies in its plainest form and the pin stays at 0.8.0a80.
[0.8.0a80] - 2026-11-08
A weights sidecar now records WHICH cases were scored. pyplatypus#450 closes here, and it is #447’s remainder: that release recorded how the data was read and nothing about where the figures came from. The issue named three candidates. The measurement says one, which is the same shape #447 had one issue earlier, where it named four fields and labels turned out to be recorded already:
split IN. `fractions`, `group_by` and `seed` together with the discovered
samples decide the partition, so two runs on one folder at different
fractions or a different seed score DIFFERENT PICTURES and said
nothing about it
shuffle OUT. Training only. Its own description says *"Only the training data:
validation is read in order so that two epochs measure the same thing
in the same way"*, and every `shuffle=self.spec.data.shuffle` in the
four engines is on the `"train"` split while every scoring and
predicting loader passes `shuffle=False`. It changes what the weights
LEARNT, which is `ignore_threshold`'s class and already excluded by
name in the detection fingerprint's test
validation OUT. It gates whether a validation split EXISTS rather than changing a
figure's value: `validation: false` makes asking for one an
`EngineError` naming the field, so there is no number to misread
Why split is the one that mattered is in §4 rather than in an argument. dsbowl-unet’s card reports Dice over “134 held-out images”, the 134 case directories on this disk are a different 134, and the discrepancy that gave it away was 0.01 of Dice - which is also exactly what a rounding difference looks like. A sidecar that carries fractions, group_by and seed turns which 134 from a question into a reading.
Resolved, and the seed is the half that makes it reproducible rather than descriptive. seed defaults to 0 and arrives by resolution rather than by anybody typing it, which is #413’s whole argument; fractions alone describes a partition while fractions plus group_by plus seed plus the samples determines it. And group_by is the field examples/measure_split_leak.py exists for, so recording the shape of a partition without the thing that makes it honest would have been the weaker half.
Only when set, and that has a real second case here rather than a theoretical one: a run whose second folder is named by validation_path partitioned nothing, and the record says so by saying nothing. The two are exclusive and a validator already says which.
split and splits now sit in one block one letter apart, and a test pins that they are not kin. splits is the model’s tiling - a source image read at splits * input_shape and cut, #427 - and split is the data’s partition. One decides which pictures a metric sees inside a case; the other decides which cases there are. A reader meeting both in one dictionary will read one for the other.
Four publishers write a realised split by hand and this does not replace it, which is the distinction that kept #450 a question rather than a defect. What they write is the outcome - how many cases landed in each part, the grouping, the seed they passed - and what this writes is the configuration, resolved. Both are worth having and they are different facts, so they live at different levels: the publishers’ at the sidecar’s top level, this one inside measured_with. The clash guard has nothing to fire on, which is asserted rather than assumed.
The R half is a paragraph again. ?export_weights gained how the data was read at a79; this adds which cases were scored, and that is a different sentence rather than a longer one. R forwards split through segmentation_data and reads nothing back from the block, so R’s suite will not go red in the meantime - the same prediction that held at a79, for the same reason.
[0.8.0a79] - 2026-11-08
A weights sidecar now records how the DATA was read, which is the other half of what a figure was measured on. pyplatypus#447 closes here, and it is the fourteenth review pass’s one remaining finding. 0.8.0a76 put splits into the model’s measurement_fingerprint because a source image is read at splits * input_shape and cut, so the tiling changes the pictures a metric sees while the weights and the data stay the same. Three fields one layer out pass that same test and none of them is the model’s:
window soft_tissue against lung on pydicom's own `CT_small.dcm` moves a
picture by 0.793 of its range; against the full range, 0.449, 0.493
and 0.192 for soft tissue, lung and bone, with the same window twice
as the control at 0.000
channels_from `measurements/braintumour/channel-order.json` in this project's own
workbench scores ONE trained model at Dice 0.467 against 0.110 on a
permuted order, and `channel-order-20ep.json` 0.233 against 0.022
target_spacing a 24-voxel cube at source spacing (1, 1, 3) resamples to (24, 24, 72),
(24, 24, 24) or (12, 12, 36) for targets (1,1,1), (1,1,3) and (2,2,2) -
18432, 13824 and 4608 real voxels at an IDENTICAL model `input_shape`,
control 0.000 for the same target twice
It is a method on the data rather than three keys somewhere, and the layering is what decided where: ModelSpec.measurement_fingerprint’s first sentence is what a reported figure depends on, beyond the weights and the data, so putting data fields there would make that sentence false, and export_weights is handed a model and never sees a data specification at all. So DataSpec.measurement_fingerprint is the data’s half - per task by inheritance, which is the argument the model’s half already makes for itself - and Engine.export_weights joins the two, exactly as it already contributes _class_fingerprint. The issue proposed a fourth field, labels, and that one is recorded: Engine._class_fingerprint writes n_class plus exactly one of regions, classes_from, labels or colormap. The unrecorded set was three, not four.
Only what is set, which is the author’s decision. Three nulls would say measured without a window where the truth is written by an engine that could not answer, and those are different facts - the distinction 0.8.0a74 drew in R, where jsonlite returns NULL for a JSON null and for an absent key alike. window is therefore always there, because it always has a value: 'auto' is a windowing rather than an absence, and it means the window the file recorded, so two datasets read with auto are not necessarily read alike. Resolved rather than as written, for the reason #419 gives.
Additive and safe, checked rather than reasoned about. The three land inside measured_with and add no top-level key, and _refuse_mismatch walks the model’s fields rather than the sidecar’s keys - so a load cannot start refusing, which is what keeps the five published names loading. A clash between the two halves is a refusal, for the reason trained_with came to have four copies.
THREE engines write weights and wiring one of them left two silent, which was found by reading the code rather than by anything failing. InstanceEngine and DetectionEngine override export_weights and call pyplatypus.weights.export_weights themselves, so an instance or a detection sidecar recorded nothing about how its data was read - and window is on the base DataSpec, so both of those tasks have one. The end-to-end test written for the semantic route passed throughout. §4’s a guard one level below the change is a guard the change can be removed under, in its sibling-copy costume, and the third time this project has paid that bullet.
So the guard is an enumerating test rather than a third example: test_every_engine_that_exports_contributes_the_datas_half reads the engine classes off the modules, asserts which three define export_weights, and captures the call on each route - with the capture itself asserted to have happened, because a patch that bound nothing reads exactly like a route that passes the argument. ClassificationEngine is named as the one that does not export at all, with its reason, so a fourth exporting engine fails that list rather than inheriting silence.
Ten mutations, ten caught, identity case first and every file restored afterwards: the data’s half answering nothing (13 tests), each of the two optional fields dropped (3 each), both recorded always as null (4), an explicit window left a tuple (1), the data’s half replacing the model’s instead of merging (1), the clash guard removed (1), and each of the three engines in turn stopping passing it (2, 1, 1).
One mutation was deliberately not written, because it is not a mutation. Writing the merge the other way round - {**data, **model} instead of model.update(data) - leaves the whole suite green and has to: the clash guard raises on any shared key, so afterwards the two key sets are disjoint and the two orders are provably the same dict. 2,000 random disjoint pairs agree and an overlapping pair differs, which is the control. §4’s ask what the change would have to break, and if the answer is nothing, the site has no behaviour to guard rather than no guard.
The R half is NOT none, which §3E asks to be said where it will be found rather than in a commit message. R reads this block already - test-weights.R has a receipt for it since the a75 pin - and ?export_weights tells a reader what the block holds, task by task: a segmentation or classification fit records its metrics, an instance fit adds how objects were separated and decoded, and a detection fit records the three thresholds. That sentence is true and becomes incomplete with this release, because every task now also records how its data was read. So R owes one paragraph and a receipt when the pin moves; R’s suite will not go red in the meantime, because nothing there pins the block’s key set - unlike test-records.R, which pins the run record’s and went red at a74.
The run record needed nothing, which is worth stating because it is where a reader would look next: write_record writes specification whole, so all three fields have always been in it. The gap was only ever the sidecar, which records a fingerprint rather than a specification.
The remainder is filed rather than left: split, validation and shuffle decide WHICH cases were scored and pass this section’s own test, and all five published names carry a top-level split written by hand by their own publishing script - #419’s shape one key over. It is a question rather than a defect, because the configured split and the realised counts are different facts and recording both under one name is what the clash guard above refuses. pyplatypus#450 has the three options, the recommendation and the one measurement nobody has taken.
[0.8.0a78] - 2026-11-08
The four losses nothing could have caught a formula error in now have values from outside. pyplatypus#429 closes here. The thirteenth review pass measured that lovasz, combo and focal_tversky were held by nothing that can see a formula error, and that two branch bodies and one parameter had never executed at all. 0.8.0a77’s tag carried the Lovász third; this is the rest, plus the one decision it turned up.
Both of combo’s knobs survived being removed, and the defaults are why. At alpha = 0.5 the two halves weigh equally and at ce_ratio = 0.5 the two cross-entropy terms do, so both weight swaps are the identity exactly there - and every test of combo in this package was written at the defaults. The same shape holds focal_tversky: both its tests are named after gamma = 1, the single value where the mean of powers equals the power of the mean.
The reference for combo is the paper’s own equation (3), transcribed by hand from its page rather than recalled - Taghanaki et al., arXiv:1805.02798 - and transcribing it found two departures this package had never written down. Measured at four (alpha, ce_ratio) pairs:
one channel ours - theirs = (1 - alpha) exactly, to eight decimals
three channels ours - theirs = (1 - alpha) * (1 + (K - 1) * mean_dice)
The first is an additive constant - 1 - dice where the paper writes -dice - so the same gradient and the same minimiser. The second is the mean over channels where the paper sums, which is not a constant: summing makes the Dice half grow with the number of classes, so alpha would mean a different balance per dataset. The mean is the right choice and is the argument binary_cross_entropy already makes about its own reduction - it was simply undocumented, and the paper’s own experiments flatten to one channel, where the two agree.
And focal_tversky’s gamma is the reciprocal of the parameter of the same name in the literature. Abraham and Khan (arXiv:1810.07842) write the exponent as 1/gamma and recommend values in [1, 3]; this field is the exponent. The author’s decision on 2026-11-08 was to keep the meaning and state the conversion, because changing what a released field means would alter a stored configuration silently: both readings are valid positive floats and nothing could refuse the old one.
That ambiguity has already cost one of this project’s own measurements. The eleven-loss table of pyplatypus#203 ran focal_tversky at alpha 0.7, gamma 1.33 - the paper’s own number - and concluded that the focal exponent costs more than the asymmetry it is layered on. True of exponent 1.33, which is what ran; the paper’s 4/3 means exponent 0.75, which is a flatter curve rather than a sharper one. The row is valid for what it measured and is not a reading of the paper’s setting.
Added
An outside value for
focal_tverskyat any gamma, as the mean over (sample, class) of(1 - TI)^gammacomputed in plain Python with nothing imported from the package. Parametrised over 1.0, 1.5, 2.0 and 3.0 with the identity case first, so a failure on the first says the instrument is wrong rather than the subject. Four mutations caught, against a measured float32 noise of 1.2e-09: the power taken after the mean (2.75e-03), alpha and beta swapped (1.57e-03), gamma ignored (8.70e-02) and alpha ignored (7.53e-04). The bound is 1e-6, which sits 830 times above the noise and 750 below the smallest defect.An outside value for
comboat four(alpha, ce_ratio)pairs, three of them away from the defaults, as the relationship to equation (3) rather than as a pinned number - which is the stronger statement, since it holds at every setting. Five mutations caught, including the two that encode the departures above.The three branches nothing had ever run.
cross_entropy’s andbinary_cross_entropy’slabel_smoothingwas never passed non-zero anywhere in either suite, andfocal’s multi-classalphawas never passed at all -binary_focal’s was, which is the near-miss that makes a grep for the name look reassuring. All three agree with a hand reference, so this is holding rather than correctness. Four mutations caught, including the onebinary_cross_entropy’s docstring is written about: its smoothing divides by two rather than byn_class, 7.7e-03 apart on the fixture.focal’salphais held at its endpoints rather than by a direction, and the first draft of that test asserted a direction that is false. It claimed raisingalpharaises the loss because five of the fixture’s eight cells are foreground - a count, not a measurement. Measured, the three background cells carry 0.2381 of unweighted loss against 0.0824 over the five foreground ones, so raisingalphalowers it. The direction follows whichever cells the model is currently wrong about and is not a fact about the parameter; what is exact is the interpolation between 0.0297598 atalpha = 0and 0.0103049 atalpha = 1.
Changed
combo’s docstring records the two departures from the equation it cites, with the measurement for each and the reason the mean is the right choice.focal_tversky’sgammadescription names Abraham and Khan, says it is not their parameter, and gives the conversion in both directions. Held by a test that asks for the three pieces a reader needs rather than for the wording, and proven able to fail on each of them.
The R half: a fixture regeneration. The gamma description moves the field-prose ledger’s digest, so rplatypus regenerates tests/testthat/fixtures/field-prose.yml and re-reads the @param the ledger names - which is ?losses and R’s own loss_focal_tversky argument, where R states the same parameter in its own words. That is the ledger’s first answer, a description rewritten, which this file has recorded producing a finding once.
[0.8.0a77] - 2026-11-08
fives-unet’s pin moves to the commit where its sidecar states the peel count. pyplatypus#426 closes here. 0.8.0a76 put both numbers in the registry description and said in this file that the sidecar itself was an upload rather than a release; that upload happened on 2026-11-08, so a weights = "fives-unet" resolved by this engine now fetches a file a reader can reproduce the clDice figure from - cldice_iterations: 12 and splits: [4, 4], beside the cldice_measured_with: "0.8.0a73" that 0.8.0a74 added.
The published numbers do not move and the weights do not either. The blob was read at both revisions before the pin was touched: fives-unet.safetensors is oid 6e44ed6c763daa7dbb9e85578b503bf0d8cd874a, 7,793,480 bytes, at 799fea5c and at d342f3ad alike. Two files were uploaded, the sidecar and the card, and the four other names were fetched back at their own revisions and compared by sha256 against the local copies: all eight identical, with the same name at the old pin as the control that the comparison can report a difference - 23 keys against 25.
Why the sidecar was patched rather than re-exported, since 0.8.0a75 is the release that made an engine write those parameters: trained_with: "pyplatypus 0.8.0a11" is the engine that trained this file, and a scoring-only pass through export_weights has no training to report and would overwrite it. The two values are not typed - they are read off the publishing example’s own configuration by asking the engine for measurement_fingerprint() - and 12 is controlled against the re-score that reproduces the published Dice and IoU at 0.0 absolute difference, which is what says it is the same scoring pass over the same weights rather than a different run that agrees.
The flat keys are deliberate and are not 0.8.0a76’s nested measured_with. This file’s figures come from two engines - dice and iou from 0.8.0a11, cldice from the 0.8.0a73 re-score - so one measured_with.engine would claim a single provenance where there are two.
There is no new test, and that is the honest state rather than an omission. What a release can hold about a pin is that it is forty hex characters rather than a branch, and two tests already do. Whether the commit contains what this entry says is a question only the network can answer, so it is a check beside the weights - weights/.check-pins.py, run before this pin moved - rather than a test in a suite that must not reach huggingface.co.
The R half: None beyond the pin. available_weights() reads the registry from the engine, so an R user meets the corrected sidecar by the pin moving and by nothing else - and in this case not even the listing changes, because the description that names the peel count shipped in 0.8.0a76. The one thing an R user gains is that a model written with weights = "fives-unet" fetches the corrected file: platypus_fit() brings it down on first use and the sidecar comes with it. rplatypus#300 is that pin move, one move for this release and 0.8.0a76 together.
This sentence named load_weights until 2026-11-08 and neither package has such a function, which is rplatypus#229’s defect with the packages swapped - an invented name in prose about functions. R’s NEWS.md has been held against exactly that since then, by a test over its newest entry in both namespaces; this file is held by nothing, and of the four prose-about-functions documents in these two packages it is the only one. The name was invented while describing a route that had just been verified by hand, which is how these arrive: the sentence is about something true and the noun is made up. pyplatypus#440 is the guard.
Changed
fives-unet’s registryrevision,799fea5ctod342f3ad. One line, and the four older pins stay exactly where they are: their numbers were measured at those commits, and a pinned commit survives later edits to the repository - verified by sha256 for the second time here, the first having been the fifth upload replacing the same card.
[0.8.0a76] - 2026-11-08
A weights sidecar now records the tiling, which decides which pictures were scored. 0.8.0a75 asked, per task, which settings a reported figure depends on, and answered it by reading each task’s scoring path. The thirteenth review pass found the field that answer missed on the segmentation side: splits. A source image is read at splits * input_shape and cut, so the tiling changes the pictures the metric sees while the weights and the data stay the same - and weights_fingerprint cannot refuse a mismatch, because only input_shape is checked and every tile is input_shape either way. pyplatypus#427.
Measured on the published fives-unet, which was trained and scored at four tiles by four, with nothing else changed:
splits 4 x 4 dice 0.8788833 iou 0.7956029 clDice 0.8779068
splits 2 x 2 dice 0.8054393 iou 0.6790225 clDice 0.8216820
0.0734 of Dice on the same file, and the sidecar export_weights would write for those two runs was identical. The 4 x 4 row reproduces the published figures to every digit, which is the control that the move is the field’s rather than the harness’s.
The R half: None beyond the pin. R calls export_weights() and forwards what the engine writes; nothing it passes or reads changes name or shape, and measured_with gains a key. R’s own receipt for that structure asserts the metric list and not the key set, which is why this is a key arriving rather than a ratchet - unlike 0.8.0a74, where R pinned the run record’s names exactly.
Changed
SegmentationModel.measurement_fingerprint()recordssplits, as a list ornullrather than by omission - absent andnullread alike throughjsonlite, which is0.8.0a74’s own lesson one file over.InstanceModelinherits it, which answers the other half of#427: an instance figure is a figure per decoding and per tiling.Three mutations, each caught by the two tests written for it, with an identity case green: the key removed, the value replaced by a constant
None, and the tuple recorded as written rather than JSON-ready.fives-unet’s registry description names the peel count beside its clDice figure.pyplatypus#426. The published sidecar carries 0.8779068 measured at twelve peels while this engine defaults to five, where the same file reads 0.7970546 - 0.0809 apart, with nothing in the file to say why, which is the defect0.8.0a75was written for standing on the one name it was written about. The sidecar itself is on the Hub and its correction is an upload rather than a release, so#426stays open for it; what is in this repository is the description, and it now says both numbers.Held as a shape rather than as the figures, because the measurement lives on the Hub and nothing offline can confirm 0.878: a description quoting a clDice figure has to name the peel count beside it and name the default it is not at. Both halves proven able to fail.
Also in this tag
The v0.8.0a76 tag contains five commits and the entry above describes one. Written down on 2026-11-08, after the fact, because a reader asking what a version changed reads this file rather than a commit range - and three of those five changed something a user can see. The two bullets below are those; the rule they follow is that a test gets no bullet, which is pyplatypus#355’s own argument - a test is not something a release gives a user - so #434 and #436 are deliberately not here.
average_precision’s docstring stopped claiming"11"reads highest of the three,pyplatypus#431as#435. It is not a bound on the other two in either direction: on five predictions T F T T F against four truths,"all"is 0.625,"101"0.628713 and"11"0.613636 - the lowest. The docstring names the mechanism now, that eleven levels is a coarse sample so a curve whose recall lands between two of them loses the precision it reached there, and it carries that hand case.It is in the wheel, which is why it belongs in a release entry at all: that docstring is the published reference text for the function. No share of random curves is asserted, deliberately - how often
"11"comes lowest is a property of the distribution the curves are drawn from, 19.0% against"101"here against the review’s 21.1% on another generator, and §3C refuses a number that is not portable.retinal-vessels.qmdstopped arguing that a better-trained model closes the clDice gap,pyplatypus#425as#432. That sentence read a figure measured at five skeleton peels against one measured at twelve. Re-scored on the publishedfives-unetwith nothing but the peel count changed, at five peels the correlation is 0.8563 and the mean difference -0.0818, against the R vignette’s printed 0.8581 and -0.0833 - so of the 0.0874 between the two pages’ gaps, about 0.085 is the peel count and 0.0015 is the training. The page carries the re-score as its own table and says which setting each figure is at.
Fixed
0.8.0a74’s registry-move bullet read as one variable and the move was two, which the thirteenth pass asked about and the published weights answered without retraining:square/5tosquare/12is +0.0491, the--iterationsdefaultpublish_fives_weights.pyre-declared against the example’s 12 and#418removed, andsquare/12tocross/12is -0.0041,0.8.0a72’s erosion. A reader of that bullet alone would attribute +0.045 to the erosion and be out by a factor of twelve with the sign reversed. Corrected in place, where that file already keeps its corrections.0.8.0a72’s own sentence about the same figure is true as written and is left alone: before that release the publisher did produce 0.8329694, and after it no peel count can. Correcting a true sentence because a neighbouring one is wrong is how a changelog stops being readable.
[0.8.0a75] - 2026-11-07
A weights sidecar says what its figures were measured with, and stamps the engine itself. A sidecar recorded trained_with and the validation block and nothing about the parameters of the numbers in it. For dice that is harmless - it takes include_background and nothing else. For cldice it is not: iterations is the skeleton’s peel count, it moves the published fives-unet figure by 0.049, and it was written in no file at all, because it arrived as ClDice.__init__’s default through a publisher’s own flag. So is this figure reproducible had to be answered by sweeping the parameter until a run landed on the published digits. pyplatypus#413 is that day; #419 is this key.
The R half: the pin and one sentence. ?export_weights says the sidecar records “architecture, input shape, channels, classes, and whatever else you pass”, and from this release it also records what the caller does not pass. Nothing an R user calls changes.
Added
measured_withon every sidecar, carrying the engine that measured the figures and the configuration it measured them with, resolved rather than as written. That is the whole design: recording the configuration as a caller stated it would have recorded nothing in the case this exists for, since nobody statediterationsanywhere.measurement_fingerprint(), asked of the spec, for the reasonweights_fingerprint’s own docstring gives one method up - the answer is task-specific, and a fixed list inpyplatypus.weightswould have to grow a branch per task and reach for a field that is not there. Measured rather than assumed, which widened the issue’s own scope: segmentation and classification report a configured metrics list; instances addseparationanddecode, because one trained file scores 0.5445, 0.5390 and 0.4822 through three decodings and a number from it means nothing without the one it came from; and detection has nometricsfield at all and reports a table whose rows move withscore_threshold,nms_thresholdandoperating_point.ignore_thresholdis deliberately NOT in a detector’s block. It shapes the training target’s ignore mask, so it changes what the weights learnt rather than how they are scored - the same distinctionseparation’s settings get on the instance side, wherewidthandmodeare recorded beside the figures and kept out of the fingerprint that refuses a load.The base class answers empty and a test enumerates
AnySpec, so a task added next month either says what decides its figures or is named with a reason. A base returning something plausible - the metrics, say - would have answered for a task that has none and read as a record rather than as an omission.
Fixed
trained_withwas four copies in four publishing scripts, each writingf"pyplatypus {pp.__version__}"by hand, whiletests/test_version.py’s own docstring said “export_weights()stamps it into every weights sidecar”. That sentence described no code.export_weightswrites it now, which is the only function in a position to know it, and the four copies are gone - so a fifth publisher cannot forget.extramay add to the sidecar and may not replace what it computed. A caller passing its owntrained_withis how that key came to have four copies, and one passingmeasured_withwould be a second answer to the question this release exists to answer once. The refusal names the key.
Not done, on purpose
- The four older published sidecars are not backfilled. A sidecar states what the engine of its day measured, so writing today’s reading into a record of another day would replace an honest silence with a certainty nobody measured.
#413is the precedent that an unrecorded parameter is recoverable by measurement while the weights still exist - which is a better guarantee than a rewritten file.fives-unetcarriescldice_measured_withfrom#410, added by hand, and keeps it.
[0.8.0a74] - 2026-11-07
The run record says which epoch the weights came from, and it is two facts rather than one. 0.8.0a68 recorded the provenance where it is decided and 0.8.0a71 gave all four score tables one definition to read it through - and it still left the process with the session. write_record reached past the history into history.records, so run.json said which epoch was best by every metric the run logged and not which epoch’s weights it shipped, in the one file whose own docstring calls it a thing you can run rather than read. pyplatypus#417.
The column answers that question for somebody reading a table in the session that produced it. The record answers it for somebody holding a directory six months later, which is what trained_with on a weights sidecar exists for - and a run whose weights were published had its epoch in neither place.
Measuring it found stop_reason missing by exactly the same mechanism, on the same object, beside it - and spec/components.py tells a reader that “the run’s stop_reason names the clock, so a run that ran out of time does not read as a run that converged”, which was true in a session and false of the file. Adding one and leaving the other is §3F’s omission failure with one release’s delay.
The R half: the pin, one help page and one print method. read_record()’s @return enumerates the record’s keys and test-records.R asserts that set with expect_setequal, so the pin move turns R’s suite red until it follows - which is the ratchet rather than a break.
Added
weights_epochandstop_reasonas siblings ofhistoryinrun.json. Siblings and not fields inside it, because that key is a list of per-epoch rows and R reads exactly it -read_record()turns it into a data frame, so a scalar in there would change the type for the one reader that exists. The alternative, arunobject gathering the scalars the record already carries loose, is tidier and a breaking change to a published format for no reader that exists.They are read off
History.to_dict(), which until now had no caller at all. That method is the one place saying what a history carries, sowrite_recordreads the rows out of it and writes everything else beside them: a field added toHistoryreaches the record by arriving, rather than by somebody remembering a second list. A name that would overwrite one of the record’s own keys is a refusal rather than a silent replacement - amodelfield on a history would otherwise rewrite the model’s name, and a record quietly saying the wrong thing is worse than one that could not be written.weights_epochis present andnullwhere a run selected no epoch, which is the deliberate half: such a run ended on its last epoch andhistory’s own length already says so, while a key that vanished would be indistinguishable from this release never having happened.Five tests, and the one that closes the class is the third. The record is built from a history the trainer produced and held against what
evaluate()reports for the same run- two readers, one definition, because a record disagreeing with the table beside it would be worse than one that said nothing. Then every field
Historydeclares, by introspection, each set to a value no default could produce. Then the record’s exact key set, from its two sources. Then the refusal.
- two readers, one definition, because a record disagreeing with the table beside it would be worse than one that said nothing. Then every field
The registry’s
fives-unetmoves to799fea5c, whichpyplatypus#413unblocked. The pinned commit wasc4492f7a, whose sidecar carries the clDice figure#413proved no definition in this package can reproduce - so the Hub card a human reads was corrected by#410and the sidecar the engine fetches was not. Read back from the Hub before moving it: the sidecar’s sha256 goesea8c12eeto2a71513dandcldice0.8329694 to 0.8779068, withdiceandiouidentical at both, and the weights file is byte-identical at the two revisions -size 7793480,oid 747f478d5efa3c4a- so the pin move changes the sidecar and the card and nothing about the model.pyplatypus#420.Corrected after release: that move is two variables and this bullet reads as one. The reviewer’s thirteenth pass asked which, and the published weights answer it without retraining:
square/5tosquare/12is +0.0491 - the--iterationsdefaultpublish_fives_weights.pyre-declared against the example’s 12, which is#418- andsquare/12tocross/12is -0.0041, which is0.8.0a72’s erosion. So the figure rose because the flag went, and the erosion moved it slightly the other way.0.8.0a72’s own sentence about this is true as written - before that release the publisher did produce 0.8329694, and after it no peel count can - but a reader of this bullet alone would attribute +0.045 to the erosion and be out by a factor of twelve with the sign reversed.pyplatypus#426.
Fixed
- A mutation survived and the test it needed is about the format rather than the field. Reading the rows out of
to_dict()withgetinstead ofpopleaves a duplicaterecordskey besidehistory- the same file semantically, and a silent change to a published format that only R’s suite could have caught, since R pinsnames(record)exactly and the engine pinned nothing. §3F’s own argument, paid: the engine’s answer has to be held in the engine’s suite, or the next person to read the R failure fixes the R side. The record’s key set is asserted here now, built from the structural keys andHistory’s fields rather than from one list.
[0.8.0a73] - 2026-11-06
The detection table was the one of four that threw the answer away. 0.8.0a68 made the trainer record which epoch a run’s surviving weights came from, and DetectionReport.as_row carried epochs_run on its own - so detection was the only task where callback_early_stopping(restore_best = TRUE) worked, the provenance existed, and a user could not see it. pyplatypus#408.
The R half: the pin, and one page. R names best_epoch nowhere and forwards the table as it comes, so nothing an R user calls changes - but vignette("blood-cells") prints this table in full and is re-knitted for the column by the author’s decision.
Added
best_epochin the detection report, from the one definition rather than a fourth copy.as_rowspreadsengine._provenance_columnsnow, which makes it the fourth reader and empties that enumeration’s exemption list - and the staleness half oftest_weights_provenance.pyis what failed when the column landed, which is the guard from0.8.0a71doing exactly what it was written for.The empty exemption list needed a new control, which is the entry worth keeping. That test asserted
foundwas non-empty so that a clean comparison could not be a comparison over nothing - and with no literal left anywhere in the package, that assertion became a test of nothing itself. The extractor is now pointed at a one-line synthetic source it must find both keys in, so the package holds none is an answer rather than an absence of data. Measured both ways: blinding the extractor fails the test, and so does either mutation that puts detection’s own copy back.
Fixed
- A false reason in released code, and it was mine.
detection_engine.py‘s comment and_provenance_columns’ docstring both said the column could not be added becauserplatypuspins this table’s columns. R’s exact column set is asserted for the per-image table - the onepyplatypus#364moved - and the per-model table is checked with%in%, a subset, which a new column satisfies. So the cost I used to defer this was not there. A wrong reason in a docstring is worse than no reason, because it is what the next reader decides against.
[0.8.0a72] - 2026-11-06
The soft skeleton now erodes with the cross the paper’s own code erodes with, which is the twelfth review pass’s F1 and the author’s decision: compatibility over keeping a number still. soft_skeleton cited Shit et al., CVPR 2021 and did not implement it - the reference code erodes with a cross and dilates with a square, and both of ours were squares.
The R half: None beyond the pin. clDice is a metric R forwards as metric_cldice(); nothing it calls changes name or shape, and the numbers move.
Corrected after release: this said “a metric and a loss R forwards”, and clDice is a metric in both packages and an objective in neither -
cldiceis in the engine’s metric catalogue and in no loss catalogue, and R exportsmetric_cldicealone. The same false claim was written into R’s ownNEWS.mdentry for this pin and was caught there by §3F’s NEWS-prose rule, which asks that every`name()`in the newest entry resolve: it namedloss_cldice(). The rule cannot read this file, which is why one copy was caught and the other had to be read.
Changed
soft_skeletonerodes with_erode_cross, the minimum of one erosion per axis, at any rank.pyplatypus#405. Asserted againstscipy.ndimage.binary_erosionwithgenerate_binary_structure(ndim, 1)in 2D and 3D, with the square erosion as the negative control, because a square erosion is also exactly some scipy call and a test without that control passes on what this release is fixing._dilateis unchanged and stays a square, which is the same asymmetry the reference has.It is a second function rather than a change to
_erode, and the suite is what said so. The cross went into_erodefirst, which has a second consumer:surface(x), whose tolerance band is calibrated against a euclidean distance transform. 15 assertions intest_surface_dice.pywent red, and they were right - a cross would make that band a city-block one. So the cross belongs to the paper’s skeletonisation rather than to this package’s idea of an erosion, which is also the honest place for it, and a test now asserts both: that the skeleton’s erosion is the cross and that_erodeis still the square. Mutatingsurfaceto use the cross fails 15 tests; mutating the skeleton to use the square fails 8.Why that asymmetry is not the error in classical morphology it looks like, since it is the first thing anybody objects to: an opening whose two operators differ is not anti-extensive, so
dilate(erode(x))can exceedx- and the skeleton is the residualrelu(x - opened), so an opening that recovers too much makes the residual smaller and thereluclips it at zero. Measured on a real mask and on a diagonal band,max(skeleton - mask)is 0.000000 for the square pair, the reference pair and the symmetric cross pair alike: asymmetry loses skeleton and cannot invent any. The authors say the same in their own issue tracker - it is an approximation by pooling, and a correct skeleton is not guaranteed.No
structuring_element=flag, and that is a measurement rather than a preference. A flag setting both operators would make its"cross"mean cross-and-cross, which is a third answer: over 10 FIVES masks with a thinned prediction it gives 0.9004 where the reference pair gives 0.9097, a gap above every run-to-run floor this project has recorded. So the comparability this release buys would be lost again by the one flag anybody would ask for.
Measured
What the change costs, so that nobody has to rediscover it. The same masks, the prediction thinned by
kerosions, 10 FIVES test masks:k=2 square/square 0.9134 cross/square 0.9097 cross/cross 0.9004 k=3 square/square 0.7471 cross/square 0.6731 cross/cross 0.6703The cross is stricter, and the gap grows with how wrong the prediction is - 0.004 at 0.91 and 0.074 at 0.75. A diagonal three-pixel band is the sharpest single case: 190 band pixels, 184 kept as “skeleton” by the square erosion against 64 by the cross, which is one pixel per row and is what a centreline of a diagonal is.
fives-unet’s published sidecar recordscldicemean 0.8329694 over 200 cases, and this release is the reason that figure is no longer what the engine would produce. The weights are unchanged and theirdiceis unaffected; the registry description quotes the Dice and not the clDice, so nothing in the package states a figure this moves. Re-scoring the published weights needs no retraining and ispyplatypus#410.
Known
vignette("retinal-vessels")prints clDice in 24 places and is not re-knitted here. It owes a re-knit forrplatypus#289already - it prints abest_epochthe pinned engine no longer produces - so one run of 2 h 32 pays both debts rather than two.
[0.8.0a71] - 2026-11-06
One place that records which epoch the weights came from. 0.8.0a68 made best_epoch the epoch a score row’s own figures came from, by recording the provenance in the places that decide it. The twelfth review pass mutated each of those places against the whole suite and five of the nine survived: swa‘s clear, the classification and detection trainers’ copies, and the instance and classification tables’ reads. The two tests written for #398 each held the one route they were written on - a guard at the right level covering one of three parallel copies.
Six of the nine were one rule written out three times, so the repair is deduplication rather than five more tests - which is what ask_to_stop, finish_training and object_labels each concluded before it.
The R half: None beyond the pin. Guards, two deduplications with no behaviour in them, and one comment; nothing an R user can reach moves.
Fixed
finish_trainingrecords which epoch the surviving weights came from, in the loop that decides it.pyplatypus#403.Which weights a run ends on is settled by whichever weight-replacer runs last, and that is settled there - the same argument
#333made about where a rule about what runs last belongs. The three trainers each carried the two lines afterwards, byte for byte, and two of the three copies could be deleted with the whole suite passing.historyis a required argument rather than an optional one, because an argument a caller may omit is the same defect with a default.engine._provenance_columnsis the one definition of the two columns a score table carries about the run.pyplatypus#403.epochs_runandbest_epochwere written out identically in three tables, and thebest_epochhalf could be put back to its pre-0.8.0a68meaning in two of the three with nothing failing.The classification engine’s
describedset - which decides what its error message offers a reader as a metric - now takes its keys from the same place instead of restating two of them, so a column added to that row cannot be described as something tomonitor.And deduplication alone does not close the class, which the mutation said. A trainer that passes a throwaway
History()satisfies the signature, writes the provenance nowhere a caller can see, and the suite passes. So the question is asked of whatfitreturns, per trainer, offtest_trainer_contract.py’s own builders: two epochs atmin_delta=1e9, sobest_epochmust be 1 whileepochs_runis 2 - which neither a constant, nor the last epoch, nor the lowestval_losssatisfies - with the other half asserting that a run with no callback to select an epoch reports none.Both averagers’ clears are held at the placement that is observable, which is after each one’s own early return rather than after the load: moving either clear to just before
load_state_dictchanges nothing, measured rather than assumed.
Known
DetectionReport.as_rowcarriesepochs_runand nobest_epoch, so detection is the one task of four where the trainer records which epoch the weights came from and the report discards it one line before printing - althoughcallback_early_stoppingworks there exactly as it does elsewhere.pyplatypus#408, becauserplatypuspins that table’s columns exactly, so the column needs an R half, and because whether a report wants a column that is often empty is a question before it is a change.
[0.8.0a70] - 2026-11-06
Six reads and a decision rule, every one of them survivable. 0.8.0a67 closed the field-delivery class with three enumerating tests, each carrying a completeness half read off the code by AST and an exemption list. The twelfth review pass went at the exemptions and at the half of the class the eleventh had called unmeasured rather than held. Six reads and one threshold could be replaced by a literal with the whole suite - 2894 tests - still green.
The transferable half is the unit. An exemption was written for a field - blocks and filters as shape-bearing - and was true of one site: the U-net’s output size does say so, the encoder route’s does not, and a classifier’s output is (batch, n_class) whatever either field is. So two reads survived behind a sentence about a third. And one field with a row survived anyway: activation is read by the classifier’s own encoder and by initialise two lines further down, so replacing the first by a literal still left something changed. The unit of this class is the read site, which is the eleventh pass’s own lesson one table over.
The R half: None beyond the pin. Guards, one extraction with no behaviour in it, and two documentation lines; nothing an R user can reach moves.
Fixed
A row now says which reading it claims, so a second read of the same field cannot answer for the first.
pyplatypus#404.tests/models/test_field_delivery.pyasked the weakest question that cannot be satisfied by accident - does a non-default value change the built network at all? - over a fingerprint carrying the module types and the parameter values. That is one question too few for a field read in two places. Measured: with the classifier’sact=spec.activationreplaced by"relu", every activation module in the built network isReLUunderactivation: geluand the file still passed, becauseinitialisereads the same field and perturbed the weights.Each row carries
STRUCTUREorVALUESnow, and the split is read off the code rather than chosen: every field in both tables butinitialiserchangesrepr(net), andinitialiserchanges nothing else. A structural row is asked of the module tree alone, where no other read can answer for it; aVALUESrow is asked two-sidedly - the tree identical, the numbers different - so a field that started restructuring something would fail rather than pass more easily.blocksandfiltersare rows rather than exemptions, in both tables and on the encoder route.pyplatypus#404. Four reads, all four caught by mutation now with an identity control green. What is left in the exemption list names the test that holds the field rather than a property of the name.The encoder route’s enumeration had no completeness half, which is why
blocksandfilterswere missing rather than exempted - a state that looks identical from inside the file. It is read offengine._encoder_forby AST now, scoped to that one function because the unit is the site, and a thirteenth argument there fails this file.channelsjoined it as a row at the same time.The detector’s three build arguments had no site to be asked at, so
in_channels=model_spec.channelscould be a literal.network_foris lifted out ofDetectionEngine.train’s loop - the same three arguments, no behaviour - because a read only one route reaches has to be reachable as that route, or the guard written for it sits one level below the change.pyplatypus#404.Every optimiser field a builder reads, enumerated for the first time.
pyplatypus#404._BUILDERSis eight lambdas over 38(class, field)read sites and not one of them was held; the pass replacedAdam’sweight_decayby0.0and the suite passed.tests/training/test_optimizer_field_delivery.pyis the table, attributed to the class whose key each lambda sits under, with the completeness half read off the lambdas.Its own control earned itself on the first run:
AdamW’sweight_decaydefaults to 0.01 rather than to 0 - that difference is what AdamW is - so the value shared with the other seven optimisers was that one’s own default, and the row would have passed against the mutation.A multi-label prediction is hardened at
logits > 0, and nothing could tell that fromlogits > 0.5.pyplatypus#404, F3. Both sites -SegmentationMetric.forwardandMultiLabelMetric.update- carry a comment sayinglogits > 0issigmoid > 0.5exactly, which it is; moved tologits > 0.5, which isp > 0.622and a different model, the whole suite passed. 169 executing tests reach the first site and 8 the second, and not one of them predicts a logit between 0 and 0.5: confident logits are what a fixture is written with, and they answer alike under both rules.tests/objectives/test_hardening_threshold.pyis that one input, asked at both sites, of every segmentation metric the configuration offers and both multi-label classification metrics that harden - withaucnamed by its ownneeds_scoresrather than by a list, and a mirror-image row so a rule loosened to> -0.5fails as well. All four mutations are caught with the identity control green, and the file asserts outright that a confident logit cannot distinguish the two, which is why the suite was green.
[0.8.0a69] - 2026-11-06
The third turn of one screw, and the reviewer’s twelfth pass found it. #392 read a palette file as its indices; #396 fixed the 16-bit-table case by dividing by what the table holds; this divides by what an 8-bit entry means, which is the one of the three that does not depend on the file.
The R half: None beyond the pin. The scaling is inside read_dicom, which R forwards to.
Fixed
A palette whose brightest colour is not white was stretched until it was.
pyplatypus#402.#396scaled a wide lookup table holding 8-bit values by the brightest entry present, which is right only when that entry is 255 - and the test written for it used exactly that, so the fixture could not contain the case. Measured on a table of 200 and 100:8-bit table, entries 200 and 100 (control) red 0.7843 blue 0.3922 16-bit table, the same entries red 1.0000 blue 0.5000 <- before 16-bit table, the same entries red 0.7843 blue 0.3922 <- afterScaled by 255 now, because that is what an 8-bit value means wherever it is stored, and it is what the 8-bit branch already did. The warning stays and says so.
The test asserts the invariant rather than the digits: the same palette must read the same at 8 bits and at 16. A test pinning 0.7843 alone would pass on a wide branch that had quietly become a copy of the narrow one and would never ask the question. It fails on
#396’s scaling and on#392’s, with an identity control green.
Documentation
Two schedules said the last epoch trains at
min_lr, and neither does.pyplatypus#402’s pass, F7. Measured over five epochs from 1.0 withmin_lr0: cosine trains at[1.0000, 0.9045, 0.6545, 0.3455, 0.0955], digit for digittorch.optim.lr_scheduler.CosineAnnealingLR(T_max=5), and the linear one at[1.0, 0.8, 0.6, 0.4, 0.2].min_lris written after the last epoch, where it trains nothing.The behaviour is torch’s, which the same docstring says it should be, so the prose moved rather than the code. Both now say where
min_lractually lands.
[0.8.0a68] - 2026-11-05
One row, two epochs. Every score table reported a best_epoch that was the lowest validation loss, read off the history whatever the run was watching, while the scores beside it came from the weights restore_best kept - the best monitored epoch. The default monitor is val_loss in all three callbacks that have one, so the two agreed in every run where nobody named a monitor and diverged exactly when somebody did.
The R half: None beyond the pin. The column is forwarded rather than read, and nothing in rplatypus names it.
Fixed
best_epochis the epoch the row’s own scores came from.pyplatypus#398.Found by the classification article printing both numbers and disagreeing with itself: on BCCD crops with
monitor: val_auc, 44 epochs run, the weights kept were epoch 29’s and the table said 18, because that run’s validation loss rises from the first epoch while its AUC keeps improving.The repair is not a different history lookup. Which weights a run ends on is decided in
on_train_endby up to three callbacks, in the orderfinish_trainingfixes, so the provenance is recorded where it is decided:EarlyStoppingwrites the epoch of the snapshot it restores,EmaandSwaclear it after loading an average - and only after, so a run that ended before averaging began keeps whatrestore_bestrecorded. The three trainers copy it onto theHistoryafterfinish_training, never before.So the column is
Nonewhere it used to carry a number: a run that selected no epoch ended on its last one, whichepochs_runalready names. The epoch that was best by some other quantity isHistory.best(key), which this makes the only way to ask that question, and the three docstrings say so.Four tests, each failing on its own half of the fix: the restored epoch is the monitor’s, nothing selected is
None, an average isNone, and an averager that never averaged leaves the restored epoch standing. A fifth asserts the table reports it, with a run that selected nothing as its control - measured by putting the old lookup back, which fails it.
[0.8.0a67] - 2026-11-05
The reviewer’s eleventh pass, and the one that bounded the class the tenth found. Of 40 engine read sites measured across the two passes, 21 were held by nothing; this release holds every one the pass named, and the repair is one enumerating test per route rather than one test per field - because every survivor in both passes was a read nobody enumerated.
Fixed
A 16-bit palette lookup table holding 8-bit values read as almost black.
pyplatypus#396.#392scaled bynp.iinfo(dtype).max, which divides by 65535 - so a table whose entries reach 255, a writer quirk pydicom documents rather than a malformed file, came back at 0.0039:16-bit descriptor, entries reach 255 left [0.0039 0 0] right [0 0 0.0039] 16-bit descriptor, full range (control) left [1 0 0] right [0 0 1] 8-bit descriptor (control) left [1 0 0] right [0 0 1]Scaled by what the table holds now, and announced: a reader needs to know the file was unusual rather than merely that the picture came out right, because silence is the outcome
#392was written against. An ordinary palette is neither rescaled nor warned about, which is the control.window=on a palette file was dropped in silence and now warns by name. The table’s output is already the picture, so there is nothing to window - and a caller who passed one is working on a wrong premise about their data.pyplatypus#396.Two tests decided on the draw rather than on the code.
pyplatypus#394.tests/test_score_at_source.py’s whole-mask test failed about one run in twenty on an unseeded one-epoch fit, andtest_the_returned_mask_covers_the_anatomy_in_the_source_scanfailed twice of two when run after the 114 tests that executeparameter_groupswhile passing 9 of 9 alone. Both are guards, which is where the cost is: a flake there trains people to re-run rather than to read.Both specs carry a seed now - three different global RNG preludes give figures identical to ten decimals - and the whole-mask test asks its question of chosen predictions instead of a trained model, so the separation is a construction: the exact case scores 1.0, the group 0.271291, 0.73 apart where the old bound was 1e-3 against a measured spread of 0.0057 to 0.2352. The bound was never calibrated, which is §4’s own rule in a test written the day it was being re-read.
Changed
The field-delivery class, closed on the sites the pass measured.
pyplatypus#395, and this is#386finished: the tenth pass said “all thirteen arguments of that call are unheld,pretrained=included” and0.8.0a66closed one of the thirteen.Three enumerating tests, one per route, each asking the weakest question that cannot be satisfied by accident - does a non-default value change the built object at all?
tests/models/test_field_delivery.py the two model builders, 18 rows tests/models/test_pretrained.py the encoder route's own forwards, 6 rowsEach carries a completeness half that is the point of the shape: the table is checked against the fields the builders actually read, by AST, so a field added next month either gets a row or is named with a reason. A planted new read fails it. And each carries the control that two builds of one specification agree, because the fingerprint reads parameter values -
initialiserchanges nothing structural.Three fields needed their own thing beside the enumeration, and one of them taught the positional lesson again:
pretrained, spied attimm.create_modelthrough both encoder routes, with no download. Forced toFalseit leavesweights_fingerprint()["input_normalised"]atTrueover a randomly initialised backbone - the silence#370exists to refuse.encoder_learning_rate, whoseparameter_groupsbranch coverage marked UNEXECUTED over the whole suite. Held at three levels, and the first repair was written one level too low: with the function’s own branch held, both trainers’ forwards still survived. §4’s a guard one level below the change is a guard the change can be removed under, paid by its own author in the hour he was closing other instances of it.- the detection five -
score_threshold,operating_point,ignore_threshold,box_loss,min_visibility- which change no module, so each is asked at the call it is forwarded through or read off the built objective.
And
batch_sizeon all three loaders, where the existing classification assertion was== 8, the field’s own default: a read replaced by its default satisfied it. A non-default is what makes it a reading.
The R half
- R’s request assembly drops nine of twenty forwarded fields with its whole suite green, six of them with an engine-side guard that cannot see a field that never arrives.
maju116/rplatypus#281.
[0.8.0a66] - 2026-11-05
The reviewer’s tenth pass, and the first that asked whether the tests can fail rather than whether the code had been read. Its method was positional: remove the fix, or replace a field’s read with a constant, and see whether the whole suite goes red. Nine findings, three of them defects and six of them guards that were not there - and the largest single class it measured is the delivery of specification fields to the objects they configure, where 9 of 10 mutated reads survived.
Fixed
Offline, an
hf://repository that publishes no sidecar was refused, although the hub’s own cache records the file as absent.pyplatypus#384.#379putexcept LocalEntryNotFoundErrorfirst and made it raise, which is right for the five registry names and wrong for the form this function’s docstring says must keep working. Offline,hf_hub_downloadraises that class both for a file it could not reach and for one it has already been told is not there - it never consults the.no_existmarker it wrote itself. Measured on a cache built by hand withHF_HUB_OFFLINE=1:try_to_load_from_cache(repo, "w.json", revision=rev) is _CACHED_NO_EXIST True hf_hub_download(...) LocalEntryNotFoundError 0.8.0a64 resolve_weights("hf://someone/else/w.safetensors@<hex>") RESOLVED 0.8.0a65 the same call, the same cache REFUSEDSo
_CACHED_NO_EXISTis read as what it is - the repository’s answer - and the refusal is kept for a registry name whatever the cache says, and for anhf://file the cache has no answer for. The route is threaded through_from_hub(published=)because the sentence “every name in this registry publishes one” is true of the registry and false ofhf://, and it was the half that sent a reader to fetch a file that does not exist.normalise: truewith noencoderwas accepted and did nothing.pyplatypus#389.The two validators beside it refuse exactly that shape -
pretrained_needs_an_encodersays “silently ignoring the flag would leave someone believing they had transfer learning when they had none” - and the field’s own description names the backbone’s ImageNet statistics, which without a backbone do not exist. It is refused now, and the test that asserted the silent acceptance is the one that changed: that was a decision of#381’s, one release old, contradicting the rule its neighbours state out loud.normalise: falsewith no encoder is still accepted.A
PALETTE COLORDICOM was read as its palette indices.pyplatypus#392.PhotometricInterpretationwas consulted only forMONOCHROME1, so the lookup table was never applied: an 8x8 file whose table maps index 0 to red and 1 to blue came back as[0, 0, 0]and[1, 1, 1]- the indices, windowed and repeated across the channels. An index carries no ordering, so a model trained on such files learns from one the file never claimed, and the windowing makes it look deliberate. The table’s output is the picture, so it is scaled by what its own entries can hold and neither windowed nor inverted, and a file that claims a palette and carries no table is refused by name. Measured on both table depths, because pydicom returns uint8 for an 8-bit table and uint16 for a 16-bit one.
Changed
Nine guards, for lines that had none. Each was found by removing the thing it now holds and watching the whole suite stay green; each is proven to fail on that same removal.
pyplatypus#385,#386,#387,#388,#391.normalisereaching the network (#385). Its two forwards -engine._encoder_forandmodels/classifier._encoder_for- could each be deleted with 2789 tests passing, and the result is the silence#370was written to refuse: a fingerprint recording a normalisation the network does not apply.#381’s tests held the two ends and nothing held the middle, because_encoder_foris executed by no test in this suite - which left all thirteen of its arguments unheld,pretrained=included.- Six model fields and the NMS threshold (
#386).dropout,batch_normalization,spatial_dropout,upsample,initialiser, the decoder’sseparable_convandDetectionEngine.predict‘siou_thresholdwere each replaceable by a constant with the suite green. The tests count modules rather than assert a shape, which is what the existingtest_modifiers_compose_with_every_architecturecould not do. The decoder’sseparable_convis only reachable withupsample: true, which is why the encoder blocks’ identical read was held and this one was not. - Three lines behind published numbers (
#387). A grouped source-grid score could come from its last case, a whole-mask metric from its best case, andsummarise_casescould report the mean where it says median - which is in every published sidecar’svalidationblock. The grouped tests compare the two pooling implementations against each other at 64, where no resizing happens, which is the pair that path never had. The case-order guard now has a planted mismatch. - The instance engine’s two hooks (
#388), which no test executed: its test-split question and its run record. The §3F row that covers the first was a grep over source, satisfied by the name in a comment - andtests/test_engine_base.py’s own docstring had said the behavioural column was owed. Four columns now, named in that docstring and asserted to exist. - Four example scripts with no configuration test (
#391): the historical defect this file was written for -taskremoved,n_classback - passed the whole file when reintroduced into any of them. A census over every script exposingspecification()is what makes a fifth script covered without anybody remembering, which isSCRIPTS’ own argument reaching the half of the file that did not get it.
normalise’s description gains the clause about needing an encoder, which is what the new refusal says.
Documentation
#382’s own prose described a loss the fix does not repair.pyplatypus#390.The comment in
decodesaid “a box whose own score is below the threshold used to survive it, and one above it could be dropped”, and its next paragraph proves the second half impossible: sincemax(class) <= 1the score never exceeds the objectness, so a box above the threshold on its score was above it on objectness. The 0.396 box the changelog entry named was the ninth pass’s control, and it is dropped after the fix too. Measured over 3,000 random outputs with a saturated class channel in every seventh case: the old gate dropped 0 boxes scoring at or above the threshold. The inequality is a test now rather than a sentence, withmax(class) == 1.0exactly as its case.
The R half
normalise’s two forwards inrplatypussurvive the whole R suite the same way, and the0.8.0a65entry in itsNEWS.mdcarries the same corrected sentence.maju116/rplatypus#278.
[0.8.0a65] - 2026-11-04
The reviewer’s ninth pass. Two of its four findings are defects the eighth pass’s own fixes carried in, which is the second release running with that shape.
Fixed
The sidecar fix was undone offline, by one line of class hierarchy.
pyplatypus#379.#371separated “this repository publishes no description” from “the description could not be fetched” so that the second raises. Inhuggingface_hub2.4.0,LocalEntryNotFoundError’s MRO isLocalEntryNotFoundError, FileNotFoundError, OSError, **EntryNotFoundError**, …- so the benign clause caught the offline error first and the raise never saw it. Reproduced with the real client, an emptyHF_HOMEandHF_HUB_OFFLINE=1: the fetch raisesLocalEntryNotFoundError,_fetch_sidecarreturnsNone, and acolormapof[[9,9,9],[1,2,3]]loads without a word. So the fix was undone for precisely the user it was written for.Caught before
EntryNotFoundErrornow, with the subclass relationship asserted in the test rather than assumed - if it ever stops being true, the test passes for the wrong reason otherwise.The multi-frame refusal read only the header.
pyplatypus#380.#372refused onNumberOfFrames. A file whose pixel data holds frames while the tag is absent or says 1 went down the old path and came back as the picture#372was about: four 8x8 frames as a(4, 8, 1)image whose rows read 0, 21845, 43690, 65535. pydicom warns that the data is bigger than the tag claims and hands the array over anyway, so the reader was proceeding on data it had been told was suspect.Decided from the array now: three dimensions with one sample per pixel is frames whatever the header says, and three dimensions with three samples is one colour frame, which is the control. The header still goes in the message, because somebody fixing their file needs to know what it claims.
score_thresholdcut on objectness while the box was reported withobjectness x max(class).pyplatypus#382.The field’s description, in this package and in R’s
@param, says “discard a predicted box below this confidence”. Measured on one cell atscore_threshold = 0.5: objectness 0.6 with best class 0.10 was kept and reported at 0.0600. The control was objectness 0.4 with best class 0.99, reporting 0.3960, which the gate dropped and the fix drops too - this sentence read as though that box were a second symptom, and it is not. The defect is one-directional. Corrected in0.8.0a66,pyplatypus#390.The repair is exact rather than a trade, and that is the part worth keeping: since
max(class) <= 1, the score never exceeds the objectness, so the existing gate is a lossless prefilter and the only thing missing was the second cut on the reported score. Nothing extra is computed and no box that should survive is lost.Measured on the published figure before shipping, because
bccd-yolo3’s card quotesmAP@0.5 0.857and_reportsbuilds it frompredictat the default threshold of 0.01. The published weights over their own 72 held-out images:predictions kept 2771 -> 2537 234 dropped, 8.4% map_50 0.857075 -> 0.857075 map_50_95 0.500337 -> 0.500337 mean_matched_iou 0.805806 -> 0.805806Identical to six decimals, which is the strong form of what the issue could only guess at: the boxes this drops are in the tail that the precision-recall envelope ignores.
Added
normalise, so that weights exported from a pretrained encoder can be reloaded without a network.pyplatypus#381.#370madeinput_normalisedpart of the fingerprint, which stopped a silent reload into a model that does not normalise - and left no third option, because the normalisation existed only underpretrained: true. Reloading your own weights then meant downloading ImageNet weights to overwrite them, and offline it could not be done at all.The field defaults to
pretrained, so every specification written before it resolves to what it did then, and the fingerprint records the effect rather than how it was asked for.pretrained: false, normalise: trueis the offline reload, and it matches a file exported underpretrained: true.What makes it cheap is measured rather than assumed: the statistics come from the backbone’s configuration and not from its weights. Offline, with an empty
HF_HOME,PretrainedEncoder("resnet18", pretrained=False, normalise=True)gives mean0.485/0.456/0.406and std0.229/0.224/0.225, and the old default still does not normalise.
The R half
- Nothing beyond the pin.
#382changes whatpredict()returns, which an R user meets through the pin, and#381adds a field R forwards without needing to know about.
[0.8.0a64] - 2026-11-04
Two things the eighth pass’s day named and deliberately left until the pass was over. One is a CVE in torch that makes a comment in this package false; the other is a method nothing calls, whose overall row had quietly stopped matching the rows it summarises.
Fixed
read_statesaidweights_only=Truemeans a file cannot execute code that came with it. CVE-2026-24747 is that sentence being false below torch 2.10, and the comment now says what the argument actually asks for.pyplatypus#376.The unpickler did not validate pickle opcodes or storage metadata, so
SETITEMagainst a non-dictionary, or a storage whose declared length disagrees with the archive, can corrupt the heap and may reach code execution. CVSS 8.8. This package reads a torch archive - anything beginningPK, which is whatmodel_checkpointwrites - through exactly that call, and it is reachable by loading somebody else’s.pthfrom a path or anhf://reference. Everything published here is safetensors, which has no such surface.A warning rather than a refusal, and asked of the running torch rather than left to the version floor. Refusing would take away the reload of a user’s own checkpoint, and which file is trustworthy is a question about where it came from that this function cannot answer for anybody. The floor would not reach the case either: from R’s route torch is a transitive dependency resolved by uv, so a floor binds nobody there, and an environment that already holds an older torch is never asked to change.
The floor stays at
>=2.7on a measurement, and the manifest’s reason for it was wrong. It claimed torch 2.8+ ships only CUDA 13 builds, dropping Maxwell, Pascal and Volta, so a GTX 10-series card needs 2.7.x. The cu126 index carries 2.8.0 through 2.14.1, and2.14.1+cu126on a GTX 1070 reportssm_50 sm_60 sm_70 sm_75 sm_80 sm_86 sm_90,is_available()True, the card by name, and a 512x512 matmul agreeing with the processor to 9.9e-05 - the card issm_61, no build lists it, andsm_60serves it. What really pins that route is which build PyPI serves by default: 2.7.1 defaults to CUDA 12.6, 2.9.1 and 2.10.0 to 12.8 (which dropped sm_50 to sm_70) and 2.14.1 to 13.0. Raising the floor was tried and measured: the next resolution produced2.14.1+cu130,is_available()False, an arch list starting atsm_75, and a silently lost GPU. So thepascalextra keeps its<2.8cap, both comments now carry the measurement, and the escape for that hardware is an explicit--index-url https://download.pytorch.org/whl/cu126install oftorch==2.14.1.
Removed
DetectionMetrics.as_rows().pyplatypus#377.0.8.0a62addedignoredto every per-class row of a detection report and not to the overall row this method appends, so a frame built from it carried a missing value in theallline. Nothing noticed because nothing calls the method: its only caller was the test written for it, and that test was namedtest_rows_carry_an_overall_line_for_rwhile its docstring said “the shape R wants” - and R asks the shim forevaluate_classes, which isDetectionReport.per_class(), a different projection built field by field.Deleted rather than completed. Completing the row leaves a second shape that has to track the first for ever with nothing able to notice when it stops, which is exactly what happened in the only field it ever gained; deleting it makes that drift impossible instead of guarding it. The sentence in
evaluate_classes’ docstring citing it goes with it; the decision it cited - no precision or recall in an overall row - is stated in the paragraph above and stays.
The R half
- Nothing beyond the pin.
#376’s warning is a message an R user sees through the bridge and#377removes a surface R never reached.
[0.8.0a63] - 2026-11-04
The reviewer’s eighth pass, which read the complement: the four networks, the weights registry and the pin - 3,301 lines no previous pass had opened. Six findings here, and two of them rode in with yesterday’s own fix.
Fixed
map_50_95was computed on misaligned rankings whenever adifficulttruth absorbed a prediction at some IoU thresholds and not others.pyplatypus#368, and a regression of#364from the day before.The scores were pooled once, at the lowest threshold, and that one ordering indexed every threshold’s hit flags. Absorption is
absorbed >= iou_threshold, so a prediction covering a difficult object at IoU 0.8 leaves the ranking at 0.50 to 0.80 and stays in it at 0.85 to 0.95 - and at those thresholds the flag array is longer than the permutation, soflags[across]silently takes the first rows of a permutation built for other predictions. Measured on two images, one difficult truth with a prediction on it at IoU 0.8 and score 0.9, one ordinary truth predicted exactly:ten separate single-threshold calls 1.0 at 0.50-0.80, 0.5 at 0.85-0.95 mean 0.85 one call over the same ten 0.70 one call over (0.5, 0.85) 0.50 against 0.75 separately control, nothing marked difficult 0.775 both waysScores are pooled and sorted per threshold now, because the set of judged predictions belongs to the threshold. A length check beside it makes any future divergence a refusal rather than a number.
map_50, the two counts andmean_matched_iouwere never affected - they read the first threshold only - and no published figure is:bccd-yolo3’s card quotes mAP@0.5, and BCCD marks 0 of its 4,888 objects difficult.A weights file loaded silently under another
activation, and a pretrained encoder’s ImageNet normalisation was lost on reload.pyplatypus#370.load_state_dictis a loud guard for everything that changes a tensor’s shape. These two change what the network computes with every key still matching, and neither was in the fingerprint. On the publisheddsbowl-unet, one fixed random 256x256 input:activation relu (what it was trained with) loaded, foreground share 0.1117 activation elu loaded without a word, 0.0303 activation tanh loaded without a word, 0.0439 max |probability difference| relu vs elu 0.9939The normalisation case needs nothing unusual:
PretrainedEncoderapplies it from buffers registeredpersistent=False, so they never reach the file, andpretrained: falseis the natural reload when the weights are your own and there is no network. Onresnet18’s deepest feature map that is a maximum difference of 1.25, relative 0.77, against 0.0 with the statistics restored.The fingerprint carries
activationandinput_normalisednow - the second named for the consequence rather than forpretrained, because at load time nobody cares where the weights started. And the skip that kept this silent is itself the thing to say out loud:_refuse_mismatchpasses over any field a sidecar does not carry, which is exactly what lets the five published names keep loading. So when a sidecar cannot answer and the model asks for something the default would not have given, the load warns and names the field. A model at the defaults stays silent, because that is what every published file was trained with.A sidecar that failed to download was indistinguishable from a repository that has none, and every check only a sidecar can make was then skipped.
pyplatypus#371.except Exception: return Nonesat besideexcept EntryNotFoundError: return None. The first case is the one the optional sidecar exists for; the second is a timeout or a 5xx on the JSON after the weights themselves arrived, andload_intothen skipped the colormap, the labels,n_classand the anchors’ provenance while the shapes still agreed. Measured with the JSON fetch raisingConnectionError: acolormapof[[9,9,9],[1,2,3]]loaded without a word, against a refusal namingcolormapwith the sidecar readable.A multi-frame DICOM file was read as one 2D image whose rows were the frames.
pyplatypus#372.pydicom gives a multi-frame single-sample file - enhanced CT or MR, a cine loop, tomosynthesis - as
(frames, rows, columns), and the channel logic took the last axis for channels. Four 8x8 frames of constant 1000, 2000, 3000 and 4000 came back as a(4, 8, 1)picture whose rows read 0, 21845, 43690 and 65535: the frame index had become the vertical axis and the columns were averaged away.NumberOfFrameswas in the header throughout. Refused by name now, from the header rather than from the array’s shape, pointing atread_dicom_series- the frames of such a file are a volume rather than the channels of a picture. Reading them ispyplatypus#374and needs the per-frame functional groups.A run record holding a NaN could not be read from R.
pyplatypus#373.json.dumpswrites the bare tokenNaNby extension; Python reads it back, which is why nothing here noticed, andjsonlite::fromJSONrefuses it outright. A history legitimately holds one -dicewithsmooth: 0on a class absent from the batch is 0/0, andterminate_on_nanwatches for exactly that - so the record of the one run anybody wants to inspect was the one R could not open. Non-finite values are written asnullnow, which reads asNAin R andNonein Python, withallow_nan=Falsebehind the walk so that any route it misses fails at write time instead of producing an unreadable file.
Changed
match_detectionsno longer citesvoc_evalfor a rule that is COCO’s.pyplatypus#369.The ordinary truth a detection is compared against is the best unclaimed one, so a duplicate of an already-claimed truth may claim the next one above the threshold instead.
voc_evaltakes the argmax over all of an image’s truths and counts that detection as a false positive. Against a transcription ofvoc_evalover 2,000 scenes whose predictions are jittered copies of the truths, the two differ in 38 with nothing marked difficult and in 26 with about 30% marked - and this module is the higher one in every single case, by 0.140 of AP on average and 0.333 at most.The rule stays, because
map_50_95is COCO’s metric and one convention should describe both halves of a report. What changes is that the docstring says which rule it is and how far it diverges, and a test holds the decision so that moving it to VOC’s rule fails by name rather than quietly shifting every score.
The R half
- Nothing beyond the pin. All six are defects an R user meets through the pin moving and by nothing else -
#373is the one R needed something from, and what it needed was for the engine to stop writing a token R’s parser rejects.
[0.8.0a62] - 2026-11-03
The reviewer’s seventh pass, which closed the remainder of what six passes had deferred. Three findings here, and two of them are about guards rather than about behaviour - one defect that a test named after its own rule could not see, and three links of #359’s thread that nothing held.
Fixed
A
difficulttruth was deleted before matching, so a detection of it was scored as a false positive - the opposite of the Pascal VOC rule the code’s own comment cited.pyplatypus#364.Measured, one image with two truths of one class, the second
difficult, both detected and the hard one ranked first:both detected, the difficult one first AP 0.500 1 false positive control: only the ordinary one predicted AP 1.000 0 false positives control: nothing marked difficult AP 1.000 0 false positivesSo a model that found the hard object scored below one that missed it, and the penalty landed at the top of the ranking, which is the costliest place on a precision-recall curve.
match_detectionsnow takesdifficult_boxes=and returns a fourth array,ignored. Three decisions in it rather than one: a difficult truth is never consumed, so every detection of one is set aside and not just the first; the best overlap decides and the flag is asked second, which isvoc_eval’s order, so a prediction fitting a difficult truth better than an ordinary one is set aside rather than scored; and a tie goes to the truth that scores, so a difficult object cannot absorb a detection that fits an ordinary one just as well.The reports carry the count rather than hiding the subtraction. A per-class row and a per-image row both gain
ignored,spuriousbecomesn_predicted - matched - ignored, and per-classprecisiondivides by what was judgedtrue_positives + false_positives- instead of byn_predicted, which the two now differ from. The R half is the pin plus the two columns, sincerplatypuspins the per-image column list exactly.
Why nothing caught it, which is worth more than the fix:
test_difficult_objects_are_left_out_as_pascal_voc_leaves_them_outexisted and could not fail on it. It predicted only the ordinary object, son_truth == 1and an average precision of 1 were true of the broken code and of a correct one alike. The fixture never contained a detection of the difficult object - in the test named after the rule.bccd-yolo3is unaffected: BCCD marks no objectdifficult, so the published card does not move.Two parts of
#357behaved other than the docstring said.pyplatypus#365.- A LabelMe
pointholds exactly one pair, and the point-count check ran before theshape_typedispatch - so the by-name refusal written for somebody who labelled a cell with the point tool could only ever be reached bypoints. The type is read first now. The test that had asserted the generic message for apointwas pinning the defect in place and is now the count check’s own test, on a type that bounds its points. - A circle against an edge gave a box reaching past the frame -
centre ± radiusis not clipped byread,drop_degenerateorencode, where a polygon’s points are inside by construction. A configured augmenter clipped it and an unaugmented run did not, so one annotation gave two different targets. The circle’s box is clipped to the annotated frame: centre (4, 50) with radius 10 reads[0, 40, 14, 60]rather than[-6, 40, 14, 60].
- A LabelMe
Tests
Three links of
#359’s thread had no test that could fail.pyplatypus#366. Mutating each link, identity control first, over the four files that cover the thread:T0 identity (the control) 95 passed T1 forward() ignores the boxes it was handed 2 failed T3 the dataset returns the UN-augmented boxes 95 passed T4 _normalised_boxes divides by (height, width) 95 passed T5 the collate reverses the batch's box lists 95 passedT3 is the costly one: the ignore mask would be built in a different frame from the image and the targets, which under a flip mirrors every truth away from the predictions - the mis-supervision
#359removed. T4 is invisible because every fixture in this package is square. T5 hands each image another image’s objects.The guards written for
#359sat atforwardand at the trainer, which is where the fix was read rather than where a later change can cut it. Three route-level tests now cover the rest: an augmented sample returns whatencodewas given, under a flip that moves it; a non-square input’s mask agrees with the targets’ route where every box is placed, with a transposed frame as the control; and the real collate keeps each image’s own boxes, with an epoch-level assertion beside it so the correspondence is not held only where it is implemented.Two measurements came out of writing them. At the default
ignore_thresholdof 0.5 the mask does not bite on either new fixture - all three arms agree at 2.48954487 - so both tests set 0.2, where the gap is 6.7e-02 and 7.4e-03 against tolerances of 1e-6 and 1e-4. And two colliding fixtures one pixel apart give the same answer whichever image’s boxes they get: the swap question is where the objects are, not whether one failed to be placed.One mutation of the twelve passed, and it was the mutation that was wrong. The batch’s “a difficult truth is consumed by the first hit” case set
absorbing[position] = -1.0, which zeroes the row of the prediction being handled and is followed immediately bycontinue- so it changed nothing. It asserted that the edit had landed, and the edit had: it simply did not say what it claimed. Consuming the truth is marking its column,absorbing[:, argmax] = -1.0, and expressed that way it failstest_a_difficult_truth_absorbs_every_detection_of_it_rather_than_one.So checked as applied is not expresses what it claims, which is one step past this project’s existing rule about a mutation that never applied. Twelve mutations, identity first on both file sets, and every one fails the test written for it.
Changed
GridParts.objects’ own comment still called the count clamped, which it has not been since#352removed theclamp(min=1). It now says what it holds and why the clamp protected nothing.
[0.8.0a61] - 2026-11-03
The reviewer’s sixth pass. Six findings, and the thread through them is a reader being told something the code does not do - two docstrings, a listing, a monitor set, an annotation format and a mask built from the wrong half of the truth.
Fixed
A LabelMe
circlebecame the box from its centre to one point on its rim.pyplatypus#357.read_labelmetook the bounding box of a shape’s points whatevershape_typesaid, and nothing in the engine read that field at all -grep -rn shape_type pyplatypusreturned nothing.LabelMe stores a circle as two points, the centre and a point on the circumference; its own
getCircleRectFromLinedrawscentre ± d. The extent of those two points has area|dx dy|against the true4d², so at most an eighth of the object - exactly an eighth at 45°, and zero when the rim point is level with the centre, wheredrop_degeneratethen removed the object andTargetSurveycounted it under the letterbox. Measured on a 200 x 200 frame: a circle at (100, 100) with its rim at (107, 106) read as[100, 100, 107, 106], area 42 of 340.shape_typeis read now. A circle iscentre ± radius, andpointandpoints- which mark a position rather than an extent - are refused by name rather than becoming zero-area boxes that vanish into adroppedcount. A file with noshape_typestill reads, because LabelMe’s own default ispolygon.A detection run accepted a callback watching
val_foreground, which it never reports, and died with a bareKeyErrorat the end of its first epoch.pyplatypus#358.terminate_on_collapse’s default monitor is exactly that.ClassificationModelhad overriddenmonitorablefor this reason one task earlier, in a docstring that names the symptom; detection was the third task and kept the base set.And the refusal misled in both directions: it offered
val_foreground, which never arrives, and hid the eight term figures that do.val_coordinates,val_objectness,val_no_objectandval_classesare watchable now, which is the half the crash concealed - a run whose coordinate loss falls while its objectness does not is a different failure from the reverse.The term list has one definition and three readers, in the specification layer because that is the layer that cannot import torch: the epoch writes them,
monitorableoffers them, and a third test holds the list itself toLossParts’ scalar fields. The pair over the first two cannot see a change to the list - both move together - which is why the third exists rather than a sentence in a docstring explaining the limit.The ignore mask was built from the truths the target could HOLD rather than from the image’s boxes.
pyplatypus#359.encodecannot place a box whose cell and slot an earlier one took - it counts that oneunplaced- so a prediction matching whatever did not fit was supervised towards zero objectness, which this module’s docstring calls teaching the model “to suppress correct answers”.The boxes travel with the batch now: the dataset returns them, the collate keeps them as a list because their count varies per image, the trainer forwards them and the loss uses them. The old route stays as a documented fallback for a caller holding targets alone.
And the window it bites in is narrower than the mechanism suggests, which is worth more than the fix. A collision needs both centres in one cell, so the two boxes are close - and if they are too close, a prediction of the one that did not fit overlaps the one that did and the mask covers it anyway. Over the offsets one 8-pixel cell allows, for two 18-pixel boxes:
offset 2 IoU 0.653 both routes ignore it offset 3 IoU 0.532 both routes ignore it offset 4 IoU 0.434 only the image's boxes ignore it offset 5 IoU 0.353 only the image's boxes ignore itA float32 TIFF label map was truncated rather than rounded.
pyplatypus#361.label_mappromises that “a 32-bit TIFF keeps the values it stores”, andconvert("I")truncates towards zero: a mask holding 0.9999 for class 1 read as 0, one class down, with every voxel still matching something and the mask check reporting 0.0 unmatched.labels_to_classescompares to within half a unit for exactly this and never got the chance."F"joins_STORED_VALUE_MODESand a float label map is rounded, which agrees with what the tolerance would have decided on every value either resolves.
Changed
diceandioudo not rank models identically, which three docstrings said they did.pyplatypus#360. The identityiou == dice / (2 - dice)holds for one coefficient; a report isper_class.mean(), andd / (2 - d)is convex, so two models whose per-class scores are spread differently can swap places. Over 121 predictions of one three-class fixture, 204 pairs rank the other way round - and the identity applied to a reported Dice of 0.6000 predicts 0.5000 where the metric reports 0.6000.The test that asserted the claim had two halves and neither was it: an elementwise identity, which is true and is a different statement, and twelve random tensors sorted by their means, which happened not to cross. It asserts the per-class identity and the possible disagreement now, so a change that really did make the two agree fails and gets read.
available_callbacks()said “the same set for either task” and listedterminate_on_collapsefor all four, while classification refuses it and detection crashed on it. Every task does accept every callback; what they may watch differs, and the listing says so and sends a reader to the model.
Added
- A test for the detector’s construction seed, which nothing held: removing
seedfrom the box pipeline’sComposeleft the whole suite green while removing the image pipeline’s failed.pyplatypus#362.#341gave segmentationtest_the_same_seed_gives_the_same_run_when_the_model_augments; detection’s twin configured no augmentation, which is#341’s own sentence one task over. Atnum_workers = 0- the engine’s default - the construction seed is the only thing that makes an augmented detection run repeat.
The R half
The pin, and one documentation fix. None of the six is a surface an R user calls, so they reach an R user through the pin moving and by nothing else - #357 above all, since a LabelMe dataset read from R goes through this reader. maju116/rplatypus#266 is separate and is R’s own: read_images(label_map = TRUE) on a volume returns rescaled values unless nearest = TRUE is passed too, which the engine documents and R’s @return does not.
[0.8.0a60] - 2026-11-03
The reviewer’s fifth pass. Three findings, and all three are places a FIX left a case behind - two of them 0.8.0a58’s and 0.8.0a59’s own.
Fixed
Every detection loader worker drew the same augmentation sequence, because
AlbumentationsBoxAugmenterhad noreseedfor the worker hook to call.pyplatypus#351.reseed_augmentation_in_workerasks withgetattr(augmenter, "reseed", None)and returns silently when there is none, so the hook0.8.0a58attached tomake_detection_loaderdid nothing - and its own docstring names exactly this as the thing it prevents.Measured on four identical images through the real
make_detection_loaderatbatch_size 1, so a difference between samples can only be the augmentation:0 workers: cfc3f34b 64642260 27dfd7dc 550d94f4 4 distinct (the control) 2 workers: 39af39b6 39af39b6 fabb8142 fabb8142 2 distinct, in lockstep pairsThe control that the hook itself was sound is the classification loader, whose augmenter does have the method: 12 distinct of 12 at two workers.
reseedis DECLARED on both protocols now, which is the part that outlives this release. The hook asks for a method by name, so an augmenter without one was never a type error - it was a run that quietly drew one sequence in every worker.AugmenterandBoxAugmenterboth name it, and the docstring says why it is declared rather than only implemented.And three tests where there was one: the detector’s lockstep, the detector’s reproducibility at one seed, and the classification half, which was never broken and was never asserted either - removing its hook left the whole suite green, exactly as the detector’s did. A working mechanism with no test is one release from the detector’s case.
A detection epoch’s reported loss depended on
batch_sizewhenever a grid was empty in some batch.pyplatypus#352.GridParts.objectsrecordedhas_object.sum().clamp(min=1), so a batch with no object at one scale contributed 0 to that grid’s numerator and 1 to its denominator.Measured through
fit()withlearning_rate = 1e-12, so the weights never move and both runs score the same model on the same two images, each occupying one scale:term batch_size 1 batch_size 2 ratio train_loss 7.99074 11.60114 1.4518 val_loss 6.58010 11.04327 1.6783The control, with a box at every scale in every image so no grid is ever empty: 16.46951 against 16.46593, which is 0.02% and says the clamp was the mechanism rather than the batching.
The clamp protected nothing and the file said as much two lines below.
countis a divisor only insideif has_object.any(), where the sum is at least 1 by construction; the sibling denominatorcellsalready recorded an honest zero, with a comment calling it “the honest denominator for a term that is also zero”. And the trainer was already written for it - its pooling skips a zero divisor and says why.Why nothing caught it is the part that transfers: the invariance test for this exact property existed, and the limitation was written into the test module’s own docstring and designed around -
three_sizesgives every image a box at every scale “so no grid is ever empty”. A limitation stated in a docstring is not a limitation that had to exist. The new test puts an empty grid in some batch and carries the control that the case is present, because without it the test passes on any fixture whose grids happen to be full.A palettised or bilevel mask read as a label map returned palette luminance or 0 and 255 rather than the file’s own values.
pyplatypus#353._LABEL_MODEwidened the conversion in0.8.0a59and these two modes are reinterpreted before any width is involved:convertexpands a palette first, and scales one bit per pixel to the full range.mode P stored 0, 1, 2, 15 -> read 0, 32, 64, 182 the palette's luminance mode 1 stored 0, 0, 1, 1 -> read 0, 0, 255, 255 the bit depth mode L, I, I;16 -> read exactly the controlsA mode-
Pmask with class indices is what Pascal VOC ships and what several annotation tools write;rplatypuscarries that palette asvoc_colormap. The bilevel case was not in the report - it came out of scanning the modes while scoping the fix, and it predates#346rather than arriving with it._STORED_VALUE_MODESnames the two and a label map is read from the raw pixels for them. Thecolormaproute is untouched and asserted per pixel: acolormapuser’s file is a picture of classes and the palette is how it says which is which.
The R half
The pin, and nothing else. All three are defects an R user meets through the pin moving and by nothing else - #351 above all, since platypus_fit(num_workers = "auto") resolves to min(4, cores - 1), so an augmented detector trained from R drew a quarter of the transforms it believed it drew. R’s read_masks(labels = ) already forwards label_map, so #353 reaches it with no R change. §1 records that distinction at 0.8.0a47.
[0.8.0a59] - 2026-11-02
The reviewer’s fourth pass: the four gates, then the data readers one floor below augmentation. Four findings, every one reproduced here before it was filed. The gates themselves found nothing - all four pass, and each was asked whether it passes for the wrong reason.
Fixed
A 16- or 32-bit label map was read through 8-bit greyscale, so every value above 255 arrived as 255.
pyplatypus#346._PIL_MODE[1]is"L"and the PIL branch converts before anything else, soconvert("L")flattened the values a label map stores - which are class identities rather than brightness. Thelabelsfield’s description says a single-channel PNG mask “can be read too” and mentions no bit depth;read_image’s docstring promises the file’s values “the way training would” read them.Measured, a 16-bit PNG holding 0, 255 and 1000:
read back [[0, 0], [255, 255], [255, 255]] the control, 16-bit of 0 to 7 [[0, 1, 2, 3], [4, 5, 6, 7]] unchanged a 32-bit TIFF of [0, 7, 70000] [0, 7, 255]So it is the clip and not the depth. The silent case is 255 as one label and a higher value as another: with
labels = [0, 255, 1000]the class index map reads[[0, 0], [1, 1], [1, 1]], class 2 never appears, andunmatchedis exactly 0.0 - the one number the mask check reads. The loud case is misdiagnosed rather than silent:labels = [0, 1, 2, 300]reports class 3 absent, so the refusal blames the specification for a value the file does hold on every row.read_imagetakeslabel_mapnow and reads such a file at full integer width, mode"I"andint32. The mask route alone passes it - three call sites underSegmentationDataset._read_masks- becauseto_floatdivides an ordinary picture by 255 and a one-channel image read this way would stop being normalised. A label map asked for with more than one channel is refused by name: a mask with several channels is a picture with a colormap.Not affected, and checked: the instance path thresholds each object file at
> 0,read_volumenever went through an 8-bit conversion, and an 8-bit mask saved as grey RGB reads the same values either way.Two CSV rows with one
keywere merged into one case.pyplatypus#347.keynames the case and every per-case figure is pooled by it, and nothing in discovery checked that the keys were distinct. Measured, four different images undercaseA, caseA, case2, case3:discover_samples() 4 samples, keys caseA caseA case2 case3 evaluate_cases(split="validation") 3 rows: caseA, case2, case3 the control, four distinct keys 4 rowsOn R’s side
predict(each = )stores results by name in one environment, so the second row’s value is read back for both.The package already names this failure one route over:
_class_dirsmakes its keyclass/filenamebecause “a duplicate key would make two different images one case”. The CSV route had no such guard and has one now, naming the repeated keys.Refused rather than made to work, because the thing it looks like a request for already exists and says so in its own output:
evaluate_cases(group_by = )pools by a pattern read against the case name and labels the rowsgroupinstead ofcase. A repeated key gives the pooling with nothing to say it happened - andgroup_bycannot recover those two images either, since by then they are one name. Nothing relies on it: no CSV in either repository repeats a key,write_splitswrites the sample key, and_nested_dirstakes a directory name. Splitting was never affected -stratified_splitappends, so no sample was lost.Two docstrings described the state before a fix landed.
pyplatypus#349.onehot_to_foregroundtold a reader that nothing forbidslabels: [1, 2]and that the wart was “filed asmaju116/platypus#153”;fitrefuses that combination by name - “labels=[1, 2] does not contain 0, and 76.6% of the training masks’ voxels match none of those labels” - andrplatypus#153closed on that refusal.discover_labellednarrated a build that has finished:ClassificationData.labels_fromexists, and so does the validator a comment beside it still said was owed.
Added
A test that two loader workers do not draw the same augmentations.
pyplatypus#348.reseed_augmentation_in_workerarrived with0.8.0a58and nothing held it: the whole suite passed withworker_init_fnset toNonein all three loaders and withreseed()’s body replaced bypass. The four tests written for#341all run atnum_workers = 0, where a worker function is never called, and the one test in the suite that does use workers asserts only that the run finishes.Measured, four identical images at
num_workers = 2with a rotation that always fires: as shipped the four outputs are all different, and with the hook removed they arrive in two identical pairs -a11023b3, a11023b3, afc146b6, afc146b6- because the loader hands alternating indices to the two workers and each draws from the same inherited state.Two assertions rather than one, because divergence alone would pass on workers seeded from the clock: the workers differ from each other, and two runs of the two-worker loader still agree. The single-worker reading is the control that the rotation is what varies them. §4’s fixture that never contained the case, in the file written to cover this case.
The R half
read_masks(labels = ) is the one surface this reaches, and it is rplatypus#262: it crosses to the same reader through the shim with channels = 1 and no label_map, so an R user reading a 16-bit label map gets the clip. That is a change in R’s own code rather than in the pin alone, so the pin and the shim move together. #347’s refusal reaches R through the pin and by nothing else - R sends the specification and the engine does the discovery - and #348 and #349 need nothing.
[0.8.0a58] - 2026-11-02
The reviewer’s third pass. Four findings, and the first of them is the one promise this package makes about reproducibility.
Fixed
seedpromised that a run’s augmentation was repeatable and nothing seeded the augmentation pipeline.pyplatypus#341. albumentations draws from its own generator;seed_everythingseedsrandom,numpyandtorchand reaches none of it. Worse,build_augmenter- the route all three non-detection tasks take - had noseedparameter at all, so there was nowhere for a run’s seed to go. Two runs at one seed differed whenever a model augmented,deterministic: trueincluded.The
seedfield’s own description promises “the order the data arrives in and its augmentation - including inside the loader’s worker processes”, and R repeats it on?platypus_spec.The package also contradicted itself about this, which is what made it read as a decision rather than a defect:
build_box_augmenter’s docstring saidseedwas “for tests” and deliberately not a spec field, because “pinning the augmentation sequence would make every epoch see the same distortions”.That reason is measured false. One pipeline at seed 1, applied three times, gives three different results - and the same three in a fresh process:
seed=1 95ed59e7c7 f16089dd1e 1c24a3c313 three calls, all different seed=1 95ed59e7c7 f16089dd1e 1c24a3c313 identical to the run above seed=2 af79192b21 f7b808b724 15df46034b a different seed, a different draw none 707759f0f8 a73523140a 6648afe5fa the control: unseeded none bd45f30f4b f5f8cf784f e3dca9522a and again, differentA seed fixes where the sequence starts, not what it is. Repeatable across runs and varied across epochs are not alternatives, so the docstring is rewritten and the pipeline is seeded from the run.
And the worker half, which seeding the parent does not fix. A loader worker is forked with a copy of the pipeline’s generator state, so every worker drew the same sequence: reproducible, and quietly a quarter of the variety on four workers. All three loaders now carry
reseed_augmentation_in_worker, which reseeds fromtorch.initial_seed()- already derived from the run’s seed and distinct per worker.tests/test_seeding.pyis where this is now asserted, and why it could not fail before is that none of its configurations augmented anything.boundary(region = lovasz)was accepted on overlapping classes wherelovaszalone is refused, and it trained.pyplatypus#342.supports_multilabelis aClassVar, so it is a claim about a loss family and cannot see what an instance wraps:boundarywraps aRegionLossSpec, andlovaszis a member of that union.build_loss’s own docstring already said the hazard - “multilabeltravels into nested losses too … would be wrong in a way that still trains” - and the flag travelled in while the question did not travel with it.multilabel_capablewalks the nested term, in the specification layer because that is the layer the validator runs in and it must not import torch;loss_supports_multilabeldelegates to it rather than keeping a second copy. The refusal names the term now -boundary(region=lovasz)- because naming the wrapper sends a reader to the wrong place, and the list of alternatives it offers includesboundary.A
whencondition on aval_quantity was accepted undervalidation: false, and the run died with a bareKeyErrorat the end of its first epoch.pyplatypus#343. The rule readmonitorand nothing else, while its siblingcallbacks_watch_something_that_existsalready carries the sentence that settles it: “A condition is a watch with a threshold on it, so it answers to the same rule.” One message now lists both, so a reader does not learn the rule twice.The missing-class refusal quoted the unmatched-voxel share for namings where the package itself calls that figure meaningless.
pyplatypus#344. Twenty lines below, the warning reporting the same number is skipped whenmultilabel, with the reason written out: those namings have no background entry, so the fraction sits near 1 on any dataset where the thing being found is small. On a fixture whose only fault was an empty channel the refusal read “75.0% of their voxels matched no entry” - the background, presented as a symptom. Left out for those namings, kept for the rest.
Added
SegmentationData.class_names, one short label per class in channel order: a region’s name, aclasses_frompattern, and the index forlabelsandcolormap, where the number is the class.It exists because
maju116/rplatypus#259asked R to name a class “the way the engine does”, and the engine’s way isEngine._describe_classes- which writes a sentence for a refusal: “region ‘absent’ (of [9])”. Reading well in a message and badly in a column are not the same job, and the two were conflated: forwarding the sentence turned five ofrplatypus’s own assertions from"one, both"into"region 'one' (of [1]), region 'both' (of [1, 2])". That measurement is what told them apart.So there are two surfaces with two jobs, and R forwards to this one. It lives here rather than in R because R held a copy that covered
regionsalone, numbered the other three namings, and claimed in its own documentation to mirror the engine - §3A’s rule decides the rest: the engine’s name wins.
The R half
The pin moves, and this time R needs something from the release rather than only through it: class_names is a surface R forwards to. The four fixes above are defects an R user meets through the pin moving and by nothing else - #341 above all, since ?platypus_spec carries the same promise. §1 records that distinction at 0.8.0a47.
[0.8.0a57] - 2026-10-29
Four findings from the reviewer’s second pass, and three of them are places the code argued against itself. Every one was reproduced before it was filed and the numbers below are from that reproduction rather than from the report.
Fixed
The epoch loop asked
any(callback.on_epoch_end(state) for callback in self.callbacks), andany()over a generator short-circuits, so every callback listed after the first one that wanted to stop never saw the epoch the run stopped on. The same line sat in all three trainers.pyplatypus#334.Measured: a
csv_loggerwritten after a stopper wrote 1 row for a 2-epoch run, where the reversed order wrote 2. Worse, because the schema recommends the pairing in as many words -stop_after’s description says to pair it withearly_stopping’srestore_best“if what the run produced matters” -[stop_after, early_stopping]restored epoch 2 on a run whose monitored losses were 0.81197, 0.75427 and 0.71723, so the best epoch was the one the short-circuit hid. Written the other way round it kept epoch 3.There is one definition now,
ask_to_stop, with the three trainers as its callers, for the reasonlabels_in_test_splithas the same shape: a row saying one function, four callers is worth more than three saying these two agree.early_stopping’srestore_bestandemaboth replace the model’s weights when training ends, and the trainer called them in list order, so which weights a run handed back was decided by where they happened to sit.restore_bestdefaults toTrue, so anyearly_stoppingwritten without arguments beside anemawas one of the two cases.pyplatypus#333.Measured on one run with nothing but the order changed, as the largest absolute weight difference from the model’s final state:
[ema, early_stopping] |final - ema| = 0.578 |final - best| = 0 ema_steps = 8 [early_stopping, ema] |final - ema| = 0 |final - best| = 0.578 ema_steps = 8And the record said
ema_steps = 8either way, so a run that asked for EMA, got the raw best epoch, and wrote a weights sidecar reported that it had averaged 8 steps.The averager wins, and that is now stated rather than inherited from a list.
ModelSpec.one_averageralready refusesemabesideswaon exactly this argument;restore_bestis the third replacer and refusing it was the wrong shape, because its default isTrueand a refusal would reject configurations nobody knowingly wrote. The rule lives infinish_trainingrather than inbuild_callbacks, which is the correction the test for it forced: ordering at build time leaves a caller who hands aTrainerits owncallbacks=list exactly where this issue found it.swaresolved itsstartfraction withround()while every other callback usesfirst_epoch, which usesint()- and Python’sroundis half-to-even, so the two disagreed by an epoch whenevertotal * startlanded on a half with an odd integer part.pyplatypus#335.(10, 0.75)gave 8 under the shared rule and 9 underswa’s own;(11, 0.5)gave 6 against 7,(6, 0.25)2 against 3, while(12, 0.75),(14, 0.75)and(8, 0.5)agreed. The schema says ofswa.start_epochthat “it is the same conceptearly_stoppingnames with these two words”, so there is one rule andswanow reads it.The letterbox pasted the image at a rounded offset while
forwardadded the exact one, so every letterboxed image and its boxes disagreed by up to a pixel.pyplatypus#336, and the class’s own docstring argues against precisely this: the transform is stored because “deriving it again from the shapes is how a rounding difference becomes a box half a pixel out”, and thenapply_to_imagederived it again.Measured on
Letterbox.fit((300, 417), (416, 416))with a filled square at source rows 200-299: the paste put it at rows 257-356 andforwardput its box at 257.88-357.64.Two disagreements rather than one, and both are gone by the transform naming what the pixel grid actually did.
fitrounds the inner size once and stores it asinner_shape; the offsets are whole pixels taken from it; andforwardmultiplies byinner / sourceper axis - the scale the image really underwent - rather than by the factor that chose it.scalestays, as the aspect-preserving factor that picked the inner size, andaxis_scalesis what the boxes follow. The invariant that holds now and did not before: the source image’s own bounding box, pushed throughforward, is exactly the rectangleapply_to_imagefills.
The R half
The pin moves. None of these four is a surface an R user calls, and all four are defects an R user meets through the pin moving and by nothing else - R forwards callbacks in the order the user wrote them, so #333 and #334 reach an R user exactly as they reach anybody else. §1 records that distinction at 0.8.0a47 and a48: None beyond the pin is not R needs nothing, and §3E’s “leave the pin alone” is written for the second.
[0.8.0a56] - 2026-10-29
A regression 0.8.0a55 shipped, found by the other package. Recorded that way rather than folded into a55’s entry, because a55 is on PyPI and somebody could be using it: an agreement figure drawn over a label map with a gap in its numbering coloured the wrong objects.
Fixed
overlay_instance_agreementturned a row of the IoU matrix back into an object number withrow + 1, which was correct for as long as every map numbered its objects consecutively.0.8.0a55madeiou_matrix’s rows the object numbers present, so on a gapped map that line marked the wrong objects matched: with truth and prediction both holding objects 1 and 4, every object matches and the figure drew one as a hit and one as a miss.What caught it is
rplatypus’s drawing pair, which compares R’s overlay with this one pixel for pixel and carries a fixture namedgapped- whose own comment says that takingseq_len(max(labels))instead of the values present changes nothing, which was true of R and had just stopped being true here. That is §3F working in the direction it was built for, and it means this suite was blind to it: there was no engine test that could fail. There is one now.The object-number rule has one definition rather than two.
object_labelsis exported frompyplatypus.instances,iou_matrixindexes by it and the overlay maps back through it. The alternative - computingnp.unique(...)again insideplots.py- is the second copy §3F is a list of, and this defect is what a second copy costs when only one of them moves.
[0.8.0a55] - 2026-10-29
The review agent’s first audit, engine half. Six of its nine findings are here; each was reproduced independently before being filed, and the reproduction is in the issue rather than taken from the report. maju116/pyplatypus#325, #326, #327, #328, #329, #330 and the engine half of maju116/rplatypus#247.
The R half: the pin, and it has to move. rplatypus#247 is a defect an R user meets through evaluate(fit, at = "source") - a route ?evaluate calls “the answer to that warning” - and the fix reaches them by the pin moving and by nothing else. That is the distinction 0.8.0a47 and a48 are recorded for, not §3E’s leave the pin alone. R’s two remaining findings are its own and need nothing from here.
Fixed
evaluate(at="source")andevaluate_cases(at="source")raised forcldiceandsurface_dice, the two metrics that path exists to give physical units to - and the message named neither the metric norat._score_at_sourceappliedfloat()tometric.coefficient(hard, truth)[0], which is a per-class vector, so it raised for every run with more than one channel. Measured on four 64x64 cases:[dice]returns a number on both grids,[dice, cldice]returnedValueError: only one element tensors can be converted to Python scalarsfrom bothevaluateandevaluate_cases, and thedice-only row is the control that the path works at all.A
.mean()would have been the wrong repair. The model-grid path keeps the vector, averages over the group’s images and then callsreduce- which is whereinclude_background=Falsedrops the background and whereClDicerefuses aNaNfrom a skeleton it could not peel. Both steps were skipped here, so the source path was a third copy of a rule_score_at_source’s own docstring says “must not exist in several versions”. It is the same two steps in the same order asTrainer.score_casesnow.No test configured a whole-mask metric at source, which is why nothing saw it: both files that test this path use
dice, anddiceaccumulates, so the branch was unreached. The test added computes the figure frompredict_streamand the metric object by hand, with two controls - that the per-class vector has more than one element, and thatreducedisagrees with a plain mean on this fixture.iou_matrixcounted object numbers rather than objects, so a number missing from a label map became an object of zero area, matched nothing, and was counted as a false negative or a false positive. Measured on two 3x3 objects in a 10x10 map:identical maps, consecutive numbering AP 1.0 (control) the same two objects numbered 1 and 4 AP 0.5 truth gapped, prediction consecutive AP 0.5 BOTH sides gapped the same way AP 0.3333The last row is the one that makes it worth finding: a prediction identical to the truth scored one third, because each side’s phantom object was a false negative and a false positive at once. All four read 1.0 now and the matrix is 2x2 rather than 2x4.
The engine held the wrong copy of a rule this project already had right twice.
measure.instance_sizesdocuments “a model that found objects 1, 2 and 4 found three objects”, andrplatypus’s own matcher takessort(unique(...))of each side - run on the same maps it matches 2 of 2 where the engine scored 0.333. That is the second time the engine was the wrong copy, aftercrops()’s docstring against?detection_crops, and the first time it was code rather than prose.It is not only a hazard for maps from other tools:
instances_from_partsproduces a gap at its own default, because a seed outside the foreground loses every pixel and_drop_smallrenumbers only whenminimum_area > 0.
Changed
summarise_instancesno longer promises apooled_average_precision, in either of the two places that promised one - its own docstring and the module’s, which said it “reports both and names which is the challenge’s”. It returns seven keys and none is pooled, and the figure cannot be computed from what the function is given:score_caseshands it onematched_at_<lowest>key and a pooled average precision needs the counts at every threshold. The promise is removed rather than honoured, because the pooled figure is a feature with a public return shape to change and is explicitly not the leaderboard’s number. The argument that the two quantities differ stays, because that is the sentence worth having.foreground_dice’s per-image argument no longer rests on a pooling rule that was fixed. It said the training metric pools over batches with each weighed equally and quoted 0.0088;Trainer._run_epochhas weighted by examples sincemaju116/rplatypus#196, with a test holding it there. So the number is gone rather than re-measured - §3C says a number in prose needs a test holding it or no number - and the reason that is still true is what is left.Both accuracy figures for the ellipse circumference were wrong, in opposite directions.
pi * (a + b)is wrong by 0.51% at an axis ratio of 0.75 and 0.77% at 0.7, not 1.5% - that belongs to 0.6 - and Ramanujan’s second approximation is right to 8e-14 at 0.75, where the docstring claimed1e-7and so understated it by five orders of magnitude. All three figures are now held toscipy.special.ellipe, with the circle as the control because both formulas are exact there.tests/test_measure.py’s own docstring named 0.7 and 1.5% while its assertion is met by the 150x75 case at a ratio of 0.5, and says so now.stratified_split’s closed form belongs to the table above it. It read “0.5120 where the simulation said 51.18%”; the table says 70/15/15, and 0.5120 is exactly0.8^3- a part of share 0.2. The nearest figure in the file is the 51.25% of the multi-label table 180 lines above, a different algorithm answering a different question, which is §4’s number measured in one setting and quoted in another. The sentence now gives0.85^3 = 0.6141for a 15% part and 0.9055 against the 0.9125 the table measured - half a standard error at 400 seeds - and a test holds all of it.The instance summary’s
medianandmatched_at_<lowest>have tests that can fail. Both were reported and nothing read them:np.mediancould becomenp.meanandmatched_at_0.5could becomematched_at_0.95with 110 tests green, and the second mutation moves only the key’s name. The median is asserted on three cases where it differs from the mean, which took a correction - the first version used two cases at 1.0 and 0.0, where the median is the mean, and its own control caught that.
[0.8.0a54] - 2026-10-29
Documentation only, and the pair rather than the prose is the reason it is a release. The configuration guide gains Predicting on images you have no labels for, which is the other half of maju116/rplatypus#246 - the guide is one document in two repositories and both sides carry the same sections, so a subsection written on one side alone is the drift §3F of the workbench’s notes is a list of.
The R half: done already, and that is why this release exists at all. 0.8.0a52 shipped the capability and deliberately did not document it here, because written on the engine’s side alone it would have described, in the shared guide, something an R reader could not do until the pin moved. The pin moved in rplatypus#246, so this half is now writable - which makes the ordering the point rather than an accident: the guide’s two halves are written in the order the capability becomes true, not in the order the code lands.
Dated 2026-10-29 while the work and the pull request are 2026-10-28’s, which is the first entry here to straddle a day. Both places were corrected rather than left: the heading and CITATION.cff’s date-released are the release’s, matching the tag, as a51 through a53 all do.
And this is the one case test_the_citation_carries_the_date_the_changelog_gives_that_version says out loud that it cannot catch. That test holds date-released to the changelog heading rather than to a clock, and its own docstring states the limit: “It cannot catch both being wrong together, which is the limit worth stating rather than papering over with date.today() - that would fail every time the suite is run on a day that is not release day.” Both were 2026-10-28 and agreed with each other, so the suite was green on a release that would have been a day early in the one field a citation is for. The limit is still the right trade - a clock in that test breaks every ordinary run - and what closes it is the release loop reading the date when the tag is cut, which is what happened here.
A release with no code in it, which has two precedents here. 0.7.0a3 was documentation only and 0.8.0a9 a README section on this package’s own page. The wheel is behaviourally identical to a53’s; what reaches a reader arrives through the docs job on merge rather than through PyPI, and the version exists so that the entry below has somewhere to live.
Changed
guide.qmdgains### Predicting on images you have no labels for, under One label instead of a mask, with a validated YAML block and the three refusals named:predict()andpredict_labels()work,evaluate()refuses by name, andbalance()refuses for the same reason. It says what the truth column carries -label: None, andlabels: Nonerather than[], because an empty list there means this image carries none of the findings - and it names the one layout that cannot express an unlabelled split at all, sincenested_dirsmakes the directory the label.A
###rather than a##is deliberate and measured: both suites pin only^## (.+)$, so a subsection needs no merge ordering between the two repositories and the pair’s own test has nothing to say about it. The##sections are unchanged on both sides.And a documentation-only release moved the test count, which is worth knowing before anybody reads that as a contradiction. The suite went 2686 to 2691 with no test written, because the guide’s tests are parametrised over the guide’s own content: collected before and after, the YAML block added two cases, two existing blocks were renumbered - the parameter ids carry line numbers, so inserting prose above a block renames its test - and three names this subsection offers a reader are each checked to resolve:
answers,balanceandpredict_labels, none of which any guide prose had named before. All three resolve. So the prose added here is held to this package’s surface by the same instrumentspec_schema()’s descriptions are, which is the strongest reason to write a guide section as prose naming functions rather than as description.
[0.8.0a53] - 2026-10-28
A method that asks what the model said was handed the loader built for optimising over. maju116/pyplatypus#321.
The R half: none beyond the pin - and that is not R needs nothing. This is a defect an R user meets, through predict(fit, split = "train") and evaluate(fit, "train"), and the fix reaches them by the pin moving and by nothing else. §1 records 0.8.0a47 and a48 as the two releases that taught this distinction, and §3E read literally would say to leave the pin alone on all three. The pin is moving anyway for maju116/rplatypus#245, so one move carries both - the ratchet rather than two R releases.
Fixed
predict(split="train")came back in the training loader’s shuffled order, soanswers()paired every key with another image’s probabilities.loader()derived bothshuffleanddrop_lastfromsplit == "train", which is right for the pass that optimises and wrong for every method that asks a question - andpredict’s own docstring promises “in the split’s own order”.Measured: two
predict(split="train")calls on one split are a permutation of each other - the same multiset of rows, not one row in place - and at 16 samples withbatch_size: 8nothing is dropped, so no count disagreed and nothing refused.answers()then reportedlabel == predictedon 8 of 16 training images, which is chance on two classes.drop_lastis the same defect reading as a score rather than as rows:evaluate("train")scored only the images that fit a whole batch and reported the number as that split’s, andanswers("train")on a ragged count ended inValueError: zip() argument 2 is shorterthree layers from the cause.Both flags are the caller’s now, defaulting to ordered and complete, and
fitis the only caller that asks for either. That is not a new parameter: the three other engines already takeshufflefrom the caller and every asking site in them passesFalse, so this is one question answered four times with the odd one out being the bug - the same shape_has_any_labelshad in0.8.0a52, one release earlier.The two flags stay separate rather than travelling under one name, measured rather than tidy:
drop_lastwas independent ofdata.shuffle, so keying it to shuffling would stop dropping the ragged last batch for anybody runningshuffle: false- and a last batch of one is a batch-norm with nothing to normalise over, which is the whole reason the flag exists here. Thelen(base) > batch_sizeguard stays insideloader(): a split smaller than one batch would otherwise be emptied by the flagfitalways passes.
Changed
The test that pinned the old behaviour was named for two properties and asserted one.
test_the_loader_shuffles_training_only_and_drops_a_lone_last_batchcheckeddrop_lastand said nothing about shuffling, which is whypredictcould come back in it. It is replaced by one that asserts the asking defaults, the capabilityfitasks for, and the inner guard at its boundary - eight samples against a batch of eight, where dropping would leave nothing.And moving a decision to a caller needs the caller pinned: a mutation making
fitpassshuffle=Falseleft all 29 other tests in this file green. Training a classifier on batches that are each one class is a real degradation and no number in this suite would have moved. Sofit’s own request is recorded offloaderand asserted, withshuffle: falsein the data block as the control that the value is read from the specification rather than hard-coded. Five mutations, five caught.
[0.8.0a52] - 2026-10-28
The one task whose whole output is a label per image was the only one that could not predict on unlabelled images. maju116/pyplatypus#320.
The R half: one thing, owed rather than built - maju116/rplatypus#245. On the single-label route R is already right: predict()’s comment says “label is NA on a split that carries no labelling, which is what a test set often is”, and measured against rows_to_frame, a None from the engine does come back as NA. That sentence described a state R could not reach until this release, and it is true now rather than aspirational. The long form a set of labels comes back in is the half that is wrong: label is classes %in% as.character(unlist(row$labels)), which for nobody said is FALSE FALSE FALSE - the same three rows a film carrying none of the findings produces. The comment directly above it claims long form is “the only shape in which ‘this image has none of the findings’ is four rows of FALSE rather than an empty cell that could also mean unread”, so the property that prose rests on is the one that stops holding here. The pin moves with that fix, because R cannot reach this state against an older engine.
Fixed
A classification test set of images alone was refused, where every other task in this package accepts one.
ClassificationEngine._has_any_labels()returnedTrueunconditionally while its own docstring described the distinction it was not making - “innested_dirsmode the label is the directory … a CSV may name no label column at all” - so_discover_test’s fallback was unreachable and akey, imagesCSV astest_pathdied in the labelled read. Three legs, measured: the labelled read refuses withneeds a 'label' column; the same file readonly_images=Trueis accepted at four samples; and_has_any_labels()answeringTrueis the only reason leg 2 was never reached. The reader could already do it and nothing asked.It answers now:
Trueinnested_dirsmode, because the directory is the label and there is no unlabelled form of that layout to fall back to; otherwise whether the test CSV’s header names the column a label would be read from. For a set of labels that islabels_from’s columns rather thanlabel, and the answer is whether the header names any of them -_discover_testis built on none and some being different things, so a file naming two of three classes still refuses by naming the third instead of quietly becoming an unlabelled split and reporting nothing about the two that are there.Two guards that could not fire became reachable, and both were wrong in the state they had never been in. This is the honest cost of the fix rather than scope:
#320is closed by one method, and making a state reachable is what obliges the code that meets it.balance()on an unlabelled split counted it anyway and reported every class at zero, withneverlisting all of them andlabels_are_a_setreadingFalsewhatever the specification said - three readings that look like findings about a dataset and are findings about there being no labels. §4’s a zero in a table is read as a result. It refuses by name now, in its own sentence rather than_needs_labels’s: that one says there is nothing to score against and is about asking a model for a number, and this is a question about the data with no model in it.answers()reportedlabels: []for an image nobody had labelled, which is exactly how it reports an image carrying none of the findings - a labelled row, and the commonest one in every dataset this reads, as the reader’s own comment says.Nonenow, which is the marker the reader already uses and what the single-label branch has always said.
Changed
One reader for the header question, and the claim that said there could not be one was false.
labels_in_test_split’s docstring said detection “answers this differently and must not be changed on the way past”; detection’s own_has_any_labelswas that function’s body verbatim, modulo onereturn Falsefolded into splitting an empty string. What differs between the tasks islabel_columnandsubdirs, both derived per task, which is what lets one function serve all of them - and classification would have been a fourth copy. All four engines call it now,columnssays which CSV columns to ask about, and the one genuine difference is classification’s and happens before the call.Measured rather than asserted, by mutating each branch and running each task’s suite separately - and the table is the finding, not the convergence:
nested-dirs branch -> always labelled CAUGHT by detection, segmentation uncaught by instance, classification CSV branch -> never labelled CAUGHT by classification onlySo detection does depend on the shared function, which is what the convergence needed to show. And the CSV half of this question had no test in any suite before this release: the two tasks that read a CSV test split never exercise it, so detection’s own copy of that branch was untested code for its whole life. The tests added here are the first.
tests/test_engine_base.py’s structural columns are four -classificationarrived in0.8.0a49and that file never grew a column for it, and the question it would have been asked there is the one whose answer wasreturn True. Its behavioural columns are still three and are recorded in the file as owed: they need a built engine with its own layout and a_needs_*wrapper this engine does not have.No guide section, which is a decision rather than an omission. Neither guide says a test split must be labelled for any task, so §3C’s a change to how a run is written is not triggered - nothing about the configuration format changed, a CSV simply has one column fewer. The subsection worth writing is predicting on a folder of images you have no labels for, and it belongs on both sides at once; written here alone it would document, in the shared guide, a capability an R reader cannot use until the pin moves. So it is a task on
maju116/rplatypus#245rather than a section here.One defect found while writing these tests and filed rather than fixed -
maju116/pyplatypus#321. The control for an unlabelled split needed a labelled one beside it, andanswers(split="train")was the obvious place to get it: it comes back in the training loader’s shuffled order, so each key is paired with another image’s probabilities. Twopredict("train")calls on one split are a permutation of each other, and at 16 samples withbatch_size: 8nothing is dropped, so nothing refuses. It has nothing to do with labels being absent, so it is not repaired here - the test’s control reads thevalidationsplit instead, and says why.
[0.8.0a51] - 2026-10-28
Two defects found by reading the task that had just shipped, and one new instrument. maju116/pyplatypus#316 and #312.
The R half: none, and the pin does not have to move for it - which is a stronger claim than None beyond the pin, and the distinction is one 0.8.0a47 and a48 are recorded here for not having: those two were defects whose fix reached an R user by the pin moving and by nothing else. Neither of these does. write_splits is not exported from R, and classification_data() refuses a split_dataset() by name before any interpreter starts, so the branch repaired below is unreachable from that side; and ?detection_crops already documented all seven keys correctly - see the second item.
Fixed
write_splits()wrotesample.maskswhatever the task, so a classification split written to CSV lost its labelling entirely: thelabelcolumn was renamed and its cells were the masks a classification sample does not have. Measured on 6 images in two classes - six empty cells - and the file then refused at the reader, one run later, withno label nameon every row andyielded no usable samples. That message is a sentence about the dataset, so the first place anybody looks is the data, and the data is fine.What the label column holds is read off the samples now, the way
stratified_splitalready dispatches: onemaskscolumn of paths, onelabelcolumn of names, or one column per class holding0or1. Samples that disagree are refused - one CSV has one header.A set of labels takes
classes, and is refused without them rather than taking the union of what the split happens to carry: a class no image in that part has would simply have no column, and the file would then describe a narrower problem than the one being studied. Same argument and same parameter name assave_class_masks.label_columnnow defaults toNone, which takes the name from what the samples carry. The mask layout is byte-for-byte what it was, and a test asserts that rather than trusting it.The test that would have caught it already existed and was written over masks.
test_written_csvs_are_readable_by_the_config_file_modewrites a split and reads it back, which is exactly the right shape, for the one label kind the writer handled. The round trip is now asserted for a name and for a set as well - and asserted as a round trip, because a test demanding a non-empty cell passes on a writer that puts the key there.crops()’s docstring carried twoArgs:blocks and twoReturns:blocks, and neither pair agreed with itself: oneReturns:omitteddropped, the other omittedscores,labelsandnames, and the secondArgs:droppedscore_threshold- the one parameter the prose two paragraphs above it is about. The published reference rendered both, so whichever a reader believed, they were wrong about the function’s answer.?detection_cropsinrplatypuswas right the whole time, naming all seven keys and all seven parameters. This project’s cross-package pairs are built on the assumption that the engine’s text is the source and R’s hand-written copy is what drifts; here it was the other way round, and nothing was looking in that direction.
Added
- A test over every docstring in the package: no section header twice. 749 docstrings on this commit, by AST rather than by import, so module and class docstrings and the two engines outside
__all__are all in it. Nothing in this repository read a docstring’s shape -quartodoc buildrenders a duplicate without complaining and thedocsjob was green throughout - and the duplicate also blinded the one test that readsArgs:, which takes the first block and stops, so a parameter invented in a second block was invisible to the guard written for exactly that. It carries both controls: a synthetic duplicate it must report, and prose of the formArgs: the four belowit must not.
[0.8.0a50] - 2026-10-28
A label that is a set - labels_from, one CSV column per class, and the four slices behind it. maju116/pyplatypus#307, part of #206.
Added
labels_fromon a classification data block: one column per class, in class order, each cell0or1. A chest film with four findings is four independent questions rather than one of four alternatives, and this is the only way of saying so.It is a naming rather than a switch, and that is the decision this release rests on. The author’s question was whether multi-class could be made multi-label by a parameter - softmax to sigmoid - and the answer is no for the reason the mask side already paid for: the target changes, not only the activation. A
labelcolumn structurally cannot say that a film has two findings, soactivation: sigmoidover an exclusive target would train sigmoid channels against a one-hot, raise nothing, and report plausible numbers meaning exactly what softmax meant.regionsandclasses_fromare the same shape one task over, which is whyClassificationData.multilabelis a derived property and everything downstream reads it rather than a new flag.config_filemode only, which is a refusal rather than a gap: an image cannot sit in two directories without being two files. The position inlabels_fromis the class index, paired withclasses, so the headers may be whatever the dataset calls them - read off the header row the order would be alphabetical, reproducible and clinically meaningless.A cell that is not
0,1,0.0or1.0is refused by name, and the case it is written for is-1. The datasets shaped this way write-1for uncertain and leave the cell empty for not mentioned; both have a defensible mapping to 0 or to 1, which is exactly why the reader must not pick one. An image with none of the findings is an ordinary labelled row.Three metrics for a set of labels, and
accuracyis refused rather than redefined.MultiLabelMetricholds a two-by-two table per class - a confusion matrix answers which one of these was it and with independent questions there is no such quantity. Measured on 4000 images with findings at 10%, 5%, 3% and 2%, one draw of the truth, models degraded by noise rather than shrunk:quality exact per-class balanced macro f1 macro auc 1.00 0.8353 0.9570 0.5742 0.2339 0.9029 0.50 0.8023 0.9477 0.5433 0.1444 0.8041 0.00 0.7650 0.9370 0.4984 0.0184 0.4834 all-negative 0.8137 0.9507 0.5000 0.0000 0.5000The disqualifying reading is the row’s position rather than the size of a gap. A model answering no to everything scores above the model holding half the available signal on both readings of accuracy, while
balanced_accuracy,f1andaucall put it below every model with any signal at all. A number that rewards giving up cannot be what amonitorwatches. This is a different mechanism from the single-label finding of0.8.0a49, where accuracy is nearly flat and non-monotone: here both readings are monotone in quality on two seeds, and what breaks them is the comparison against a collapse, which is not a point on that curve.aucstays the default and crosses with its definition untouched, because macro-OvR equals the binary AUC to every digit.The split is a different algorithm, which was found rather than planned.
stratified_splitdivides the samples by label and splits each part, so a film carrying three findings would belong to three of them and be handed out three times. It now dispatches on the shape of the label. Measured over 400 draws at 70/15/15, as how often some part came out holding only one side of some class - the state every per-class metric refuses to average over:images random iterative iterative refuses combination refuses 200 96.75% 0.00% 78.50% 91.75% 500 51.25% 0.00% 4.50% 96.25% 1000 12.25% 0.00% 0.00% 97.25% 4000 0.00% 0.00% 0.00% 94.00%The combination as a stratum key buys a guarantee nobody asked for at a price that makes it useless. Iterative stratification with the group as the unit of assignment keeps
group_by’s guarantee at the same time, at a worst drift from the requested fractions of 0.0000. A class too rare for the smallest part is refused in those numbers - four positives and a 15% part is 0.6 of an image - rather than producing a split that dies at the end of the first epoch.A set of labels through the trainer and the engine: the binary form of whichever loss was asked for, a sigmoid per class through
f.probabilities, andpredict_labelsas a threshold atlogits > 0- a probability of 0.5 exactly, which is the same decision the metric family makes on the hard prediction. There is no threshold field: a threshold is a number about somebody’s data.answers()returnslabelsandpredictedas lists and carries noprobabilitycolumn, because that column is the chosen class’s own number and with independent questions nothing was chosen.
Fixed
Every per-class classification metric raised on an Apple Silicon Mac, and that shipped in
0.8.0a49.ClassificationMetricaccumulates afloat64confusion matrix and MPS has no float64 at all -Cannot convert a MPS Tensor to float64 dtype- soaccuracy,balanced_accuracyandf1have been unusable there since the task landed. Every Apple Silicon Mac picksmpssince0.8.0a38repairedpick_device.Nothing caught it because the default metric is
auc, which takes the scores path and was already moving its state to the CPU for a different reason - memory - and no macOS test had asked for one of the other three. It was found by the multi-label family hitting the identical line: both macOS jobs ofpyplatypus#315failed on the one test that reaches a multi-label metric which counts rather than ranks, and the single-label half was found by reading the file beside it.Both families now count on the CPU. The arithmetic does not care and the transfer is one small tensor per batch - the state was never the thing whose size grows with the pass.
The local suite could not have found this and the reason is not that there is no accelerator. This machine has CUDA,
pick_devicepicks it, and CUDA has float64 - so the conversion succeeds here on exactly the device that refuses it there. §4 of the workbench’s notes calls this a gate passing because of the machine it ran on; this is the version where the machine is an accelerator rather than an installed library, and the only instrument that could answer was the macOS runner.
Measured
The rarest-class-first order buys the refusal column and not the correctness, which reversing it proved by surviving every test written for the split first. The post-condition is what makes a returned split correct, so the order cannot move the bad column at all - it moves how often a split that exists is found. With a rare finding occurring only inside a common one, which is the clinically ordinary shape: 3.00% refused against 35.50% reversed at 500 films, and 0.00% against 12.00% at 1000.
A wrong-width target does not broadcast through the binary loss, so
_loss_ofneeds no shape check of its own:binary_cross_entropy_with_logitsrefuses a(examples,)target against(examples, classes)logits by name, including when the batch size equals the class count - the shape that defeats the categorical form.And
_loss_of’s multi-label branch is load-bearing rather than declarative, which is the second half of that measurement and went the other way.as_onehotpasses a floating target of the right width through unchanged, so the branch looked like something no measurement could distinguish; deleting it makes a(3,)target reachas_onehot, which reads it as indices, expands it into a plausible one-hot, and the binary loss returns 0.843 instead of refusing. The function that rescues the categorical route is the one that would hide the failure on this one.The matching loss refusal is deliberately absent because it would be unreachable. The two losses a label admits -
cceandfocal, the ones with neitherneeds_extentnorcontinuous- both carrysupports_multilabel=True, so no admissible loss can fail that test today.build_loss(multilabel=True)refuses by name if a third ever arrives, and a test holds that claim to the flags so it fails on the day it stops being true.
The R half
None yet, and deliberately. R has no classification_data() at all, and the pin is what keeps the two halves from disagreeing: a pin move alone would make YAML accept labels_from while the constructor refuses it, which is maju116/rplatypus#152’s three-way divergence. For the same reason the configuration guide does not describe the field - that guide is one document in two packages, with its section list pinned by a test in each - so it arrives with the R surface rather than before it. The field’s own description= is the documentation on this package’s site, which is what §3C of the workbench’s notes means by it.
[0.8.0a49] - 2026-10-27
task: classification - one label per image, and the fourth task this package can be asked to do.
Added
task: classification,maju116/pyplatypus#206.crops()has been cutting objects out and handing them to “a classifier it does not contain” since detection shipped, and explaining a model needs a per-image answer to explain. Both now have one.The tag is what this release is, and it lands last on purpose: everything behind it - the specification, the head, the metrics, the reader, the trainer and the engine - was built and tested over the preceding slices, so the tag never named a task the package could not train.
0.8.0a20built the instance task the same way, andtests/spec/test_task_coverage.pyis what makes that order safe: it fired on the first edit of this release, whenTaskgained a member andAnySpechad not, which is exactly the window it was added to guard.No
architecturefield, and that is the task’s one structural difference. The network is a contracting path, pooled, with one dense layer on top, andencoderdecides whose contracting path it is - ours when unset, any of timm’s when it names a backbone. Soavailable_models("classification")refuses rather than returning a row: a row would invitearchitecture: plain_cnn, which the model refuses as an unknown key.ClassificationModel.architectureis a derived property readingplain_cnnor the backbone’s name.aucis the default metric andaccuracyis not. Measured on 40000 images at a prevalence of 3%, calibrated by construction so that only the discrimination varies:discrimination accuracy balanced macro f1 auc none 0.9720 0.5000 0.4929 0.5132 a = 0.5 0.9702 0.5000 0.4924 0.6393 a = 1.0 0.9704 0.5004 0.4933 0.7516 a = 2.0 0.9728 0.5609 0.5972 0.9088 a = 4.0 0.9802 0.7443 0.7923 0.9763Accuracy spans 0.0100 where the AUC spans 0.4631 and is not monotone - the model with no signal at all scores above two that have one. The sharper half is that balanced accuracy, the obvious fix, is no better here: it and macro F1 are +0.0000 and -0.0005 between a real signal and a collapse, because a calibrated model at that prevalence never crosses the threshold. Being threshold-free is the property that separates them, not being balanced.
The split is stratified, and that is the same arithmetic. A random 70/15/15 of 100 images at 3% prevalence leaves some part with none of the rare class 91% of the time - 64% at 200, 20% at 500 - and the closed form
(1-f)^ragrees with the simulation to three digits. Every per-class metric refuses to average over a class its pass never held, so the run would die at the end of the first epoch with the epoch already paid for.stratified_splitcallssplit_samplesonce per label; the cost is one image of drift at 100 images and nothing at 500.group_byis refused where a group holds more than one label, because stratifying would cut such a group across both sides - measured, and the control is that the same data without stratifying leaks nothing.A metric is accumulated over a pass rather than averaged over batches, which is a protocol and not a flag. Measured at a prevalence of 3%: accuracy agrees with the pooled figure to every digit, while balanced accuracy is out by up to +0.0123, macro F1 by -0.0734 and the AUC by up to 0.0371 and not monotone in the batch size - because 398 of 500 batches of 8 hold no positive at all, so three of the four are means over whichever batches happened to contain the minority class.
Fixed, on the way
f.overlapson a(batch, class)tensor returned one number for the whole batch instead of a count per class:spatial_dimsanswers with an empty tuple andsum(dim=())sums over every axis rather than none -torch.ones(4, 3).sum(())is 12.0. Refused now. Nothing in the package called it that way; the guard exists because the wrong answer is silent and plausible.A frozen transfer stayed frozen only in two of the three trainers.
model.train(True)reaches every submodule, so a transfer put ineval()at the top of an epoch is switched straight back unless the trainer re-applies it after that call. Removing the three lines that do it in the segmentation trainer broke no test, in released code, with the reasoning written out beside them.tests/training/test_trainer_contract.pyholds both trainers to it now, beside the callback-hook contract0.8.0a48added.
The R half
- Substantial, and none of it travels with the pin alone. An R user reaches a task through a constructor -
segmentation_data(),instance_data(),detection_data()- and there is noclassification_data(), so a classification run cannot be written from R at all until R gains its own surface for it. Aplatypus_spec()built from a bare list or a YAML file does reach the engine’s validator, so after a pin move that route would accept what the constructors refuse - which is the three-way divergencerplatypus#152recorded forregions, one task across. Filed on R’s side rather than described here.
[0.8.0a48] - 2026-10-27
A detection run could be configured with ema and take no average at all.
Fixed
Every trainer calls every hook.
maju116/pyplatypus#300.on_batch_endarrived in0.8.0a37as the fourth hook, withemaas the callback written for it, andDetectionTrainerwas given neither it norstate.step.Emais the only callback that implements it, so a detection run configured withematook no exponential average - accepted by the specification, costing what it costs, and doing nothing. Measured over four batches and two epochs, with the same callback through the segmentation trainer as the control:detection 8 batches seen, 0 folds, no `ema_steps` in the history segmentation the same callback, same decay: 8 folds, `ema_steps` 8.0The only reason it was a no-op rather than a corruption is a guard written for something else:
Ema.on_train_endreturns early at zero folds, because a run that stopped before taking a step has no average to substitute. Without that line a detection run would have finished by loading anAveragedModelthat had never been updated over its trained weights.The hook fires per optimiser step, not per batch, which is only a distinction when
accumulateis above 1 - and there it decides whatdecaymeans. Measured on a weight moving by 1.0 per step, decay 0.9, 32 batches: ataccumulate: 1the two readings are identical to the digit, 23.3434; at 4 they are 3.3047 per step against 5.4728 per batch, with the true weight at 8.0. Folding per batch leaves 3.43e-02 of the initial value whatever the accumulation, where per step leaves 4.30e-01 at 4 - so the horizon would shrink by exactly the accumulation. The same objection this trainer already makes about dividing the gradient byaccumulate. The call lives inside_steprather than at either of its two call sites, so a third could not forget it.
The instrument rather than the fix
A test pairs the trainers instead of merging them. The epoch loops genuinely are not one mechanism - each task pools its numbers by something different, which is why the drift was in
_run_epochand not infit, where the two are character for character the same - but the hook contract is one mechanism in as many copies as there are trainers. So every trainer the package exports is run for one epoch with a recording callback and must call every hook theCallbackprotocol declares, with both lists read off the code. A trainer this test cannot build fails rather than being left out, which is what makes the discovery an instrument: the classification trainer will fail it on the day it is exported.Measured while asking whether classification needs a third trainer rather than by reading:
DetectionTrainer.fitis 77% identical toTrainer.fit, 34 of 44 code lines, and 16 of the 17 callbacks mention nothing task-specific.
The R half
- None beyond the pin.
callback_ema()forwards unchanged and an R user reaches the same defect through it, so the fix arrives by the pin moving and by nothing else.
[0.8.0a47] - 2026-10-27
pretrained: true has been loading a backbone and overwriting it ever since encoders shipped.
Fixed
A transferred backbone survives construction.
maju116/pyplatypus#294.UShapedNet.__init__ended withinitialise(self, ...), which walks every convolution under the network - and an encoder handed to it is a submodule, so timm’s weights were re-initialised immediately after being loaded. Measured on 2026-10-27, offline, because the question is whether construction keeps what the backbone was given and random weights answer it as well as ImageNet ones do:resnet18 15 of 15 4D tensors in the backbone overwritten efficientnet_b0 80 of 80 one tensor's norm 2.418 -> 11.618What survived made it worse than a no-op.
initialisetouches convolutions only, so the backbone kept its batch-norm affine parameters and running statistics - ImageNet statistics in front of random convolutions - and the input was still normalised to what ImageNet expected.freeze_encoderfroze random weights andencoder_learning_rategave them the smaller rate meant to protect a transfer that was not there. The run trained, the loss fell, and the only symptom was a score lower than transfer learning should give.The fix is one answer to what arrived pretrained rather than a second one:
initialisetakesexcept_for, and the model passesencoder.transferred- the same propertyTraineralready reads for the freeze and the separate rate. Our own full-resolution stage insidePretrainedEncoderis not under it and is still initialised, which is the control the test carries.The test file said the missing test existed.
tests/models/test_pretrained.py’s own first paragraph claimedpretrained=Truewas exercised by a test skipped without a network; there was no such test, no skip marker and no network use in the file. The claim also split the question wrongly: whether the weights arrive needs a network, whether they survive needs nothing, and only the first is still untested. §4’s an instruction addressed to a human is code nothing runs, in a test file’s claim about itself.
The R half
- None beyond the pin.
encoderandpretrainedare forwarded unchanged; the defect was entirely in how the engine builds the network, so an R user gets the fix by the pin moving and by nothing else.
[0.8.0a46] - 2026-10-26
0.8.0a39 fitted an ellipse to a whole mask. This measures every object in one.
Added
instance_shapes(labels, spacing=None), one row per object besideinstance_sizes’s.maju116/pyplatypus#272. The same second momentsellipse_axestakes for a whole mask, taken per object in one pass: the foreground coordinates are sorted by label once and each object is a contiguous block, against one full-array scan per object for theellipse_axes(labels == k)loop a caller writes instead. Measured on 512 x 512 maps of synthetic ellipses:objects the loop one pass 49 50.9 ms 15.2 ms 3.3x 498 517.0 ms 44.9 ms 11.5x 1939 1988.7 ms 143.1 ms 13.9xThe two agree to 0.00e+00 on every object at every size, and that exactness is what makes them comparable rather than merely close - so the loop is this feature’s test control instead of its competitor.
The generalisation to a volume is a constant, and getting it wrong is invisible. For a uniform solid the variance along an axis is
semi_axis^2 / (rank + 2), so the factor is 2 for an image andsqrt(5)for a volume. Measured on an ellipsoid of semi-axes 50, 30 and 20, with the image’s 2 as the negative control:sqrt(5) 50.02, 29.97, 19.97 0.13% off 2.0 44.74, 26.80, 17.87 10.67% low control, an 80 by 40 ellipse: 0.17% with 2 and 11.87% with sqrt(5)The wrong constant changes no decision anywhere - the ordering of the axes, every ratio and the eccentricity all survive it - so it would have sat there until somebody reported a length. §4’s an error that changes no decision is an error nobody looks for, which is why a test asserts the wrong constant is wrong by a stated amount rather than asserting the right one is right.
Fixed in the design rather than in code
eccentricityis unitless and it is not spacing-free, which the issue had assumed the other way round - it proposed the descriptor as “the one available without a spacing”. It is not: on anisotropic voxels it describes whichever space it was computed in, and it reverses in both directions:a circle of 80 px at spacing (2, 1) grid 0.0000 mm 0.8660 closed form sqrt(1 - (1/2)^2) = 0.8660 an 80 by 40 px ellipse at spacing (1, 2) grid 0.8667 mm 0.0685So the second row is physically almost a circle and the grid calls it strongly elongated. The answer is the key names: the axes are
major_mmandminor_mmwith a spacing andmajor_pxandminor_pxwithout, and the suffix on the neighbours is what says which space the whole row is in. A test holds all four of those figures, because a sentence in a docstring is what this project keeps finding to be unread.A volume gets three axes and no eccentricity.
major_mm,middle_mmandminor_mm, because the arithmetic generalises exactly and refusing rank 3 would refuse the motivating data - medical imaging is volumes. An ellipsoid has no single eccentricity, and the ratio of two columns is the caller’s division rather than a name invented here.It is a second function and not
instance_sizes(shape=True), and an existing test in the other package is what decided it. R keepsinstance_sizesas its own arithmetic - a count times a product - and would have to forward a shape, making one function half-local and half-forwarded.rplatypus’stest-measure-pair.Rreads the body of every function whose help page carries a runnable example and asserts it does not reach the bridge, becauseR CMD checkruns examples and CRAN has no Python;instance_sizesis on that list andellipse_measureis the control on the other side. A flag would have failed that test, and the two repairs available - loosening the check or putting an arithmetic function’s page into\dontrun{}- are both the thing the test exists to prevent. So the choice was collapsed by a measurement rather than taken on taste, which is §6’s rule.Orientation is out, and not because of the cost. It needs the eigenvectors, and that was measured rather than assumed:
eighagainsteigvalshis 14.34 ms against 7.24 ms for 20,000 2x2 matrices, about 5% of one pass over a dense map. So the reason is the descriptor rather than the arithmetic - an angle needs a stated convention in 2D and has no scalar summary at all in 3D, and nothing in either package’s examples asks for alignment yet. Written down so the next reader does not re-derive the cost: what would bring it in is an example that needs it.
Known, and deliberately not here
The R half, by §3B. Engine first, published, then R - and
instance_shapes()is the second measurement in this package that crosses the bridge, so it joinsellipse_measureon the forwarding side oftest-measure-pair.Rrather than changing anything local.maju116/pyplatypus#272’s remaining task items are the R function and the Data Science Bowl vignette section, which is where how many nuclei and how big is each one is already the question being asked.The mutation batch found a case the tests did not hold. Ten mutations, every one confirmed to have landed on disk before the suite ran - because a mutation written against a line
ruff formatlater rewrapped never applies, and then the pass means nothing. Nine were caught on the first run. The one that was not is the degenerate threshold,rank + 1written as a literal3: the two are the same number for an image and differ only for a volume, and no fixture held a three-voxel object in one. §4’s fixture that never contained the case, found by mutating rather than by reading; the test added for it fails on that mutation and on nothing else, and the batch was re-run after formatting, where all ten are caught. Its own control - removing the feature entirely - fails seven tests.The docstring carries a
Note:section and it is the only one in the package, which is0.8.0a24’s trap exactly: a Google-style section quartodoc has no renderer for takes the whole site down with every other context green, and the absence of a construct here is evidence about the build rather than about taste. Checked rather than assumed - the generated page carries the section’s own figures, with a phrase that cannot be there as the grep’s control.
[0.8.0a45] - 2026-10-26
albumentations>=1.4 was a floor this package could not run on.
Fixed
The floor is
>=1.4.23, and every digit of it was measured. Resolved at>=1.4, the suite gives 50 failures against 2266 passed, and 28 of the 50 are one line:Compose.__init__() got an unexpected keyword argument 'seed'.seed=is whatdeterministic = Trueis built on - the promise whose help page says the refusal without a seed is deliberate - so the floor had been permitting a version that cannot honour it. Nothing here could see that, because every gate and every scanner was readinguv.lock, which has held 2.0.8 throughout. A lock is not a floor.Bisected rather than rounded up, because
>=2.0is the easy answer and narrows what a user may install by 24 releases:1.4.0 no seed=, no D4, no CenterCrop3D the floor as it stood 1.4.18 D4 only 1.4.21 seed= and D4, still no 3D transforms 1.4.23 all three - the first version this package's code can run on>=2.0was tried for one commit and bought nothing, which is recorded rather than quietly dropped: the same four tests fail at 2.0.0 as at 1.4.23, one of them to the digit -1.5301895141601562of warp slack either way - so albumentations is not that test’s variable. The lock does not move for any of this, which is the whole distinction being drawn.
Known, measured, and deliberately not fixed here
Three tests pin albumentations’ transform inventory through a number in a docstring. 118, against 113 at 1.4.23, 114 at 2.0.0 and 118 at 2.0.8 - so making them pass would make the floor
==2.0.8, a pin rather than a floor, in a library that has no business pinning. §3C is explicit about a number that is not portable: it must not be written down, only explained. That is a defect in those tests and not in this floor.GridDistortionleaves 1.53 px of slack against a 1.5 px tolerance at the floors, by 0.03 px, identically at 1.4.23 and 2.0.0. So the variable is elsewhere - opencv or numpy, both of whichlowest-directalso moves - and the bound needs measuring at both ends rather than loosening, which is the one repair §4 names as not being a repair.The
floors (lowest-direct)job that found all of this is on a branch, not here. It is the instrument, it is correct, and it is red until the four above are settled - and a red job on every pull request becomes the step nobody reads, which this repository’s own workflow comments say aboutcontinue-on-error. It lands when it is believable.
The R half
None, and the pin stays at 0.8.0a44 - measured rather than assumed, because the obvious reading says the opposite. R declares the engine through py_require() and uv resolves the dependency tree fresh on every environment it builds, with no lockfile anywhere in the route. That is exactly the shape this release is about, and a floor is exactly the thing a fresh resolution reads - so the first guess was that an R user pinned to a44 can be handed an albumentations without seed=, which is what deterministic = TRUE is built on.
Resolved rather than reasoned about, pyplatypus==<pin> as the only requirement:
a44, default (highest) albumentations 2.0.8
a44, --resolution lowest-direct albumentations 2.0.8
a45, default (highest) albumentations 2.0.8
a45, --resolution lowest-direct albumentations 2.0.8
All four agree, and the reason is structural rather than lucky: from R’s route albumentations is a TRANSITIVE dependency. lowest-direct lowers direct requirements, and the only direct requirement R states is the engine itself - at an exact version, so there is nothing to lower. A transitive dependency is resolved to the newest compatible release under every strategy reachable here, and 2.0.8 clears both floors.
The control, which is what makes that a finding instead of a shrug - the floor is asked to bind, by naming albumentations beside the engine the way a caller with their own requirements would:
a45 + albumentations==1.4.0 REFUSED, by name: "depends on albumentations>=1.4.23"
a44 + albumentations==1.4.0 ACCEPTED
So the floor does precisely what it claims, and the pin not moving is §3E rather than an oversight. The entry above says a lock is not a floor; the R-side counterpart is that a transitive dependency is not a floor either - the floor reaches a caller who names the package, and R names only the engine.
Which leaves one route, and it is a door this project has already met. A user who brings their own interpreter through RETICULATE_PYTHON brings whatever albumentations that environment holds, and the resolution above never runs. rplatypus#214 closed that door for the engine’s own version by warning when the running interpreter’s pyplatypus is not the pinned one; it says nothing about the engine’s dependencies, and this is the first release where that distinction has a consequence worth writing down. Not fixed here, and not filed as a defect either - it is the same door, and whether a warning should read the dependency tree as well as the version is a question for rplatypus#214’s successor rather than for a floor.
[0.8.0a44] - 2026-10-26
Python 3.10 is dropped. It reached end of life on 2026-10-01.
Changed
requires-pythonis>=3.11. The immediate reason is that0.8.0a43’s pillow floor had to be written with an environment marker: pillow 13 requires Python >= 3.11, so a plainpillow>=13is unsatisfiable against>=3.10anduvrefuses to resolve at all. A 3.10 install therefore got none of the decoder fixes that floor exists for. The marker was the honest thing to ship for one release and the wrong thing to keep, so the floor is one line again.Nothing in the dependency tree moves forward, which is the measurement worth having. Resolved before and after, 13 locked entries differ and every one of them is the removal of an old-Python branch:
exceptiongroupgoes entirely, being a 3.10 backport, andscipyloses 1.15.3,scikit-image0.25.2,tifffile2025.5.10,numpy2.2.6,matplotlib3.10.9 and five more. Nothing is added and nothing is upgraded, so what a 3.11 install receives is unchanged - and the lock holds one pillow instead of two, which is what lets the advisory count against it reach zero.Somebody on 3.10 is not broken, they are stopped.
requires-pythonis metadata every installer reads, so pip and uv serve them the newest release that supports their interpreter -0.8.0a43- rather than failing. That is the whole migration path and it needs nothing from them.The CI matrix tests 3.11, 3.12 and 3.13, with 3.11 and 3.13 off Linux, keeping the rule the matrix already had: the ends of the supported range on macOS and Windows, everything in between on Linux only, because torch is a slow download.
Three required status checks were named
test (<os>, 3.10), and a job’s name is what branch protection matches. Dropping the cells without renaming the contexts leaves every pull request waiting forever on a check that is never coming, and the symptom is indistinguishable from a run that has not registered yet - the fourth mode in this project’s own list of ways a CI reading lies, except permanent. The contexts were renamed to 3.11 in the same breath as the matrix.The linter gained a rule by itself, which is the one change here nobody asked for.
ruffreadsrequires-pythonas its target version, soUP017-datetime.UTCovertimezone.utc- was suppressed while 3.10 was supported and fires now. One site,runs.py, where the run record’s timestamp is written. Worth naming because it is the shape of what a floor does beyond the floor: the rules a tool applies are a function of the range the manifest declares, so raising it is not only a subtraction.Three comments that record a measurement taken on a 3.10 job carry its date now (
spec/components.py, two intests/spec/test_components.py, all 2026-10-11). They stay true - a measurement does not stop having happened - but they name a job that no longer exists, and a reader who goes looking for it should find out when rather than find nothing.
Owed, and not in this release
rplatypus’sDESCRIPTIONsaysSystemRequirements: Python (>= 3.10). That is a second copy of this number with nothing holding the two together, and it becomes false the moment R’s pin moves to this version. The tarball in CRAN’s queue is consistent, because it pins0.8.0a42; the line travels with the next pin move.
[0.8.0a43] - 2026-10-26
What Image.open is allowed to dispatch to, and a pillow floor that is about the user rather than about this repository’s lock file.
Security
Image.openidentified every picture by its CONTENT and was handed nothing but a path, so every decoder PIL ships was reachable from any path a specification named. One of them, the EPS plugin, hands the file to Ghostscript; FlashPix, JPEG 2000, MSP, WMF and XBM are formats no reader here has ever been pointed at. The three reading sitesread_image,spatial_shapeand the per-object instance reader - now passformats.
The glob was never the guard it looked like.
read_instance_masksselects files by the name*.pngandImage.opendecides by the bytes, so a file called00.pngcarrying another format went to whichever decoder its contents asked for. There the allowed list is the one item the glob already implied.READABLE_FORMATSisPNG, JPEG, TIFF, BMP, GIF: PNG and JPEG are what every example and test here reads, and the other three are the mainstream raster formats a 2D set travels in, so refusing them would be a narrowing nobody measured. Counted off the open advisories against the locked pillow, restricting the dispatch takes six of them out of reach including two rated critical - and unlike a version bump it does not expire, being a statement about what this package reads rather than about which decoder bugs are open today. Volumes, DICOM and DICOM series never reach PIL and are unaffected.The refusal is worded once for both PIL readers and says that the name was not what decided, because the first thing anybody does with “could not read” is check the extension, and here the extension was already right.
The pillow floor is 13, which is the only half of this that reaches a user. A lock file governs this repository’s environment; what somebody installing resolves is the dependency line, and
pillow>=10.0was satisfied by a 10.x holding every advisory that 13.0.0 fixes.It carries a marker rather than being a plain
>=13, and the marker is a finding and not hedging: pillow 13 requires Python >= 3.11, so a plain floor is unsatisfiable on the 3.10 this package still supports -uvrefuses to resolve at all. Python 3.10 reached end of life on 2026-10-01, so the repair is to drop it and collapse the two lines into one; until that is decided, every interpreter that can take the fix gets it. A 3.10 install is not protected, which is an argument for dropping 3.10 rather than for pretending otherwise.One break travels with pillow 13 and it is somebody else’s rather than ours:
mode=is no longer a data-type converter infromarray. All seven call sites in this repository pass a mode matching its dtype, checked including the one arithmetic expression (mask * 255staysuint8), and the suite is green on 13.0.0.
[0.8.0a42] - 2026-10-25
A detection epoch is pooled by what the loss divided by. maju116/rplatypus#218.
Fixed
DetectionTrainer._run_epochended in{key: value / batches}, and the thing being averaged is not an average over examples. Every component of the YOLO loss is divided inside the loss:coordinates,objectnessandclassesby a grid’s object count, andno_objectby the cells it supervises. Averaging those over batches weights a frame holding thirty blood cells the same as a frame holding two.This is not
0.8.0a40’s repair in another trainer, which is why it is its own release. There the per-batch value was already a mean over the batch’s examples, so weighting bybatch_sizeturned a mean of means into the mean - one correct answer. Here the denominators live inside the loss and there are four of them per scale, soLossPartscarriesgrids, oneGridPartsper scale holding the four terms and the two divisors, and an epoch issum over grids of (sum over batches of value * divisor) / (sum over batches of divisor).The grids are summed, not mixed.
forwardsums the three scales, each already divided by its own grid’s count, so pooling across grids and batches together would turn a sum of three into an average of three. That is a different quantity rather than a different weighting: it moves the reported loss by a factor of about three and picks epochs for that reason. The first measurement of this issue made exactly that mistake and reported a moved epoch that was the artefact.totalis rebuilt rather than pooled, because it is a weighted sum of four terms divided by two different denominators and so has no denominator of its own.
Migration
A detection run’s epoch line changes. On BCCD at the example’s own settings the reported
val_lossmoves by up to 0.33 over 150 epochs, and the change is not a constant offset - it ranges from -0.14 to +0.33 and changes sign. Anything comparing a recorded detection loss against a new run is comparing two definitions.No published number moves.
bccd-yolo3’s card reports average precision throughevaluate_classesandevaluate_images, which score per image on their own path. What changes is which epochearly_stoppingkeeps.Measured, and it did not move the epoch on the run that matters. 150 instrumented epochs of
examples/detect_blood_cells.py: both poolings pick epoch 14 and agree on the first five in order. That is reported as too close to call rather than as no effect - the winner’s margin over the runner-up is 0.0558 and the gap between the two poolings varies across that neighbourhood by 0.0585, which is 1.05x the margin. The argmin survived because the gap is nearly constant where the minimum lies, not because the weighting does not matter. So this ships on the arithmetic rather than on an effect size, andbccd-yolo3is not retrained for it.
[0.8.0a41] - 2026-10-25
hc18-unet, the fifth published name and the first whose headline figure is not an overlap score. maju116/rplatypus#205.
Added
hc18-unetin the weights registry, pinned to Hub commit9c6d8599: a U-Net at 544x800 for the fetal skull in 2D ultrasound, trained on HC18 and published for measuring head circumference in millimetres. CC BY 4.0 rather than MIT, because HC18 is - the same bracket asfives-unetand not a new one, read from the dataset’s own Zenodo record (10.5281/zenodo.1327317).Median absolute error 2.44 mm against the sonographer’s measurement over 199 held-out images, mean 3.84 mm, worst 48.07 mm; 3.41 mm against the circumference of the truth mask, which is the model’s own contribution rather than the dataset’s drawing convention. The median and the mean are both published because they disagree: half the cases are inside 2.44 mm and a tenth outside 7.23 mm, so the mean describes the tail.
The entry warns the reader off the Dice, and that is the measurement rather than modesty. The Dice is 0.9494 and it orders the cases differently from the millimetres - Spearman 0.153 on this run - with 85 of the 144 cases scoring 0.95 or better still wrong by more than 2 mm. A ragged boundary barely moves an integral over a region and a systematically fat or thin mask moves it linearly, which are the two errors Dice is respectively most and least able to see, and they are the wrong way round for anybody measuring a length. So the description leads with millimetres and names the Dice only inside the sentence saying not to choose on it, and a test asserts that order.
examples/publish_hc18_weights.py, which trains the modelmeasure_fetal_head_circumference.pydocuments and writes the file, the sidecar and the card. It importsspecification(),prepare()andmeasure()from that example rather than copying them, and a test holds the two scripts’ defaults equal for every argument that shapes the model. It uploads nothing: the upload is the author’s.
Fixed
The Spearman was quoted as a property of the task and it is one draw. The publishing script’s docstring said the two orderings disagree with “a Spearman of about 0.6”, “measured on the run this script publishes”, while the run it publishes measured 0.153. Three runs of the one recipe gave 0.620, 0.435 and 0.153: the direction holds in all three and the magnitude moves fourfold, and it moves the same way each time - the better the Dice, the less it orders anything, which is what a rank statistic does over a narrower spread. The card now carries all three in a table generated from a constant, and says three runs is a direction and not a law.
Two tests that could not have failed, both in this release’s own test for the registry description and both found by mutating the entry rather than by reading them.
median, mean = 2.44, 3.84followed byassert median < meancompares two literals and is true whatever the entry says, so swapping the two figures in the description left it green; and"85 of the 144 cases" in descriptionsurvives the count becoming 185, because it is a substring of it. Both assertions now read the numbers out of the description by their role and compare what was read.An interpolated block broke the card’s indentation.
textwrap.dedentstrips the common leading prefix, a block inserted at column 0 leaves none, and the whole section came out indented eight spaces - which the Hub renders as preformatted text. Found by reading the generated card, and now held by a test asserting it starts at column 0.
[0.8.0a40] - 2026-10-25
batch_size leaves the reported score. maju116/rplatypus#196.
Fixed
An epoch’s numbers are weighted by the examples that produced them, not by the number of batches.
_run_epochdivided each total by the batch count, which weights the examples of a short last batch bybatch_size / last_size- so a split’s reported figure moved with a training setting that has no business in it. Measured on 199 validation cases: 2.3e-04 atbatch_size4 and 3.5e-03 at 32, and the gap is not monotone in the setting, because its size depends on which cases land in the short batch.This was never a second definition of anything, which is why it is a fix and not a migration. The per-batch value is already the mean over the examples in that batch -
overlapssums the spatial dimensions only andSegmentationMetric.reduceends inper_class.mean()over the batch - so a mean of means was reaching for the mean over examples and mis-weighting one batch of it.evaluate()is the mean over cases, which its own docstring has claimed sinceatwas added. It was not: theat="model"branch calledtrainer.evaluate(loader)without case names and got the batch mean, while the paragraph above it said “the pooling is the same in both, deliberately: the mean over cases” and theat="source"branch’s comment said it matchedat="model"on purpose. Both rested on something the code did not do.evaluate()now passes the case names, so a tiled run’s tiles are pooled into cases rather than averaged as tiles - the reassemblyscore_casesargues for.On a tiled run that second half is the larger change by an order of magnitude. Recomputed from the stored per-case rows of every FIVES arm on this disk: the figure moves +0.033 to +0.049 of Dice on the tiled arms and by 1e-9 on the untiled ones. The measured tables in both packages’ articles and vignettes do not move, because every one of them was built from the per-case route already -
focal0.8673,generalized_dice0.8504,iou0.8309,dice0.8127, and the headline 0.8828 / 0.8014 are all the per-case means. This release bringsevaluate()into agreement with prose that was already right.evaluate()’s figure is now exactly the mean ofevaluate_cases()’s own rows, which is the consequence the issue was filed for, and a test pins it atrel=1e-9where it used to readabs=0.05. That tolerance was hiding nothing on its fixture - 12 samples atbatch_size2 is six full batches - which is why the test that replaces it scores one trained model through six batch sizes, five of which do not divide the split.An epoch’s mean and its
_worstare two readings of one set of per-case scores. They were computed from the accumulator separately; now the scores are taken once, so an epoch cannot report a worst case that is not among the cases its mean covers.
Changed
Trainer.evaluatetakescases. It was a one-line wrapper on the training path and is now the one place the difference is stated: a training pass is shuffled and has no case identity, so its line is the mean over examples; a caller scoring a split has the names.best_model()needs no change and may answer differently. It ranks onevaluate(), so it gets this for free - and where two models sat within the pooling’s own shift of each other, the winner can change. Recomputed on the eleven-loss FIVES table: the winner is unchanged and its margin over the runner-up grows from +0.0006 to +0.0033, while the one pair that swaps rank differs by 1e-4, which that table already called a tie.
Not in this release
The detector’s epoch has a different defect and its own issue,
maju116/rplatypus#218.DetectionTrainer._run_epochdivides by batches too, but every component of the YOLO loss is normalised by the number of objects in the batch, so averaging over batches weights a frame of thirty cells like a frame of two platelets. The repair there is a ratio of sums at the object level and needsLossPartsto carry what it divided by - a different mechanism, and one release should not carry two poolings’ changes. No published detection number moves: the AP table is scored per image through its own path.The published weights are retrained separately.
restore_bestselected on a quantity this release changes, and the histories do not store per-case scores per epoch, so which epoch a run would now keep cannot be recomputed from disk. Bounded from what is stored: on HC18’s run the mis-weighting can move an epoch by up to 5.8e-03 while the nearest rival sat 1.4e-03 behind, so the selection is not provably the one a correct weighting would have made.
[0.8.0a39] - 2026-10-25
Millilitres, square millimetres and millimetres, in the engine rather than in the R package. maju116/pyplatypus#270.
Added
pyplatypus.measure, and five exported names:mask_volume,instance_sizes,largest_filled_object,ellipse_axesandellipse_circumference. A voxel count is not a measurement - the same lesion is 4,000 voxels on one scanner and 12,000 on another - and until now this package had no way to turn one into the number a report is written in.None of this arithmetic is new and none of it was reachable.
mask_volumeandinstance_sizeswere implemented in the R package, in R;voxel_mlwas computed ininst/python/platypus_shim.py, which is Python shipped by the R package; and the head circumference was inexamples/, which the wheel does not contain (include = ["pyplatypus*"]). So apip install pyplatypususer asking how big a finding is got a voxel count. The third release in a row to move a mechanism off the wrong side of the bridge, after0.8.0a29’s volume writer and0.8.0a38’sdevice_report()- and the second to come out of that same file.This package had also promised the first one twice and never had it:
volume_spacing()’s docstring says it is needed by “anything reporting a volume in millilitres rather than in voxels - which is the number a clinician asked for”, andsave_volumes()says “every volume in millilitres reads position and spacing out of it”. Both true, neither naming a function. The same shape assave_class_masksbefore0.8.0a23.MeasureError, so a refusal here is one kind rather than aValueError. R turns it intoplatypus_measure_errorby the rule it applies to every kind the engine has.
Changed
spacingmultiplies the coordinates, not the answer - the one decision in this release that is not a name. For a volume or an area the two are the same thing, because a count scales by the product of the sides either way. For a length they are not: an ellipse’s perimeter is not separable in its axes, so there is no number to multiply a pixel-space circumference by unless the pixels happen to be square.Measured on a circle of radius 100 px with
spacing=(2, 1), which is an ellipse of semi-axes 200 and 100: scaling the coordinates gives 968.9 against 968.8 integrated, where the two scalings somebody would reach for answer 628.3 and 1256.7. HC18’s pixels are square, soexamples/measure_fetal_head_circumference.pywas correct and would have stopped being correct on the first anisotropic 2D dataset. Its own composition on square pixels is now that claim’s control, and the two have to agree to twelve digits.examples/measure_fetal_head_circumference.pycalls the engine instead of carrying 61 lines of its own geometry, which is what makes this a move rather than a second copy.fill()stays in the example: turning a sonographer’s open curve into the region it encloses is a convention of one dataset’s annotations rather than a measurement.The configuration guide’s millilitre section calls
mask_volume. The division it showed is correct and says why - attarget_spacing: [1, 1, 1]a voxel is exactly one cubic millimetre - three sections before the same page says resampling is offered rather than imposed. Documentation to be copied, with a precondition the reader is invited to drop and a failure that is silent; a function takingspacingcannot fail that way.
[0.8.0a38] - 2026-10-24
What the work will run on, decided and reported in one place. maju116/pyplatypus#265, #266.
Added
device_report(), exported: the torch version, the CUDA build, which accelerator will be used, what to call it, the architectures a CUDA build carries, andgpu_present_but_unusable- the one field worth acting on.It is not new code. It has existed since the R package was written, in
inst/python/platypus_shim.py- a file of Python shipped by the R package, where no user of this one could reach it. So a Python user whose card the build cannot use was told nothing, while an R user was told twice. The same move as0.8.0a29’s volume writer: a mechanism that had been living on the wrong side of the bridge.gpu_present_but_unusablereadsdevice_count()rather thanis_available(), and that is the whole subtlety: a CUDA 13 build on a Pascal card returns 1 from the first and False from the second - torch enumerates the card and cannot initialise it. Testing for zero detects nothing.
Fixed
pick_device()asked about CUDA and nothing else, so every Apple Silicon Mac - and this project’s own macOS CI - trained on its processor with a workingmpsbackend present in the same wheel. It askscuda,mpsandxpuin that order now, and the order is a decision: every published set of weights here was trained on CUDA, so a number from another backend is not obviously comparable.A backend that raises while answering
is_available()counts as unavailable. A build with no CUDA support has done exactly that, and a chooser that propagates it turns a usable processor into a failed run.
Changed
pick_devicelives inpyplatypus.deviceand the trainer re-exports it. Two answers to what will this run on - one choosing, one reporting - cannot be allowed to disagree, and a test pairs them.
Measured
Five mutations, each caught - but two of them only after the tests learned to fake a machine this one is not. On hardware with CUDA, restricting the backends to CUDA alone changes no answer and a report that hardcodes
"cuda"is right by accident: the defect this release fixes is invisible to any test that asks the real machine. Four tests now monkeypatch the backends and ask what an Apple Silicon or Intel machine would be told.tests/test_public_api.pyreporteddevice_name()as a call a message tells somebody to make. It was a false positive of its own pattern - the scanner read the span between a dict key’s closing quote and the next literal’s opening one as a quoted sentence - and the call moved onto its own line rather than the test being loosened. Its docstring already records it catching its author once; this is the second shape.
[0.8.0a37] - 2026-10-24
A fourth callback hook, and the averager that needed it. maju116/rplatypus#203.
Added
Callback.on_batch_end, fired after every optimiser step on the training pass, withstate.stepcounting steps since training began. The protocol had three moments and none of them was a step.It cannot stop the run, and returns nothing to say so. A run that stopped mid epoch would leave a record with training numbers and no validation ones, and every reader of the history -
best(), the callbacks that watch it, R’straining_history()- would have to learn that a row may be half a row.stop_after’s budget is therefore still the budget plus one epoch, which its own description says.ema, an exponential moving average of the weights updated every step.swa’s sibling and the reason the hook exists: a decay of 0.999 is 0.999 per step, which over 60 epochs of 200 batches is 12,000 updates and a half-life of about 700 steps. Announced per epoch the same number would do almost nothing, so offering it that way would have published a name whose documented values mean something else.Buffers are averaged alongside the weights, which is the difference from
swa: a uniform average of weights has batch-normalisation statistics belonging to no epoch, soswarecomputes them with a pass over the training data; an exponential average that also averages the buffers carries its own and needs no second pass.One averager per run.
emaandswatogether are refused: both replace the model when training ends, so the second would average what the first had already written, in whichever order the list happened to have them.
Measured
Five mutations, each caught: firing the hook on validation batches fails 1 test, a step counter that never advances fails 1, an average that is counted but not folded fails 2, a run with no steps that still gets the average fails 1, and two averagers allowed fails 1.
One of those was not caught the first time, and the test was the problem again.
AveragedModelis built from the model aton_train_begin, so with the weights untouched its snapshot and the model are the same numbers and writing one over the other is invisible. The test now moves the weights before asking whether they were left alone. The same shape as0.8.0a35’s range assertion: a check that cannot tell the failure from the success.
[0.8.0a36] - 2026-10-24
The number this package tells everybody to read becomes one a callback can watch. maju116/rplatypus#205.
Added
val_<metric>_worstin every epoch, for the metrics whose counts pool into one score: the lowest any single case scored.summarise_caseshas said since it was written that “the minimum is the one nobody publishes and everybody should - a model averaging 0.86 that scores 0.11 on some patient has a failure mode, and the mean is where it hides”, and then every callback in this package watched a mean. A declaration beside a mechanism that did not describe it.monitor: val_dice_worstworks now, and so does awhencondition on it.Validation only. The training loader is shuffled, so a case has no identity in that pass and there is nothing honest to pool by.
Changed
score_casesand the epoch share one definition of a case’s score,_PerCase. The pooling is a ratio of sums - a case’s tiles, or a patient’s slices, are added up and the formula applied once - and that arithmetic now exists in one place rather than in the two that report it.
Measured
The worst case costs 5.6% of an epoch, on 40 cases at 128x128 on this machine’s processor: 620.9 ms of training plus 366.3 ms of validation becomes 1042.6 ms. It is computed in the pass that already happened - the counts are three reductions on a batch that has been forwarded anyway - rather than in a second pass, which would have doubled every epoch’s validation to report a number the first one had the parts for.
The share of the validation pass alone came out 23.3% and then 15.1% on two runs of the same measurement, so the epoch figure is the one worth quoting and the other is noise.
Five mutations, each caught: reporting the best instead of the worst fails 4 tests, replacing a case’s accumulation with its last piece fails 1, not noticing more examples than names fails 1, not reporting it at all fails 5, and a spec that does not admit the key fails 1.
[0.8.0a35] - 2026-10-24
The quiet failure of segmentation becomes a number, and then a refusal. maju116/rplatypus#206.
Added
Every epoch reports
foreground, for both passes: the share of the prediction that is not background. Beside the loss rather than among the metrics, and the distinction is the point - nothing is compared against the truth, so this is not a measure of quality. It answers is this still a segmentation rather than is it a good one.Reported unconditionally rather than offered as a metric to opt into, because a collapse you have to opt into noticing is one you will not notice. A model predicting background everywhere is not visible in the numbers it already produced: with
include_backgroundthe Dice is a mean over class channels and the background channel is nearly perfect, so a collapsed model reports around 0.5 while its loss falls.terminate_on_collapse,terminate_on_nan’s quiet sibling: it ends the run when the foreground share stays at or belowfloorforpatienceepochs. A floor rather than a test for zero, because 0.01% foreground on a target that is 14% foreground has collapsed in every sense that matters; and a patience, because an early epoch legitimately predicts almost nothing. It can watch the training share instead, which answers a different question - a model collapsing on data it has seen has a different problem from one collapsing only on data it has not.
Changed
evaluate()’s rows carryforeground. It is the one column there that is not a quality measure, and it is there for the reasonload_shapeis: a collapsed model reports a plausible Dice, and a table that cannot show the foreground beside it is a table somebody misreads.
Measured while building it
- The test fixture collapses. Three 32x32 images trained for a few epochs predict no foreground at all - share exactly 0.0 - which is a fair demonstration of what this release is for and makes that fixture useless for comparing the reported number against a computed one. That test evaluates an untrained model instead, and says why.
- One mutation was not caught the first time, and the test was the problem. Deleting the accumulation entirely left every test passing, because the assertion was
0.0 <= share <= 1.0and a counter that was never added to is zero - which is in range. The test compares values now, with the fixture’s own share asserted non-zero first.
[0.8.0a34] - 2026-10-24
Three answers to one question - when may this callback act, and on what evidence - shipped together because they are one vocabulary rather than three features. maju116/rplatypus#199, #201, #207.
Added
early_stoppingtakes a warm-up:startas a fraction of the run orstart_epochas an epoch, exactly one of the two.patiencealone could not express it, because it is in force for the whole run: a model that needs fifteen epochs before its validation curve means anything forcedpatience > 15permanently, paying the same slack at the end where the point was to cut quickly.It delays the stopping and nothing else. An epoch inside the warm-up can still be the best one and
restore_bestcan still return to it - those are the best weights the run has if it ends for another reason, and discarding them to tidy the bookkeeping would lose a real answer.swatakesstart_epochas the exclusive alternative to itsstartfraction. The same concept and therefore the same two words, by §3A. Its refusal readsmodel_fields_setrather than the value, becausestartcarries a default and 0.75 is both the default and a perfectly good thing to ask for.model_checkpointtakeswhen: thresholds that must all hold before anything is written,{val_dice: 0.9, val_loss: 0.2}. The direction is derived, not configured - anything ending inlosshas to be below its threshold and everything else above it, which is the rulemonitoralready uses, so there is noabove/belowto get backwards. The keys are checked against what the model actually reports when the specification is built, the same validator that refuses an impossiblemonitor.whenandsave_best_onlyare both gates, not alternatives: with both, a file is written when the watched number improves and every threshold holds. And a run whose conditions never held says so when it ends, because silence there is indistinguishable from a callback nobody configured, and a run that kept no weights is worth knowing about before somebody goes looking for the file.stop_after, a wall-clock budget in hours. An epoch cap is the wrong instrument: how long an epoch takes is a property of the data and the shape, and the cases where this matters are the ones where that was not what anybody expected. Checked at the end of an epoch, so the real limit is the budget plus one epoch - said in the field’s description rather than discovered. The run’sstop_reasonnames the clock, so a run that ran out of time does not read as a run that converged.
Notes
- A fraction and an epoch are two fields in both places, never one that accepts either:
1and1.0are the same value once YAML is parsed, so “epoch one” and “the whole run” would be one configuration and the mistake would be silent - both are in range for both meanings. - Eight mutations, each caught: ignoring the warm-up fails 2 tests, letting it gate the best fails 3, reading a fraction as an epoch fails 1, turning the conditions into an OR fails 4, reading every condition as above fails 1, staying silent about a run that wrote nothing fails 1, a clock that never runs out fails 1, and an unchecked condition key fails 1.
[0.8.0a33] - 2026-10-24
Two learning-rate schedules, and the discovery that the one we had could not be combined with the thing its own docstring said it combined with. maju116/rplatypus#200.
Added
linear_annealing- the same shape ascosine_annealingwith a straight line instead of a curve:min_lr, an optionalepochs, each parameter group descending from its own initial rate.step_decay- multiply byfactorat fixed points, which is how published recipes are written: divide by ten at epochs 30 and 60.everyfor a period ormilestonesfor the epochs a paper names, exactly one of the two, becauseevery: 30andmilestones: [30]are different schedules and one field holding either would be read as whichever the author happened to type. The rate is computed asinitial * factor ** dropsrather than by multiplying what is there, so replaying an epoch cannot double a drop.
Fixed
A schedule beside
reduce_lr_on_plateausilently erased the plateau’s cuts, andcosine_annealing’s docstring had promised the opposite since it shipped. It said “a run may want both: a cosine floor with a plateau rescue on top is a legitimate recipe”. Measured instead of believed - the same six epochs, with a loss that never improves:epoch both configured the plateau alone 1 0.097553 0.100000 2 0.090451 0.010000 3 0.079389 0.001000 4 0.065451 0.000100 5 0.050000 0.000010 6 0.034549 0.000001The left column is the pure cosine from 0.1, digit for digit: a schedule recomputes the rate from the optimiser’s initial value at the end of every epoch, so whatever the plateau cut is gone before the next one begins. The spec refuses the pair now, by name, and the docstring says what the code does.
Two schedules in one model are refused for the same reason, where before the last one in the list won silently.
Changed
build_callbacksdeclares an order instead of inheriting one.swapins a constant rate once averaging starts and a schedule recomputes it every epoch, so which one an epoch ended with depended on where they sat in the list and nothing said so.swais moved last - a constant tail rate is the whole point of configuring it - and everything else keeps the order it was written in.cosine_annealing,linear_annealingandstep_decayshare a base class, so the horizon, the per-group initial rates and the refusal to run without knowing the run’s length exist once rather than three times.
[0.8.0a32] - 2026-10-24
The honest comparison becomes a thing to ask for rather than a thing to write yourself. maju116/rplatypus#187.
Added
evaluate(at="source")andevaluate_cases(at="source"): every prediction goes back onto the grid of the file it came from and is scored against the truth as stored.at="model"is the default and is unchanged, because changing it would silently restate every number anybody has written down.What it is for: scored each through its own loader, a model at
input_shape: [512, 512]is measured against a truth reduced to 512 while a model that tiles 2048 is measured against the truth as stored. Both are a real Dice of a real prediction against a real mask and they answer different questions. Measured on retinal vessels, that difference reported a resized model at +0.0187 where the honest figure was +0.0033 - 5.7 times- with the bias reversed on clDice, because upsampling smooths a prediction: better against a skeleton, worse against a boundary.
The grid is the files’ own and cannot be named by the caller. A named grid resamples the truth, so the thing every model is judged against would itself become an interpolation chosen by whoever typed the number - which is the defect this argument exists to remove. Here the truth is never touched; only predictions move.
Streamed. One case at a time through
predict_stream, because the predictions are at full resolution and tiling exists for images too large to resize: 200 FIVES retinas at 2048 are 6.7 GB of probabilities, so this grid is exactly where holding the split would hurt most.The spacing is each file’s own, which is what makes
surface_dicemean millimetres here. On the model’s grid every case sharestarget_spacingby construction; on this one they do not, so the metrics are built per case.Two prices, both named in the prose rather than discovered: interpolating probabilities softens a boundary, and where the forward crop cut anatomy away the inverse pads it with background - not examined rather than nothing there. For a comparison the second is correct rather than unfair, but a 0.000 arriving that way is a result and not a bug.
The
load_shapecolumn readssourcewhen scored there, because what it has always meant is the grid the row’s numbers were computed on. The loss is not reported: a loss is defined by the objective a model trained with, on the grid it trained on.
Changed
- The comparability warning now names
evaluate(at='source')instead of describing what a reader would have to build. It had pointed atpredict(space='source')since0.8.0a30, which is the raw material rather than the answer - an instruction addressed to a human in the place where a mechanism now exists. Dataset.to_target()is the three-way expansion__getitem__used to end with, andDataset.target_as_stored()reads a sample’s masks at the size its files hold. Readingsize=Noneas as stored goes through the same reader as everything else: the three namings are the part that must not exist twice.
Measured while building it
evaluate()means over batches andevaluate_cases()pools by counts, so a split’s figure depends onbatch_size.at="source"deliberately matchesevaluate()’s pooling so that the argument changes the grid and nothing else; the two poolings differ by 4e-5 on six similar cases and by more on unequal ones. Filed asmaju116/rplatypus#196rather than changed here, because changing it restates every number this project has published.- The warning cannot be narrowed to physical extent, and does not need to be.
target_spacinglives on the data spec, so every model in oneevaluate()shares it and the extent differs only byload_shape, which the warning already compares. The case that motivated the narrowing - three arms at oneload_shapeand three spacings - is three separate runs, which one engine never sees side by side.at="source"is what makes those comparable, because the files’ grid is shared by construction.
[0.8.0a31] - 2026-10-24
One defect, and it is the package disagreeing with its own naming convention. pyplatypus#256.
Fixed
A checkpoint named
.safetensorswas written as a torch archive and then refused by the reader its own extension had selected.model_checkpointcalledtorch.savewhatever the path said;load_intochosesafetensors.load_filewhen the suffix was.safetensors. So the round trip failed withSafetensorError: Error while deserializing header: header too large- an error about a header, raised on a file that has none, and naming neither the cause nor the field that caused it.The configuration that breaks is the one in this package’s own guide, on both sides:
- {name: model_checkpoint, monitor: val_iou, path: runs/best.safetensors}appears inguide.qmdand in the R package’sconfigurationvignette. Every published set in the registry is.safetensors, so a person naming a checkpoint that way is following the convention this package teaches. Found while writing#202’s example, which had to work around it with a.ptand a comment.Fixed in both directions, because they are not alternatives:
save_state()writes the format the extension names, and is now the one writer -export_weights()and the checkpoint callback had been two, which is the defect stated from the other end.read_state()reads what the file is, from the first bytes: a zip is a torch archive, an 8-byte header length followed by{is safetensors. So a file written by an older version of this package loads under whatever name it was given, and renaming a file never changes whether it can be read.- A file that is neither now says what it begins with, instead of letting a library report a header that was never there.
Three mutations, each caught: a writer that ignores the extension fails 3 tests, a reader that trusts it fails 2, and a reader that returns
{}rather than refusing fails 1.And the same defect turned out to be inside torch, one layer down.
torch.loadreads the name as well: on torch 2.14.1 a path ending.safetensorsis forwarded tosafetensors.torch.load_file, whiletorch.savestill writes a zip under that name - so the first fix failed every CI job on a suite that was green here, where torch is 2.7.1.read_state()handstorch.loadan open file rather than a path, because a handle has no name to dispatch on. The fixtures were rebuilt the same way: an archive is written to a.ptand renamed, so the test does not depend on which side of torch’s own disagreement wins, and it asserts the file really is an archive before reading it.
Changed
model_checkpoint’spathdescription says the extension decides the format. The R package’s prose for it is unchanged until its pin moves, which is when the field-prose ledger asks.
[0.8.0a30] - 2026-10-23
Two things a table and a writer could not say, and the second one is 0.8.0a29’s own half finished. pyplatypus#251, maju116/rplatypus#187.
Added
evaluate()says which grid each row was scored on, and warns when the rows do not share one. Each model is scored through its own loader, so a model atinput_shape: [512, 512]is measured against a truth reduced to 512 while a model that tiles 2048 is measured against the truth as stored. Both numbers are a real Dice of a real prediction against a real mask, and they are not answers to the same question.Measured on retinal vessels: that difference reported a resized model at +0.0187 where the honest figure was +0.0033 - the reported figure 5.7 times the real one - and the bias has the opposite sign on clDice, because upsampling a prediction smooths it and a smoothed vessel agrees better with a skeleton and worse with a boundary. So a comparison reporting one of the two metrics is wrong in a direction set by which one it picked.
The
load_shapecolumn is permanent and the warning fires only when the grids differ, which is the split that keeps a warning worth reading. It sits beside the metrics for the same reasonloss_functionsits besideloss- it is what decides whether two rows may be compared, and a table without it cannot be read correctly a month later. A string rather than the tuple, because this table crosses into R as a data frame and a list column is not plain data; the test that says so caught it on the first run.Nothing here rescores. Putting two models on one grid is a thing to ask for rather than to do silently, and it is not offered yet -
rplatypus#187carries that decision.save_volumesaccepts a label map, not only channels-last probabilities. The R package’spredict()returns class indices where this one returns probabilities, so forwarding meant expanding a label map back into one-hot - a gigabyte of float32 for a 512-cubed volume - in order to collapse it again.#251, and it is what letsrplatypus::save_volumes()forward and the copy in that package’s shim be deleted.A label map skips the overlap refusal, and that is not a hole: the refusal protects the collapse, because an argmax over channels silently picks one of the classes a voxel is in. An integer per voxel cannot express an overlap in the first place.
A bare rank-4 array is refused rather than guessed at: a stack of label maps
(n, d, h, w)and one volume’s channels(d, h, w, c)have the same rank and nothing in the array says which.save_class_masksnames the same ambiguity for pictures and the R package resolves it the same way, so a caller meets one rule rather than a third.save_class_volumesstill takes channels only, because a binary file per class is a question about channels and a label map has none.
[0.8.0a29] - 2026-10-23
One writer, and it is the one this package’s own refusal has been telling people to use since 0.8.0a23. pyplatypus#249.
Added
save_volumesandsave_class_volumes: a predicted volume written as NIfTI onto the geometry of the scan it came from. Integer labels,int16, withreferencerequired rather than optional because there is no sensible affine to invent.The affine is the point. A mask array on its own cannot be laid over its scan: every viewer, every registration tool and every volume in millilitres reads position and spacing out of it, and a file carrying the wrong one is either silently misplaced or rejected. The reference is read through
_load_canonical, the same functionread_volumeuses, because the reader reorients every volume to the closest canonical axes - so a prediction is in canonical space, and writing it with the file’s stored affine would produce a mask reflected or transposed with respect to its scan, opening in any viewer without complaint. The test that earns its keep writes a scan stored the other way round and demands the mask read back equal; mutated to use the stored affine, it fails along with the affine test beside it.save_volumesrefuses an overlapping prediction rather than taking theargmax, which isonehot_to_colours’s refusal one dimension along: a label map holds one integer per voxel, so a voxel in both the core and the whole tumour would be written as whichever channel read higher. Those areregions, andsave_class_volumesis where they go - one binary volume per class, which is the writer BraTS actually needs, sinceregionswas motivated by a dataset that stores its overlapping regions as volumes.It also refuses case names that repeat, which is not a theoretical tidiness: volume datasets keep one directory per case with the same
ct.nii.gzinside each, so names taken from the sources collide, every mask is written to one path, and the count of written paths is still right. Losing five masks of six while reporting success is the worst outcome available here.
Fixed
save_class_masks’s refusal now names functions that exist. It has said “write each channel as NIfTI with the geometry of its source instead” since0.8.0a23, and the only way to follow that instruction was to leave this package. The same shape as#230and#231, one step worse: those were promises about this package’s own surface, and this was an instruction a reader could not carry out at all.
Where this code came from
Not written from nothing. rplatypus/inst/python/platypus_shim.py has carried a correct write_volumes since the volume work landed - Python, shipped inside the R package, doing a thing this package’s own reader is half of. A pip install pyplatypus user never had it. The shim’s copy is the one to delete when R’s pin moves to this release; two implementations of an affine decision is the shape that keeps costing this project.
[0.8.0a28] - 2026-10-16
Two features and one lesson they share: a mechanism that existed twice, and a mechanism that existed once and was reached through a list somebody had to remember.
pyplatypus#236 - what a published file of instance weights may fill in for a reader, and the sentence that explained why it could not. pyplatypus#91 - one binary mask file per class, which is the half of multilabel segmentation that 2026-10-12’s decision deferred.
Added
An instance model adopts
architecture,blocks,filtersandseparationfrom the weights it names, where the specification stayed silent - the mechanism the semantic engine has had since0.8.0a13and the detection engine since0.3.0a12, now with the one entry this task cannot be read without.separationis that entry and it is the first adopted value that is not a shape:dsbowl-instancesis a rim at width 2, which is a training decision rather than a geometry, and no reader can guess it. It is adopted as a block built from the sidecar’sseparation_settingsand then re-validated with the rest of the model, so an adopted value faces every check a written one does. The engine prints what it took - the argument for adopting a training decision at all is that the reader still sees it, and the run record carries it as if written.What this cost a reader before, measured by writing R’s instance vignette: the shortest useful thing anybody could do with the published weights named four of this model’s fields, and the only place three of them are written down is a model card.
u_net("objects", input_shape = c(256, 256), blocks = 4, filters = 16, separation = separation_rim(width = 2), weights = "dsbowl-instances", fit = FALSE)is now
u_net("objects", input_shape = c(256, 256), weights = "dsbowl-instances", fit = FALSE)separation_settingsis written by the engine into every instance weights file it exports.dsbowl-instancescarries it because its publishing script added it by hand, so an adoption reading that key would have worked for exactly one file in the world. It stays out of the fingerprint’s comparison on purpose: a 2-pixel rim is both the right shape and the right meaning for a model asking for 3, which is the ordinary way to start one run from another.classes_from: one binary mask file per class, the fourth way of saying what a mask’s classes are and the only one that can express classes which overlap independently - a vessel crossing an organ, or two annotators’ masks of the same structure. One pattern per class, in class order, matched against a sample’s mask files through the same matcherchannels_fromuses: exactly one file per pattern, no file matched twice, no file left out.pyplatypus#91, which has been open since 2022 and is this half of it; the author’s decision of 2026-10-12 was nested regions first, and deferred this rather than dropping it.The whole feature is a reader. Everything from the target onwards arrived with
regionsin0.8.0a14and readsdata.multilabel, which this naming now also answers: a sigmoid per channel, the binary forms ofcceandfocal, metrics thresholding each channel, a prediction that is a stack,save_masksrefusing an overlapping prediction andsave_class_maskswriting one file per class. What was missing is the step before it.unite_maskstakes the element-wise maximum of a sample’s mask files - the Data Science Bowl ships one per nucleus - and that maximum is exactly where per-class identity is destroyed: two overlapping annotations become one blob and nothing downstream can tell there were two. The test that carries this release is the control for it: the same two files, united, are one blob with two values; coded, they are two classes and their overlap.One integer per voxel, still. The coded form sets a bit per class, so tiling and augmentation are untouched - both operate on a single-channel array - and the expansion to channels happens in the last step before the loss, where
np.eye(n_class)[classes]and the regions’ table already live. This is the third expansion and the only one that is arithmetic rather than a table: a table of combinations would need two to the power of the classes, where the regions’ table needs one row per label value. Lossless to 62 classes in an int64 and refused above that rather than wrapping into a class nobody asked for.The threshold for in this class is above zero rather than a midpoint, which is the decision in it worth not re-taking: these files arrive as both 0/255 pictures and 0/1 label maps, and
>= 128reads every voxel of the second kind as background - a whole dataset silently empty, scoring a Dice of 0 with nothing to say why._class_fingerprintrecords the patterns, the way detection records its class names: two independent classes read from two files and two exclusive ones read from a colormap are the same count and the same head, so weights from one read back as the other would label every channel wrongly and answer plausibly.n_classalone cannot tell the four namings apart, which is why the naming itself goes into every run record and every weights sidecar.
Fixed
InstanceEngine._load_weightsexplained the absence of all this by a fact that had stopped being true. Its docstring said there are no published instance weights, so there is no registry entry to readblocksandfiltersout of - true when it was written, and ended bydsbowl-instancesone release later without anybody noticing. A declaration beside a mechanism that no longer describes it, which is the same shape as#230and#231, and found the same way: by writing the documentation a reader would follow.
Changed
separationis no longer required outright: it may be omitted whenweightsnames a file that records it, and that permission is paid for in two places rather than assumed in one. The specification refuses the omission when there are no weights at all, which it can check without resolving anything; the engine refuses a file whose sidecar does not record the separation, which needs the registry and therefore cannot live in a layer that must be validatable without a download. In the window between the two, asking a model what its head predicts answers with a sentence naming the file rather than with an attribute error on a field nobody wrote.decodeis deliberately not adoptable. It is the reader’s question rather than the file’s property: one trained file answers it three ways - 0.5445, 0.5390 and 0.4822 on the published instance weights - and the sidecar lists every decoding it was measured with, so adopting from that list would silently pick whichever name came first.One adoption mechanism instead of two copies of it.
_adopt_from_weightsexisted twice, character for character apart from a type hint, inEngineandDetectionEngine; this release needed a third with one asymmetric entry. It lives onEngineBasenow and each engine declares onlyADOPTABLE, which became a mapping of field to the key the sidecar records it under - the two names differ exactly once, and that is the whole reason for the shape.One matcher, two nouns.
match_channelstakeswhat=and says “class” where a class is what it matched. Every guard is the same for both fields and the only difference is whether a mismatch mislabels a measurement or a class; a second copy with the other noun is the shape §3F of the workbench’s notes is a list of.Both multilabel namings are named by the refusals that mention one.
lovaszand a writteninclude_background: falseare refused forclasses_fromexactly as forregions, and the message now names whichever field was written - a refusal that saysregionsto somebody who wroteclasses_fromsends them looking for a field they have not got. Same for the warning about unmatched voxels, which stays suppressed: neither naming has a background channel, so on a small target the fraction sits near 1 and is the correct answer.One place reads a sample’s masks, instead of the copy
_loadandinspect_maskseach had. The third naming would have made it three, and the read is not where either of them has anything of its own to say - which is also what givesinspect_masksits answer for free here: a pattern matching a file that is empty in every sample read is a channel of zeros, andmissing_classesreports it by class with the pattern quoted.
Still open
- The R half.
segmentation_data()enumerates its parameters, soclasses_fromis anunused argumentthere today, and R’s exclusivity check has to become four-way - which is a code change rather than a pin bump, measured onregionsand recorded onrplatypus#152. Engine first, published, then R:pyplatypus#91stays open for it, and this release does not pretend otherwise.
[0.8.0a27] - 2026-10-16
One line, and it is a defect in 0.8.0a26 found by answering a question about it rather than by a test. A flag on the metric replaces a list of names, and the two layers that had the answer separately now read one.
Fixed
A tiled run accepted a callback watching
val_surface_dice, which its epochs cannot produce. The trainer decides what an epoch reports by asking the built metric (metric.accumulates); the specification decided what a callback may watch from_WHOLE_MASK_METRICS = frozenset({"cldice"}), a list of names inspec/models.py. Sosurface_dicearrived in0.8.0a26on one side of the question and not the other, andmonitor: val_surface_dicebesidesplitswas accepted, trained for an epoch and then raisedKeyErrorout ofstate.logs- whichEarlyStoppingindexes directly - with the epoch already paid for.The fix is not the missing name.
whole_maskis now a class flag on the metric component, the shapecontinuousandsupports_multilabelalready have on a loss, andmonitorableasks the component instead of a list. It stays in the specification layer and imports nothing, sotests/spec/test_spec_layer_is_light.pyis unmoved: the reason the list existed was to keep torch out of the spec, and a flag on the spec’s own class does that without being a second place for the answer to live.A test pairs the two answers, which is the part that outlives this release: for every metric the configuration offers, the component’s
whole_maskmust be the negation of the built metric’saccumulates, with a control asserting both values actually occur - a pairing is no evidence in a package where every metric answers the same way. The three tests that cover the tiled case were each written forcldiceand are now parametrised over the metrics that say they are whole-mask, so the next one is covered by arriving rather than by somebody remembering three files. §4’s passing test whose fixture never contained the case, twice in two releases.Nothing else changes:
surface_diceandcldicewere always measured per case byevaluate_caseson a tiled run and always absent from its epoch history, which is what both docstrings said while the specification disagreed.
[0.8.0a26] - 2026-10-15
Two of the four issues in the “Losses and metrics” milestone, and the other two are answered rather than built - both of them were filed with the measurement that says not to. maju116/rplatypus#113 and #114.
Added
surface_dice, a metric: how much of each boundary lies within a tolerance of the other.rplatypus#113. The third question this package can ask of a mask, after volume (dice) and connectedness (cldice): how far wrong is the edge. The volume vignette ended on a model at Dice 0.88 whose volumes were 12% to 23% too large, and this is the number that says so directly rather than being inferred from two columns that disagree - and it is whatboundaryoptimises while nothing here reported it, so that loss was being judged by the metric it exists to improve on.Normalised surface Dice as published (Nikolov et al., 2018), symmetric: the truth’s surface near the prediction is the boundary’s recall, the prediction’s near the truth is its precision, and one ratio weights them by surface size.
tauis required and has no default, because a tolerance belongs to the structure and the dataset - conventionally the inter-observer variability for that structure. It is in millimetres whentarget_spacingputs the samples on a common grid and in voxels when it does not, which is the same pair of answers the signed distance map gives and for the same reason. The only metric here that reads the spacing, which is why it belongs in a package that carries one: a 0.5 mm and a 2.5 mm acquisition are not comparable in voxels at all. The spacing reaches it the waymultilabelreaches the others - the builder joins the spec’s tolerance to the data’s voxel - andInstanceDatahas notarget_spacingfield, so an instance run measures in voxels and says so.Written as a dilation rather than a distance transform, and measured. A voxel is within
tauof a surface exactly when a ball of radiustaucentred on it contains a surface voxel, so the question is a morphological dilation by that ball - which costs the ball’s volume per voxel where a transform costs the whole image whatevertauis:256x256, batch 8, two channels 2.7 ms on the GPU 41 ms on the processor 128^3, two channels 23.8 ms on the GPU 372 ms on the processor the same by scipy's transform 948 ms on the processor#113worried that a distance transform at 128^3 costs 710 ms, which is the whole epoch budget; this is thirty times less and can therefore run every batch. Verified againstscipy.ndimage.distance_transform_edt- a different algorithm, so agreement is evidence rather than a shared bug - exactly at four tolerances over isotropic and anisotropic spacings at both ranks, and the whole metric against a scipy-only implementation to 1e-6 over thirty pairs.include_backgrounddefaults to False here, and for a measured reason rather than the usual one: the background’s boundary is the foreground’s boundary plus the edge of the picture, and that edge agrees between any two masks whatever the model did. Measured on four random pairs attau2, background 0.6110-0.7030 against foreground 0.5583-0.6266 - higher every time. That is agreement on the field of view. For the same reason a mask running off the edge has no surface there, which also makes two solid masks score 1.0 rather than 0/0.generalized_dice, a loss: classes weighted by the inverse square of their volume.rplatypus#114, in bothlossandboundary’sregion.The usual argument for it does not hold in this package and the help page says so. Generalized Dice is introduced as a fix for Dice being dominated by the background;
dicehere is a mean over the class channels, so a lesion in 1% of a frame already carries the same weight as the 99% around it. Measured on a 1% target with two predictions - one finding the lesion and leaking a false positive of equal size, one missing it entirely and getting the background perfect:dice 0.1658 finding 0.4731 missing prefers finding by 0.3073 cce 0.1600 finding 0.1600 missing indifferent cce_dice 0.1629 finding 0.3166 missing prefers finding by 0.1536 generalized_dice 0.3278 finding 0.9511 missing prefers finding by 0.6233So what it adds is weight beyond an equal share - 1 to 9801 on that target rather than 1 to 1, and twice the margin between finding the lesion and missing it. And the objective that is genuinely dominated is the per-pixel half of
cce_dice: toccea false positive and a missed lesion of the same size are the same number of wrong pixels, which is the indifference in that table. The claim in the issue was inherited from the literature and is wrong about this implementation; it is corrected rather than copied, and the table is held by a test.Two decisions, both in the docstring and both tested. An absent class has no volume and so an infinite weight; it is given the largest finite weight in its sample, as the published implementations do, so inventing a class that is not in the picture costs as much as missing the rarest class that is - weight zero would make it free. A sample with nothing present at all has no finite weight to borrow, so its weights are flat and it is scored exactly as
dicescores it; without that fallback every empty-truth sample reads a perfect 1.0 and a model predicting a lesion on a clean frame is never told.And the weights are rescaled to a mean of one, which the published quantity is invariant to and which is what makes
smoothmean here what it means everywhere else: unscaled, the weights are of order 1/volume^2, so asmoothof 1.0 is not a small regulariser but the whole numerator. The control caught it - with three equal classes the coefficient read 0.855 where pooled Dice reads 0.355. With the rescaling, flat weights are exactly Dice pooled over the classes, which is a test rather than a hope.Where each may be named, asked of the configuration rather than of the union. A loss in the union that every spec refuses is a name in a listing and nothing else, so this is tested through
from_dict:generalized_diceis accepted as a semantic model’s loss, as an instance model’s loss for the mask, and asboundary’s region term - the combination worth having, since the case that motivates this loss and the case that motivates that one are the same picture. A flow block refuses it by name, because a flow field is a vector per pixel and this scores classes, and a detector refuses it for the reason it refuses every loss.surface_diceis a metric at both segmentation tasks andobject_detectionlists no metrics at all.
Changed
available_losses()is 11 and 14 where it was 10 and 13, andavailable_metrics()is 5. Nothing was edited to make that happen - both read the pydantic unions, which is what that design is for - but six pinned counts failed and each one is a place somebody had to look: the union’s member count beside the two loader flags (looked: a region loss on one-hot classes, so neither flag), the semantic set written out by hand, two task listings, the component count in the description test, and two doctests. The R package’s own listing test pins 13 and will fail when the pin moves, which is the ratchet working.
Not built, and why - the other half of the milestone
cbDice(rplatypus#115) stays a question. The issue blocks it on a measurement and says so in as many words: “if clDice is high while Dice is low - connected but the wrong calibre - that is this issue’s evidence, and without it this stays open.” The measurement exists now and points the other way: on FIVES, 200 held-out images, Dice 0.8789 against clDice 0.8330 - the skeletons agree less than the volumes, which is breaks in thin vessels rather than the wrong calibre. Building it would be building for a problem nobody here has demonstrated.DIoU,CIoUandEIoU(rplatypus#116) stay unbuilt, which is what that issue was filed to record.gioualready lost tooffsetson this data - per-seed spread 0.000116 against 0.006863, sixty times tighter on the exact quantity GIoU targets - andanchor_mean_iouwas 0.877 in all six runs, so the regime the whole family exists for is never entered. Three more names meaning roughly the same thing is the argument that kept the weights registry to one entry when four architectures scored within 0.0030.
[0.8.0a25] - 2026-10-15
Added
dsbowl-instances, the fourth published weights, and the first whose score is not one number. A U-Net trained to tell touching nuclei apart on BBBC038v1 - interior, rim and background,separation: rimat width 2 - pinned in the registry atfd7bdc86.weights: dsbowl-instancesfetches it, the sidecar refuses a model it does not belong to, and nothing about the numbers can change under the name.Measured on the same 134 held-out images
dsbowl-unetreports, seed 0, 120 epochs, 102 minutes on one GTX 1070. Instance average precision, one score per image, and the mask all three rows share:nearest_seed 0.5445 sd 0.2554 5378 objects found of 5999 watershed 0.5390 sd 0.2532 5378 objects found of 5999 connected_components 0.4822 sd 0.2440 4914 objects found of 5999 foreground dice 0.9118One file, three scores, and the registry description is written so that neither can be quoted without the other. The network predicts channels; turning them into objects is a separate step and
decodeis a list, soevaluate()returns a row per decoding on one forward pass - a second decoding of these 134 images costs 1.41 s against the 102 minutes. The spread between the best and the worst row is 0.0623, about seven times this configuration’s run-to-run spread of 0.009, so a headline number without its decoding would be a number about whichever decoding happened to run. A test holds the description to its own arithmetic: every score in it names its decoding, the signal’s claimed worth is the gap between the rows quoted, and the perfect-mask figure beside it is the larger of the two.What the entry says about the signal is the milestone’s finding and not a sales line.
connected_componentsignores the separation signal entirely, so the signal is worth +0.0623 here, while substituting a perfect semantic mask into the same route is worth +0.2398 and a perfect mask through connected components caps any model at 0.7655. The mask is the limit on this data by nearly four to one. Published anyway, because the alternative is that the measurement exists only in a closed milestone and the weights it was taken on cannot be loaded by anyone who wants to argue with it.examples/publish_dsbowl_instance_weights.py, which produced them. It reads its recipe out ofexamples/data_science_bowl_instances.yamland the three recorded scores out of#215’s table rather than restating either, selects the one model through the same helpercompare_instance_separations.pyuses, and uploads nothing.Its publication gate is a two-sided band, calibrated at both ends: every decoding has to land within +/-0.027 of the recorded value - three times the 0.009 spread - and a run far above the band is refused as well, because that is a changed recipe rather than a better model. The refusal is diagnosable: the measurements are written before the band is read, so a refused run says which decoding missed by how much. Its positive control is a real refusal - a three-epoch run of the same script named all three gaps and wrote nothing.
Four more controls, each one proven able to refuse:
- The split is checked by the number a different 134 could not produce, 5999 ground-truth objects, not by its size. 134 directories is the weak half of that fingerprint and
dsbowl-unet’s card is why: the 134 on this disk were once a different 134 and the discrepancy was 0.01 of Dice. - The data is fetched from the Broad rather than read off this disk, and the local Kaggle copy was proven byte-identical to it first - 670 cases, images and per-object masks, sha256 - so the licence chain runs to BBBC038v1’s CC0 rather than through a competition’s terms.
- One model decoded three ways reports one mask, asserted rather than assumed, because a table whose three rows disagree about
foreground_diceis a table of three models. - The sidecar cannot shadow what the weights say they are for. The extra carrying the separation’s settings is named
separation_settings, and a check derives the reserved names from the spec’s own fingerprint and refuses a collision. Namedseparationit would have overwritten the fingerprint’s"rim"with a dict and made every later load of the file refuse it - caught before the training run rather than by a load failure afterwards.
- The split is checked by the number a different 134 could not produce, 5999 ground-truth objects, not by its size. 134 directories is the weak half of that fingerprint and
The published name was loaded the way a user reaches it, before this entry was written.
weights: dsbowl-instanceswithfit: false, resolved through the registry, downloaded from the pinned commit into anHF_HOMEthat had never seen it, sidecar checked against a model built from the specification, and scored on the same 134 images: all three decodings, the object counts and the foreground Dice came back identical to seven decimals, the largest disagreement 0.00e+00. The same file into a model withfilters: 32orblocks: 3is refused by field name, which is the control that the acceptance means something.The Hub card gains its section and two older lines are corrected. One card holds one section per model; this one is generated from the run’s own measurements and a check holds every figure in it to the sidecar beside the weights, with the same check aimed at
dsbowl-unet’s section as its control. The corrections are the R example’slibrary(platypus), which has been the wrong name since the package was renamed on 2026-10-14 and was the one line a reader would have copied and had fail, and atags:entry for what this file actually does.What R needs from this is the pin and nothing else.
available_weights()reads the registry from the engine, so a fourth published name appears on the R side as soon as the pin moves - the cheapest kind of R half there is, and the whole value of this release to an R user arrives through it.
[0.8.0a24] - 2026-10-15
A declaration beside a mechanism that does not describe it, in the one place this drawing exists for. _colour_index’s docstring said the wrap past the end of the palette “is said rather than hidden - overlay_instances reports it”, and overlay_instances reported nothing: grep -n warn pyplatypus/plots.py returned no hit at all. The sentence was right about what should happen, which is why this is a warning and not a deletion.
Fixed
overlay_instances()now warns when the picture needs more colours than the palette has, naming how many it needs, how many there are and how many objects are drawn in a neighbour’s colour.maju116/pyplatypus#231.The wrap is the one case this figure answers its own question wrongly in. Its subject is where does one object end, every other colour repeat is deliberate - a colour may repeat across the picture as long as it never repeats between neighbours - and a wrap is exactly the case where it does repeat between neighbours. Provably, rather than usually: a slot is only past the end of the palette once every colour before it was taken by a neighbour, so the fold lands on one a neighbour already holds and never on a free colour. The warning says that to the reader, so a test measures it rather than leaving the claim to the docstring that made this defect.
Not reachable on anything measured here - the hardest of 670 Data Science Bowl cases needs 3 of the 8 default colours, with 6 neighbours for the worst single object - which is exactly why nothing noticed the gap for as long as the function has existed. A guard for a picture nobody here has is still worth having when the alternative is a figure that draws two objects as one and says nothing.
Two things found while writing it, neither of them the warning:
- The fold is inside the greedy and that is not cosmetic. Hoisting it out, so the colouring is computed in true slots and folded at the end, reads cleaner and changes the picture: measured on 440 overlays over 55 label maps, 234 of them differ. Folding in the loop means a later neighbour avoids the colour an object is actually drawn in, so one wrap does not cascade into the rest of the picture. The R package folds inside the loop too, so the clean-looking version would also have been a divergence between the two. Found by a control recorded before the change rather than by reading the diff - and the first attempt at this fix was that version.
- A
Warns:section cannot be published from here, which is why nothing in this package had one and why the warning is documented as prose.quartodochas no renderer for it:uv run quartodoc buildraisesNotImplementedError: Unsupported type: DocstringSectionWarns, so thedocsjob fails and the site cannot be built. Measured both ways - the section fails and the prose builds - because the four gates here do not include the reference build, and the absence of anyWarns:in the package read as “no convention” when it was “no renderer”. _colour_indexcannot report what it was said to report, and now does not claim to: it returns which objects wrapped, andoverlay_instances- the function a person called, and the only one that knows the palette it was given - is what warns. The requirement in the message comes from the same function asked for a colouring with no palette at all, which is the number a short palette needs and cannot be read off a folded run.
Changed
overlay_instances,overlay_instance_agreementandflow_to_coloursare now pairs rather than three functions with the same name on two sides. The R package drew neither untilmaju116/rplatypus#154; it draws both now, in its own code, because drawing there touches no Python on purpose. Sotests/test_reference_groups.pypins where both are filed, which is this side’s half of §3F’s pair - the other half is in R’stest-reference-groups.R.Nothing in the wheel changes for this one and it needed no release of its own; it rides with
0.8.0a24. Worth an entry anyway, because the subsequence test cannot catch what this one does: a name absent on one side is not a name filed differently, so until R had them there was nothing to disagree with and the pair could not have existed.What holds the rule rather than the filing is on R’s side alone and has to be: it draws the same pictures with both packages and compares them pixel for pixel. The palette was already mirrored, so the two could have agreed about which eight colours exist while disagreeing about which object gets which. See
maju116/rplatypus#154.
[0.8.0a23] - 2026-10-14
A writer the package had promised twice and never had, and the test that finds the next promise of that kind. onehot_to_colours has refused an overlapping prediction since regions shipped in 0.8.0a14, and its refusal ends “overlapping classes are written one file per class, not as a colour map” - nine releases in which nothing wrote that file.
Added
save_class_masks()writes one binary picture per class, which is what that refusal points at and whatRegion.name’s owndescription=has been naming since0.8.0a14.<case><suffix>_<region>.png, modeL, 0 or 255, in channel order - which is the order the regions were written in and the order every per-class score is reported in.Four decisions in it, each one a failure this project has already made once in another shape:
- A region’s name is not a filename.
whole tumourbecomeswhole_tumourthroughclass_filename, and two names that become the same filename are refused rather than written: one file would hold the second channel, the first would be silently gone, and the number of returned paths would still be right. That is the quiet shape, so it is the one that is refused by name. - The name is not lowercased.
Coreandcoreare one file on one platform and two on another, and the package already has one case-sensitivity story without a second. - A channel nothing reaches is an empty picture, not a missing file. A missing file reads as the run did not produce that class; an empty one reads as it did and the answer was nothing. Those are different findings and only one of them is true.
- A volume stack is refused. A PNG carries neither voxel spacing nor orientation, so a volume written as pictures cannot be laid back over the scan it came from. Only rank 5 is refused, because a single volume
(d, h, w, c)and a stack of images have the same rank and nothing in the array tells them apart - the same limitsave_maskshas on the R side, and it is stated rather than guessed at.
thresholddefaults to0.5, which is what every metric in the package thresholds a multilabel channel at. A different number writes a picture that disagrees with the score printed beside it, and the docstring says so.The class names arrive as
classes=rather thannames=, decided by §3A before the function was released: R’ssave_masksandsave_volumesalready usenamesfor the files they write, and a sibling writer where the same word means the classes is the quiet kind - a call copied from one to the other would pass filenames as class names, the counts would match whenever they happened to, and nothing would refuse it.Filed under Masks and volumes in the reference, which is the group R files
save_masksandsave_volumesunder and which held nothing here until now. The shared order already carried the title;tests/test_reference_groups.pynow pins the name’s placement in both suites, which is the fifth such pair.- A region’s name is not a filename.
Fixed
The schema’s prose named two functions that do not exist here, and now a test says it cannot.
tests/test_schema_prose_names.pyreads everydescriptionout ofspec_schema()- the stringstools/build_config_reference.pypublishes as the configuration reference - and asserts every`name()`in them resolves to something this package has. It found the two it was written for and one it was not:save_class_masks, named inRegion.nameand built above. The name was decided onmaju116/platypus#91and written into the schema before anything existed; nothing read the sentence again for nine releases.training_history(), inCsvLogger.pathand its class docstring, which is the R package’s function. True for the R reader it was written with in mind and a dead end for the Python reader the generated page is for. Both now sayfit(), which is what this package answers the same question with.
§4’s “an instruction addressed to a human is code nothing runs”, in the one place this project generates documentation out of code. The test is the engine’s because the schema and the page are the engine’s, and it carries the usual guard against passing by looking at nothing - it asserts it found more than 150 descriptions and more than five names before asserting anything about them.
Documentation
The guide has a section on overlapping classes, which
0.8.0a14shipped the field for and deliberately did not document in narrative form: Overlapping classes instead of one per voxel, between the augmentation section and the instance one, becauseregionsis stillsemantic_segmentationand what changes is what a channel means. The page’s section list is pinned by a test here and the same list in R’s suite, so this lands in both repositories or neither;maju116/rplatypus#152is the other half.The numbers in it are measured rather than asserted: the same masks are four classes written as
labels: [0, 1, 2, 4]and three channels written as the three BraTS regions, and a voxel whose value is4belongs to all three at once. The YAML block is validated bytest_every_configuration_in_the_guide_is_acceptedlike every other block on the page - checked by breaking it, which fails that test at its line rather than passing quietly.The section says one voxel gets one colour and a voxel here may be in three classes, and it now names what writes such a prediction out:
save_class_masks(), added in this same release. It was written without that sentence, because the function existed in neither package at the time and the honest thing was to say nothing rather than to name it;maju116/rplatypus#152is where the decision to build it was taken.
Changed
_brand.ymlnow names the test that holds its two copies together, because as ofmaju116/rplatypus#160there is one. It is on the R side alone - it fetches this file from this repository’s default branch and compares it line by line - for the reason the field-prose ledger is one-directional: the engine owns the look, so R’s copy is the copy. Nothing here changes but the comment, and nothing is in the wheel either way.The R package is
rplatypus. It wasplatypusuntil 2026-10-14; the name collided withPlatypus, archived from CRAN on 2026-02-02, which archiving does not release, so it was renamed rather than waiting on a reserved name. One name per language, beside this package on PyPI. Nothing in the wheel changes: this is the engine’s own links, its_brand.yml, and thecitation("rplatypus")the generated Citation page prints - §3E’s shape, a change R needs nothing from, said here rather than only in a commit message.The GitHub repository was renamed with it and the former addresses redirect, so the issue cross-references in the entries below are left exactly as they were written. They name
maju116/platypusbecause that is what it was called when they were written, and they still resolve.maju116/platypus-weightsis a different repository - the published weights on the Hub - and is untouched. Worth saying because a rename done by pattern would have taken it, andresolve_weightswould then look for weights nobody published.
The second entry under this heading and the same reason as the first: it records an outcome, and neither examples/ nor the guide page is in the wheel. What is in the wheel is one docstring, so nothing here changes what a run does. What is new is that the outcome includes two corrections to things this project had written down - a column it printed, and a claim about a table it builds.
Measured
Both separation signals, five decodings, one command (#215, the instance milestone’s deliverable).
examples/compare_instance_separations.pyagainstexamples/data_science_bowl_instances.yaml, 185 minutes on one machine, scored on the 134 validation cases--expect-casespins by name:model separation decode class dice AP objects truth rim rim nearest_seed 0.8550 0.5442 5414 5999 rim rim watershed 0.8550 0.5396 5414 5999 rim rim connected_components 0.8550 0.4767 4875 5999 flows flows follow_flows 0.9464 0.5174 5400 5999 flows flows connected_components 0.9464 0.4512 4849 5999The signal is worth +0.0676 to the rim route and +0.0661 to the flow route, over each route’s own connected-components row. Both reproduce what was measured separately - +0.0640 in
0.8.0a15’s sweep and +0.0680 in #212 - so §4bq’s reading stands: a perfect mask is worth +0.2398 and the mask is the limit by a factor of 3.6.The noise floor is measured here rather than borrowed. The flow model was configured identically in both runs of this file and its average precision moved 0.0112 between them, which is larger than the 0.0074 two runs of one configuration differed by in
0.8.0a15’s sweep - so a gap smaller than 0.0112 says nothing on this table, and the rim route’s 0.0268 lead over the flow route is 2.4x it on a sample of two runs.The rim model was undertrained at 60 epochs and is not undertrained at 120, which is why the two models’ epoch counts differ in the configuration and why that asymmetry is a comment rather than a typo. Doubling it bought +0.0451 of average precision; the last twenty epochs of the hundred and twenty bought +0.0018, and the best epoch was 118 of 120.
Documentation
The configuration guide has a section on the third task, in both packages: Instances instead of one mask, between the model’s own fields and detection. It is the §3C rule that a change to how a run is written belongs in the guide on both sides with the same sections, and
task: instance_segmentationshipped in0.8.0a20without it - the guide had zero occurrences of the word.What a reader needs that no reference page tells them: the data block gets shorter (there is no
colormapand nolabels, because the classes are always background and object and the per-object files are what name the objects),separationis one block per model with no default whiledecodeis a list, no value appears in both because one is a noun and the other a verb, and a model’s ownlossscores the mask while aflowsblock carries its own for the vector channels. The section also carries what the task is worth - +0.068 against a perfect mask’s +0.2398 - for the same reason the reference does.Both guides’ YAML is validated by each suite, and the new block is: it was mutated to name
follow_flowsunderseparation: rimand the Python test failed on that line.
Fixed
evaluate()’s own docstring claimed the yardstick is in every model’s rows “whether it was asked for or not”, and it is not.connected_componentsis in the pairdecodederives to when a model stayed silent; a model that writes adecodelist gets the list it wrote and nothing added. The code is right - the engine does not add a row to somebody’s table that they did not ask for - and three pieces of prose were wrong, including0.8.0a20’s own entry, which is corrected in place below with the correction left visible.It went unnoticed because only the kind half had a test.
test_the_yardstick_is_in_the_table_without_being_asked_forcovers the derived pair and says so in its docstring; nothing covered a written list, so the claim about the branch with no test is the one that drifted.test_a_written_decode_list_is_what_you_getis the missing half, and it fails when the code is mutated to make the old sentence true.examples/compare_instance_separations.pyalready kept the yardstick in its own--decodehandling, which in hindsight is the evidence: an example compensating for behaviour the engine was documented as having.The table’s
fg dicecolumn was neither a foreground Dice nor one quantity, and is now calledclass dice. It is the engine’sdicemetric, a mean over the class channels the model’s head actually has: three forrim- background, interior and the rim band - and two forflows, whose metrics are shown the class block alone. So the rim model’s number is averaged against a thin band scoring 0.6857 where its own background and interior score 0.9852 and 0.8721, and reading it across the two models compares two different things.Measured by identical code on both, on the same 134 cases: the binary foreground Dice is 0.9159 for the rim model and 0.9097 for the flow model. Where the column read them 0.09 apart it is 0.0062, and the sign is the other way round - the rim model has the better mask. The control is the Unreleased entry above this one: foreground Dice held at 0.917-0.920 across four rim runs there, which is the family 0.9159 belongs to and 0.8565 does not.
examples/train_instance_separation.py:261had already written the rule down - “against three is not the comparison; foreground against foreground is” - and computes the quantity by hand at line 263. So this is a lesson lost rather than one learnt, which is §4’s “documentation rots in the direction of the work having been done” wearing a column heading. What #215 asked for, a foreground Dice the table can be read across, needs the engine to return one. This entry saidevaluate()has no such column;0.8.0a22below gives it one (#222), and the example prints that rather than a third hand-rolled copy. The two training scripts keep theirs, which is a decision rather than an oversight: they score an empty case as 1.0 where the engine’s column reports it as unscorable, so substituting silently would move a published number’s definition.examples/data_science_bowl_instances.yamlnamed its checkpointsweights.safetensorswhilemodel_checkpointistorch.save- a pickle in a zip, whatever the path says. They areweights.ptnow.export_weights()remains the safetensors path, and naming a pickle after the format this package chose because it is not a pickle is the kind of label that gets believed.
[0.8.0a22] - 2026-10-14
One column, and it is the one an instance table is read across. #222 came out of #215 and was deliberately left out of the instance milestone: the methods were delivered and the measurement taken, and this is a defect in how a result is reported.
Added
evaluate()carriesforeground_diceon every instance row - the binary overlap of anything the model called an object against anything that is one, computed identically whatever the separation signal is. The table already had a mask column and it was not one quantity:dicereduces over the class channels a head has, three forrim(background, interior, rim band) against two forflows, so on the Data Science Bowl’s 134 validation cases it showed the two masks 0.09 apart where they are 0.0062 apart, and with the sign reversed.class diceis the honest name for that one and it stays, beside the new column rather than instead of it, because a rim model’s three class numbers are where a thin band that never learned shows up at all.Three decisions, each written into the function’s docstring because each is worth more than some of the effects this table is read for:
- Both sides binarised, through
read_prediction. That is the one place the channel layout is read - the vectors sit in front of the classes forflowsand nowhere forrim- so the column cannot acquire a second opinion about where the classes start. - Unsmoothed, and an unscorable case says so. The
+1the training metrics carry scores an empty prediction on empty truth 1.0;foreground_dicereturnsNonethere, which is this module’s existing convention -score_casesleaves such a case’saverage_precisionatNoneandsummarise_instancesfilters on exactly that. - Averaged over images, which is how the
average_precisionbeside it is pooled. The training metrics pool over batches with each batch weighed equally, worth 0.0088 on that split, so a row carrying both poolings would hide a difference larger than several it exists to show.
It costs no second forward pass. The number is taken inside
_decoded’s existing loop, once per case rather than once per decoding, which is also what makes “the same for every row of one model” structural:_Decodedcarries the mask number beside the decodings instead of inside each of them.- Both sides binarised, through
examples/compare_instance_separations.pyprints it asfg dice, from the engine’s row. The issue asked for this rather than a third copy of the arithmetic, andtest_the_instance_table_does_not_call_its_dice_a_foreground_dicestill holds the other column’s title, which is the label that was wrong in the published table.
Fixed
tests/test_instance_engine.py’s module docstring said the yardstick is in every row “whether it was asked for or not” - the fourth copy of the claim0.8.0a21’s entry corrected in three places. Found by working in the file rather than by a sweep, which is the argument for the sweep.
Documentation
- The guide says which mask column to read across models, in the section the third task got in
0.8.0a21’s cycle. The engine’s copy ships here because it describes what this release returns; R’s copy is written at the same time and ships with the pin move, because a vignette cannot describe a column its pinned engine does not return.
The R half
Almost nothing, and structurally rather than by decision: R’s score table is the engine’s rows, so the column appears on the R side the moment the pin moves - §3E’s shape, the same one 0.8.0a12 had, where a release R needs nothing from is still a release whose whole value to an R user arrives through the pin. What R owes beyond the pin is one assertion, because a column that arrives untested is the next thing to drift: test-instances.R now names foreground_dice and holds it to one value per model.
[0.8.0a21] - 2026-10-14
One refusal, moved to the class it belongs to. A semantic model’s own loss accepted mse, l1 and smooth_l1, trained with them, and reported a small number for a mask that was half missing (#223).
Fixed
loss: mseon a semantic model is refused, by name and before anything is built. The validator existed and sat onInstanceModel, which is a subclass ofSegmentationModel, while the thing it protects -lossscoring a target of classes - belongs to the parent. So the semantic task had no guard, and nothing downstream supplied one:Enginebuilds the loader withwith_foreground=loss_needs_mask(model.loss)and the trainer hands a third tensor to any loss that asks for one, so a run completed.The number it reported was the good one, which is why this is refused rather than documented.
wheredefaults toforeground, and for a semantic target the foreground is not the background channel - so the objective was evaluated only inside the labelled objects and the background was unconstrained. Measured on eight 32x32 samples whose single object is where the picture is bright, 80 epochs,u_net, a taskccesolves exactly:the model's own loss val_dice val_loss cce (control) 1.0000 0.086507 mse, silent - so where: foreground 0.5367 0.001430 mse, where: everywhere 0.9838 0.055150The middle row is the finding: a validation loss sixty times smaller than the control’s, and the only place the missing half of the mask shows is
val_dice.The last row is why the refusal is a decision rather than a correction of nonsense, and it is recorded rather than buried: an unactivated squared error is a crude surrogate, not gibberish. It is refused anyway, because
lossis the objective on the class channels and an activated regression would be a new loss with its own name and its own measurement - not this family, whose entire content iswhereand whose documentation is about flow fields. The decision is on #223 with the two alternatives it was taken against.Admissibility is still read off the
continuousflag on the loss itself, so a fourth regression loss is refused with nothing edited.InstanceModelnow contributes only the extra clause that names where a continuous loss does belong - the flow block’s ownloss- so that refusal still names both halves.Nothing in this repository used it: no example, configuration, test or fixture builds a semantic model with a regression loss, so the behaviour change costs nothing here. An R caller reaches the same hole through
loss_mse(), which R gains when its pin moves.
Changed
available_losses()answers per task: ten atsemantic_segmentation, thirteen atinstance_segmentation. The three in the difference are the regression family, and at the semantic task they can be named nowhere - a listing that offers what the next validator refuses is a list maintained against a validator, which is whatcontinuousexists to avoid. The instance task keeps all thirteen because aseparation: flowsblock’s ownlossis that same union; which loss goes where is the tree, andavailable_separations()is where the tree lives.The listing-against-schema test now asks the losses of the instance task, because that is the only task whose answer can equal the schema’s
discriminator.mapping: the mapping is per field and cannot express a validator. The semantic task’s shorter list has its own test which names the three excluded losses literally rather than deriving them the way the code does - so a fourth regression loss fails it, and failing is right.R reads this listing through the bridge, so
available_losses()there changes with the pin and the R suite’s count moves with it. Said here rather than discovered: §3E.
[0.8.0a20] - 2026-10-13
task: instance_segmentation: the third task, and the last engine piece of the instance work (#160). Two axes on a model - separation, one per model, and decode, a list - a head whose width is derived rather than stated, and a score computed after a post-process rather than from (logits, target).
What the tag is honestly worth is in its own documentation and it is not flattering. On the Data Science Bowl the separation signal is worth +0.068 of instance average precision at best while a perfect mask is worth +0.2398, so the mask is the limit by a factor of 3.6. connected_components - which ignores the signal entirely - is in the pair decode derives to when a model stayed silent, because it is the row the signal’s row has to be read against, and a perfect semantic mask scores 0.7655 through it. (This sentence read “in every model’s decodings whether it was asked for or not” until the Unreleased entry above corrected it: that was never true of a model which wrote its own decode list.) The capability is real, the ceiling is measured, and both are in the configuration reference rather than in a footnote.
Added
task: instance_segmentation, withInstanceData,InstanceModelandInstanceSpec. Two new fields and everything else inherited:input_shape,channels,blocks,filters,batch_size,epochs,splits, the pretrained encoders, the callbacks and the augmentation all mean what they mean for a semantic model.separation:, a block namedrimorflowscarrying that mechanism’s own settings, which sets the head’s width and which losses are admissible.hvis deliberately not a name: its markers lose to a one-pixel erosion on perfect inputs (0.9382 against 0.9807), so naming it would promise a mechanism #213 measured as absent.decode:, a list of blocks keyed onname-connected_components,nearest_seed,watershed,follow_flows- with each block declaring which separation it can read, sofollow_flowswithseparation: {name: rim}is refused at load time with both halves named. Left unset it derives to the signal’s own decoding plus the yardstick.- The mechanisms’ own settings, inside the block they belong to:
widthunderrim, andmode,lossandweightunderflows. So a setting crossed with the wrong mechanism is not a refusal somebody had to write, it is an unknown key - the first shape of this field wasseparation: rimbesiderim_width,flow_mode,flow_lossandflow_weight, which parses on every model and therefore needed a table of which field belongs to which mechanism and a validator reading it.extra="forbid"was already doing that job for every other key in a specification.modedefaults todiffusionon a measurement (0.9924 decoded againstcentroid’s 0.9478);widthdefaults to 2 on an argument rather than a measurement, and the field says so - the published sweep peaked at 3 pixels of source resolution, which on a 520-pixel case read at 256 is about 1.5 pixels of model input, and a sweep in model pixels has not been run. InstanceEngine, onEngineBase:fit,evaluate,evaluate_cases,predict,predict_instances,export_weights,best_model,dataset,loader.evaluate()returns one row per (model, decoding);evaluate_cases()is one row per case for one decoding, sosummarise_caseskeeps meaning what it means.InstanceDataset, which reads the per-object files as a label map instead of uniting them, and builds the target after the resize, the tiling and the augmentation -pyplatypus#210’s rule, pinned here by a recording augmenter.pyplatypus.instances.targetsandpyplatypus.instances.decode: the channel contract going in and coming back, with a test that a perfect prediction decodes into the objects it was built from. That is the only check that catches a channel swapped between the two, because both arrays keep the right shape and range.available_decodings(), with aneedscolumn read off each decoding rather than written down;available_separations(), with the head width each signal needs derived rather than stated; and a third row inavailable_tasks().examples/data_science_bowl_instances.yamlandexamples/compare_instance_separations.py: both signals and five decodings from one configuration file. This is the test of whether the tag earned its place - the script says where the data is and the engine does the rest.- A refusal specific to this task: a split whose objects have all vanished in the resize. The objects are on disk, the resize removes them, and without the check the loss falls, every metric stays finite and the run learns to answer “nothing here”. Some cases losing theirs is a warning with the count; all of them is an error naming
input_shape.
Changed
Trainer.activateis a method rather than one inlined call, which is whatInstanceTraineroverrides: a flows head is two raw vector channels in front of a block of classes, and a softmax across all of them would return a number, a gradient and no error anywhere.- A dataset answers
foreground_offor its own channels. The loader used to callonehot_to_foreground, which reads channel 0 as background - for a flows target that is the row component of a vector field, and the loss would have been handed a mask of everything. labels_in_test_splitis one function the two mask-reading engines share, rather than the same method written twice.EngineBasediverged twice before, and the second time the fix was written twice on the same night.tests/test_engine_base.pyhas a third column rather than a second file: the thing worth asserting is that the three engines give the same answer, which a file per engine cannot say.- The two hand-assembled instance scripts say what they now are - the record of the measurements they produced, not the way to run one - and the sentence claiming the engine could not derive a flow head’s width is corrected rather than quietly deleted.
Fixed
- The configuration reference published the third task’s
data:andmodels:under the heading “for detection”.short = "segmentation" if tag == "semantic_segmentation" else "detection"was a binary over a set that grew, and the heading-collision test is what caught it rather than anybody reading the page.
[0.8.0a19] - 2026-10-12
Looking at instance results instead of reading their arrays (#214), the trained half of flows (#212), and #213’s cheap test answered before anything was trained for it. All three end in the same place, which is the entry’s finding rather than three coincidences: the separation signal is not what limits instance segmentation on this data. The mask is.
Added
overlay_instances(),overlay_instance_agreement()andflow_to_colours()inpyplatypus.plots. An instance result has no figure today -overlay_maskpaints every object one colour, which is the one thing an instance map must not do - and#159’s four training runs were read entirely off tables.overlay_instancescolours an exact graph colouring and that was an open question on#214, settled by measurement rather than by preference. What a reader needs from an instance map is where one object ends and the next begins, which is adjacency, not identity, so a colour may repeat as long as it never repeats between neighbours. Measured over all 670 Data Science Bowl cases, 524 of which hold touching objects and 5436 adjacent pairs between them: an exact colouring (Welsh-Powell) needs at most 3 of the 8 coloursCLASS_COLOURSalready has - 146 cases need one, 412 two, 112 three - against at most 6 neighbours for any one object. The cheap alternative the issue offered, cycling the palette by object value, paints 550 of those 5436 pairs in one colour: 10.12%. One touching pair in ten drawn as one object, in a figure whose whole subject is whether two objects are two.overlay_instance_agreementmatches objects withiou_matrix, the function the metric uses, and at the same strictness - which is a correction rather than a design note. It matched atiou >= thresholdfor an hour;average_precisioncompares strictly greater, and a merged pair sitting over two equal truth objects lands at exactly 0.5, so the figure would have drawn one hit where the metric counts two misses. Caught by a test written against what the figure means rather than what it draws, and pinned by one. The threshold below 0.5 that the metric refuses is refused here too, in the metric’s own words.Nothing was added to
pyplatypus.style, which is why the R pin does not move for this (§3E): hue-for-direction is the convention optical flow has used for twenty years and not a decision this project gets to make differently, and the drawing style R reads from the engine is unchanged.platypus#154carries the R half.examples/train_instance_flows.py, the second half of#212: the flow target trained and scored, with the pair of oracles that says which half of the pipeline the result is limited by. Sixty epochs ondsbowl-unet’s architecture and the 536/134 directory split, the target rebuilt from the augmented label map on every sample (#210), and the model assembled outsideEnginebecause a flow head is2 + n_classwide and the engine takes its width fromspec.data.n_class- the derivation#160has yet to name. The script says so in its own docstring rather than leaving it to be inferred.134 cases, 5999 objects, 256x256 score objects back foreground Dice 0.9029 flow angle, median of case medians 6.6 degrees AP flows 0.5278 5424 AP connected components 0.4598 4686 same mask, no signal TRUE identity, this mask 0.5941 6138 perfect vectors this field, TRUE mask 0.7676 5421 perfect maskThe flow signal is worth +0.0680 over connected components on the same predicted mask, which is the only honest comparison here - same model, same mask, same pictures, with and without the signal. The rim route was worth +0.0640 on its own set (
#159,JOURNAL.md§4bo), and the difference between the two, 0.0040, is below the 0.0074 run-to-run spread of one configuration at a fixed seed that§4bomeasured. So the structural argument for flows - that it spends no pixel on being a boundary, where a rim wide enough to learn hollows the object out - does not show up in the score. Two runs of this configuration here came back 0.5278 and 0.5315, a difference of 0.0037, which is consistent with that spread and is still two runs rather than a spread of its own.And the oracle pair says why, which is the part worth keeping. A perfect mask is worth +0.2398 and perfect vectors +0.0663: the mask is the limit by a factor of 3.6, and
0.7676with a perfect mask is already about what connected components reaches on the truth (0.7505). A third separation target would be measured against the same wall, which is what#213now has to answer for rather than assume.Each row prints the number of objects it handed back, and that is not decoration. The first version of the TRUE-field oracle scored 0.2220 with 18758 objects back against 5999 in the truth, because it handed
flows_from_instances(labels)- zero everywhere off the truth’s own objects - to the model’s mask, and a zero field moves nothing, so every voxel the mask got wrong stood still and became a basin of its own. It istruth_field_onnow, substituting identity and not the field: every voxel of the mask joins the nearest truth object and the field is built from that. An average precision alone cannot tell a route that mislabels from one that shatters; an object count can. One blind spot is left and it is counted rather than argued about: 259 of the 6138 objects the TRUE-identity row returns are pieces of predicted foreground holding no truth voxel at all, which join the nearest object by identity but, underdiffusion, receive no heat and keep a zero vector. Undercentroidthey would cost nothing - a straight line to a sink needs no path - and the run prints the count beside the row with the mode it belongs to.separation_ceiling.py --separation hv, which is#213’s own cheap test and answers it before a model is trained. The issue, after#211narrowed it: “if the markers fromhvdo not beat eroded interiors on the ground truth, they will not beat them predicted either, and this issue closes before a model is trained”. They do not. Both recipes for getting markers out of HoVer-Net’s two distance maps are swept, over the 134 held-out cases and 6000 objects:marker source AP over the bar markers objects with none eroded interiors, 1 px 0.9807 +0.2224 6030 0 hv centres, |h|,|v|<=0.6 0.9382 +0.1799 5900 5 hv gradient, >=0.6 0.7995 +0.0412 5404 0 connected components 0.7583 the barThe maps’ own zeros -
#213’s own narrowing, the extrema as seeds rather than the gradient as a surface - are the better of the two and still 0.0425 below a one-pixel erosion. HoVer-Net’s published gradient route recovers a fifth of what that erosion does over the bar. Both curves turn over at 0.6 rather than at an edge of the range (--hv-sweepprints them), so neither number is a tuning artefact, and the erosion’s thin-object fallback cannot account for the difference: it rescues 4 objects of 6000.Two rows of that table are controls. The connected-components bar and the eroded-interior ceiling reproduce
0.8.0a18’s recorded 0.7583 and 0.9807 to four decimals, which is how a reader knows this measurement is on the same pictures as those- and the direct answer to the provenance failure that left
#159’s ceiling without a set it could be reproduced on.
The two marker functions live in the example rather than in the package, because
#160has not namedseparation: hvand this measurement is the reason it may never need to. Seven mutations, six caught; the seventh is named in the code as uncatchable with the reason, rather than left as a gap.--separation bothis now--separation all, because there are three signals.- and the direct answer to the provenance failure that left
Fixed
labelswithout 0 is refused when any voxel matches none of them (platypus#153). Index 0 means two things in this package and always has: the first entry of a naming, and matched nothing.labels: [0, ...]makes them agree, andlabelsis the one naming where the 0 can be left out - after which every unmatched voxel, which is usually most of the image, is trained as the first declared class. Measured on the issue:labels: [1, 2]over a mask of 0s, 1s and 2s put the background into class1with an unmatched fraction of 0.5, and nothing in the shape of the target gives it away - it is in range, one-hot and plausible.Refused in
fit’s existing mask check, which already reads a sample of the training masks, and only when the data actually has unmatched voxels:labels: [1, 2]over masks that really do fill every voxel is correct and keeps working. That was the author’s reading on the issue, between four options, because the failure is in the data rather than in the configuration.The threshold is any unmatched voxel at all, not the 5% the unmatched warning uses, and that is a calibration rather than strictness: a label map holds integers, is read nearest-neighbour and compared with half a unit of tolerance, so a naming that describes it matches exactly everything. The compression and antialiasing the 5% exists for belong to colormaps, and a colormap cannot omit a background entry. Five mutations, five caught - including the one where the refusal is hung on the warning threshold, which the fixture is deliberately sized to catch at 1.6%.
[0.8.0a18] - 2026-10-12
The first half of flows (#212): the target, its decoding, and their ceiling measured on the ground truth before anything is trained - the order #159 was done in, now the pattern rather than a one-off. #212 stays open; what is here is everything that can be settled without a training run, and it settled more than expected.
Added
flows_from_instances()andinstances_by_flows(), withFLOW_MODESas the question they exist to answer. A unit vector per foreground pixel pointing at its own object’s sink, decoded by following the field until the pixels that arrive together are one object. No interior, no rim, nothing eroded - which is the premise of#212, because#159closed measured-and-no for a structural reason: an interior and a rim are two classes competing for the same pixels, so a rim wide enough to learn hollows the object out. A flow field spends no pixel on being a boundary, and an object one pixel wide is an ordinary object with a sink in it rather than a case forparts_from_instances’s fallback.The ceilings, one run over 134 held-out Data Science Bowl cases and 6000 objects:
flows:diffusion + follow 0.9924 6043 objects back flows:centroid + follow 0.9478 6268 rim + nearest_seed 0.9807 6074 rim + watershed 0.9703 connected_components 0.7583 the bar any model using it is capped bySo the flow route’s ceiling is 0.0117 above the rim route’s on the same pictures, and the route is not what caps a model either way.
separation_ceiling.py --separation bothprints all five rows and the set they belong to.follow_flows()exposed on its own, because the decoding’s parameters are not equally dangerous and only a measurement says which is which. The step count does not matter: AP 0.9914 at one step against 0.9923 converged over fifteen cases, a span of 0.0009, below the 0.0013 run-to-run spread of a training run. The reason is structural - the field is continuous, so one object’s endpoints stay a connected set however far along they get, and it diverges at a seam, so the gap between two objects opens on the first step. The step size is a cliff: 0.9923 at 1.0 or below, 0.4715 at 2.0 with 868 objects back where the truth has 633, and 0.0303 at 10.0 with 4337. A step longer than a pixel jumps past the sink and keeps jumping. Both are in the suite with both ends written down.
Measured, and it changed the design
The two flow targets differ by 0.0446 of AP, and the obvious explanation was measured at 0.32%. The cheap mode aims a straight line at the sink, and the reading everybody reaches for is that it fails on concave objects whose centroid falls outside them - of 6000 objects 19 do. The cause is one level down: a straight line between two pixels of a discrete set can step outside the set even when the set looks convex, because the boundary is ragged. Measured on 274 of those objects: 0.27% of foreground pixels have such a path, 6 objects come back split, and every one of the 6 has pixels whose path leaves it while 10 objects have such pixels and survive. Necessary, not sufficient.
The build cost is the number that decides the training half, and it is 23x apart between the modes: 4.9 ms per case for
centroidagainst 113.6 ms fordiffusion, with decoding at ~335 ms for both.#210says the target is rebuilt from the augmented label map on every sample, so the build is paid once per image per epoch: 429 training cases at 113.6 ms is 48.7 s against a 15.5 s training epoch, 3.1x it serially and absorbed by the loader’s four workers rather than eliminated. The decode is paid once per evaluation and the step-count measurement above makes it twenty times cheaper than its default.
Fixed
The diffusion target carried a full unit vector at every object’s sink, found by the mutation gate rather than by a test:
(0.707, 0.707), because normalising the residue a central difference leaves across a maximum produces a unit vector from nothing. A model trained on that learns noise at exactly the pixel the method is about. The decoding survived it unchanged - 0.9925 before the fix against 0.9924 after - which is why nothing noticed, and is the shape of the whole category: the defect was in the target and the only instrument pointed at the decode. The sink is now zeroed by construction, and the test that should have caught it is parametrised over both modes; with the default mode alone it was asserting a property of the straight-line field.instances_from_parts’s docstring saidscikit-imageis not a dependency. It became a hard one in0.8.0a16and nothing re-read the sentence.
Measured and unresolved
The ceiling of 0.9846 and the bar of 0.7655 on the record for “the 134 held-out cases” are not reproducible from anything on this disk, and
separation_ceiling.pynow prints the case and object count beside every number so this cannot recur. Four candidate sets were measured: the 134 directories ofstage1_validationgive 0.9807 and 0.7583 over 6000 objects, the seed-1 fifth ofstage1_traingives 0.9905 and 0.7876 over 107 cases and 4044 objects, all 536 ofstage1_traingive 0.9818 and 0.7618 over 23461, and the same 134 at the training resolution give 0.9627 and 0.7504. The recorded object count of 5774 appears in none of them.No conclusion drawn against that bar changes -
#159’s 0.5587 and#211’s 0.5561 are below every one of these - but a new number cannot be put beside an old one, which is why the table above is one run over one set of pictures and quotes nothing from before it.
[0.8.0a17] - 2026-10-12
The two gates in front of flows and hv (#212, #213), and neither is about either of them: a continuous target has nothing in the ten overlap-and-cross-entropy losses to be trained against (#209), and augmented as a mask it comes back geometrically consistent and physically wrong (#210). Both were to be settled before any number produced with them could be believed.
Added
mse,l1andsmooth_l1, and the question they exist to force: where is the target defined? (#209) A continuous instance target - a flow field, or horizontal and vertical distances - is defined on the objects and undefined off them, so a builder writes zero on the background. Measured on the 536 Data Science Bowl cases: the foreground is 13.97% of the pixels at 256x256 (13.48% at native size, 0.03% to 59.2% per case, 167 cases under 5%), so an unmasked mean spends 86% of the objective on a value a single output bias satisfies exactly.So
where:is a field rather than a convention.foregrounddivides by the mask’s own total, which makes the number mean average error per object voxel;everywhereis the other defensible answer and is what CellPose and HoVer-Net’s plain regression terms do - their background zero is a real value rather than a missing one.foregroundis the default because it is the reading whose number means something, and because the trap is otherwise on by default.The mask is asked of the loader, never read off the target.
needs_maskandloss_needs_mask(spec)are the same mechanismboundaryuses for its distance map, for the same reason - the loader is built before the loss. Reading it off the target is the one shape this family refuses: a flow field is exactly zero at the centre of every object and thehvmaps are each zero along a line through it, so “the voxels where the target is non-zero” excludes precisely the seeds - and #211’s oracle measured that the seeds, not the seams, are what limits this approach. A mask inferred that way would be wrong in the one place the method depends on and right everywhere a test would look.Nothing activates the prediction, which is the other sigmoid-shaped way to be wrong here: squashing an unbounded flow into (0, 1) would still return a number and a gradient.
onehot_to_foreground(), one home for a convention the package already depends on everywhere: channel 0 is background in the two exclusive namings, becauselabels_to_classesandcolours_to_classesboth send an unmatched voxel to index 0, andregionshas no background channel at all. Its own docstring states the limit, which is filed asmaju116/platypus#153:labels: [1, 2]makes the first entry a real class and there is then nothing that means background.
Decided
A vector target is rebuilt from the augmented label map, never corrected (#210). Two measurements, both in
tests/data/test_vector_targets.pywhere a library bump re-runs them:- albumentations 2.0.8 never invents a label value. Sixteen transforms, twenty seeded draws each, a label map of forty distinct ids: not one output value was absent from the input, and the control is that the same transform with the map sent down the image path invents hundreds. So an instance label map travels through the augmenter unharmed and the target can be built from what comes back.
- A crop moves an object’s centre, and no correction can answer that. Negating x after a horizontal flip is exact - 0.0% of foreground voxels disagree with a field rebuilt from the flipped labels, at 0.0 degrees, against a median of 90 and a maximum of 167.3 if the negation is left out. After a 32-pixel crop 49.5% disagree, by a median of 8.9 degrees and up to 180, and there is no component to negate: the surviving part of an object has a new centre, so the arrows carried in point at a place that is no longer in the picture.
Rebuilding is therefore correct by construction for every transform rather than for an admissible list of them, which also retires the idea of refusing transforms by name. It covers tiling for free - a tile is a crop, it happens before augmentation, and a 2048-pixel retina cut into sixteen would otherwise carry sixteen fields built for the whole picture.
The data path already had the right shape and the wrong array in it: masks are augmented as class indices and one-hotted afterwards, which is exactly the route, but
_to_classesthrows instance identity away first. So #212 carries the instance label map into the dataset rather than deriving a target offline, and a test pins that ordering instead of a docstring claiming it.AlbumentationsAugmenterrefuses a floating-point mask, which is what keeps that decision from being quietly undone. A flow field sent through as a mask comes back the right shape, the right dtype and the right range with its arrows pointing the wrong way; the loss falls, the model trains, and nothing downstream can tell. Every path in this package sends an integer -labels_to_classes,colours_to_classesandlabels_to_regionsall returnint64- so the guard costs nothing it should not.
[0.8.0a16] - 2026-10-12
Added
instances_by_watershed(): a second decoding of therimtarget, andscikit-imageas a hard dependency. One trained model serves both decodings, because they share a target and differ only in how its channels become objects - which is whydecodewill be a list on an instance model andseparationwill not (#160). A decoding costs 11 ms per image against 15.5 s per training epoch, so it is a row in a table rather than a run.scipy.ndimage.watershed_iftis not a substitute: it wants integer markers and implements the image-foresting-transform watershed, a different algorithm from the one this literature means.scikit-imageis hard rather than an extra for the reasonscipyis, plus one more: every published comparison on this problem usesskimage.segmentation.watershed, so writing our own would make a difference from the literature indistinguishable from a defect in ours.What to pass as the surface is the part the name gets wrong. Not the image - a nucleus is bright and so is the next one, and the seam between two touching nuclei is not reliably darker than either. The model’s own predicted rim probability is the surface, which is the information
nearest_seedthrows away: it thresholds the rim and never looks at it again, so a confident boundary and a marginal one move the seam by the same amount.
Measured and no
The watershed does not help, and an oracle says why (#211). Four decodings of one trained
rimmodel at width 3, its optimum:nearest_seed, distance only 0.5561 watershed, predicted rim probability 0.5458 -0.0103, 7.8x sd watershed, the TRUE rim as surface 0.5590 +0.0029, 2.2x sd connected_components, signal discarded 0.4988sd 0.0013, from three runs of the identical configuration - 0.5587, 0.5574, 0.5561. (The 0.0074 quoted in the entries below is the range of two runs at width 1; at width 3 the spread is a quarter of that, and §4’s warning about a sample of two applies to the looser figure.)
The hypothesis was that the watershed is held back by its surface, rim Dice being 0.7292. Half right, and the half that is wrong is the one that matters. Surface quality is the largest effect in the table - the oracle beats the predicted surface by 0.0132, ten times the sd. And a perfect surface still only draws level with ignoring the surface entirely.
So the limit is not where the seam falls: both decodings share the same seeds, and the seeds decide which objects exist at all. Perfect seam placement buys 0.003 of the 0.21 still missing to the 0.7655 bar.
Changed
A ceiling run cannot test the watershed, and
separation_ceiling.pynow says so beside the number. With perfect parts the rim is binary, the surface is flat and the flood has nothing to climb, sorim + watershedreads 0.9756 there against nearest-seed’s 0.9846 - an artefact of flooding order rather than a comparison. A test asserts the caveat is printed, because the figure without it is misleading in the most-read place.train_instance_separation.pyreports four decodings of one forward pass, including the oracle row - predicted seeds, true surface - labelled a diagnostic and not a route. That pattern is how the above was settled at the cost of one row and no extra training, and it is the pattern#212and#213should both inherit.
Measured and no, from 0.8.0a15’s work
A boundary separation signal is not worth it on this data (#159, closed measured-and-no).
0.8.0a15below measured the ceiling of interior-plus-rim separation at 0.9846 and set the bar for “separation did something” at 0.7655, which is where a perfect semantic mask with no separation at all already lands. Four runs then measured what a model actually reaches:rim fg Dice interior rim Dice objects matched@0.5 AP sep AP cc effect 1 px 0.9188 0.9012 0.4808 4923 4020 0.5169 0.4893 +0.0276 2 px 0.9199 0.8908 0.6419 5086 4248 0.5486 0.4907 +0.0579 3 px 0.9186 0.8554 0.7292 5481 4513 0.5587 0.4947 +0.0640 4 px 0.9171 0.8068 0.7622 5525 4438 0.5306 0.4791 +0.0515The best is 0.5587 and the curve turns over, so the optimum is bracketed rather than guessed at. The mechanism is in the two middle columns: a rim wide enough to learn is wide enough to hollow the object out, so rim Dice climbs 0.48 to 0.76 while interior Dice falls 0.90 to 0.81. Two runs of one configuration differ by 0.0074, so the best effect is 8.6x the noise and the turnover 3.8x - real, and small.
The mask never moved across the four (foreground Dice 0.917-0.920 against the two-class model’s 0.9205), which is what makes the comparison one variable rather than two.
This entry is here because the
0.8.0a15notes below would otherwise read as an open recommendation. They end with the bar and the ceiling and no outcome, and a changelog entry about work in flight goes stale the moment the flight lands.
Added
examples/train_instance_separation.py- the script every row above came from, kept because a negative result nobody can reproduce is an opinion. Not packaged in the wheel, like the rest ofexamples/, which is why this is not a release.
[0.8.0a15] - 2026-10-12
Added
Instance separation, and the measurement that says it is worth training (#159). The proposal was a semantic mask plus a separation signal; of the two signals on the table this takes the boundary, because it turns the problem into three mutually exclusive classes - background, object interior, object rim - which is ordinary semantic segmentation on the softmax path this package already has. Nothing new in the model, the loss or the metrics.
parts_from_instances()decomposes an instance label map into those parts andinstances_from_parts()grows them back: the interiors become seeds and every other foreground pixel joins the nearest seed, whichdistance_transform_edt(return_indices= True)answers in one call. No new dependency -scikit-imageis not here and is not worth adding for one function.No model is trained, and that is the point of this release. The post-process is what caps the approach, and a cap can be measured without the thing it caps: feed the ground truth through it and score the result against the same ground truth. On the exact 134 cases
dsbowl-unet’s card reports:interior and rim, grown back 0.9846 median 1.0000 connected components 0.7655 the published weights, as measured 0.4888 (0.8.0a13)Three readings, and the middle one is new. Connected components caps any model at 0.7655 on this data - a perfect semantic mask still scores that, because touching nuclei are one region. So the published weights’ 0.4888 is not one failure but two: 0.4888 to 0.7655 is the mask’s own error, and 0.7655 to 0.9846 is what separation can buy and no better mask ever will.
examples/separation_ceiling.pyis the script, it trains nothing, and it prints both ceilings from one run over one set of pictures.What the decomposition costs, counted rather than assumed, over those 134 cases: the plain erosion would have erased 6 objects in 4 cases - a nucleus one or two pixels wide has no interior - and an interior falling into two pieces gained 52 objects in 20 cases, which is most of the 0.0154 the ceiling sits below 1.0.
The erased objects are handled rather than ignored, because an object absent from the target is an object the model is told not to find: a false negative in every epoch and in the score, with nothing to say the target was at fault. An object whose interior comes back empty falls back to an erosion that only removes pixels touching a different object, and one still empty after that keeps itself whole.
Fixed
- The weak erosion could not see the objects it was protecting against. It was handed a label map with every other object masked out, so a pixel touching a neighbour read background there - and background counts as agreement in that pass by design. The thin object was kept whole and handed a seed it shared with its neighbour, which is the one outcome that fallback exists to prevent. Found by a test, not by reading, and the ceiling above was re-measured afterwards: it had been 0.9853 with the defect, which is wrong in the third decimal and was nearly published.
Notes
- Nothing in
pyplatypus.instancesis inpyplatypus.__all__, deliberately: the top-level namespace is paired with R’s reference groups and the shared order is held by tests on both sides. These names live onpyplatypus.instancesuntil R has something to say about them.
For the R package
- Nothing, and the pin should not move for this. No R surface reaches the instance post-process yet;
platypus#103is the R half of the whole milestone and it waits on #160, the spec tag, which is what will make any of this reachable from a configuration.
[0.8.0a14] - 2026-10-12
Added
regions: overlapping classes, named as unions of a label map’s values. The first half of multilabel segmentation (#91), and the decision in front of it was the author’s: nested regions first, one binary file per class deferred.The case is BraTS and the lesion-inside-an-organ family - liver and tumour, kidney and cyst, lung and nodule. The ground truth gives every voxel one of
{0, 1, 2, 4}and the three scored classes are unions of those values:regions: - name: enhancing of: [4] - name: core of: [1, 4] - name: whole of: [1, 2, 4]So the overlap is a convention applied to exclusive data, not a different file format, and nothing new is read off disk.
regionsis a third way of naming classes rather than an addition tolabels: a region is a membership test, so the complete vocabulary of values never has to be declared. Exactly one ofcolormap,labelsandregionsis given, and - as with detection’sclasses, for the same reason - regions have no background entry, because each channel is an independent binary question.Why nested first was the cheaper half as well as the one the data wanted. One integer per voxel survives tiling and augmentation, both of which operate on a single-channel array today, so neither had to learn anything. The expansion to channels stays in the last step before the loss, where
classes_to_onehotalready was:exclusive onehot = np.eye(n_class)[classes] overlapping onehot = table[classes] table[v] = the regions value v belongs toSame indexing;
np.eyeis the special case where the table is the identity. The one difference that matters is row 0, which is zeros rather than a class.labels_to_classessends an unmatched voxel to index 0 because index 0 is a class there - the background a colormap puts first - so reusing it unchanged would have made background a member of whichever region holds the lowest value. On BraTS that is 1, which is in bothcoreandwhole, so every background voxel would have been in two of the three regions and the model would have trained on it without complaint.Per-channel objectives, and the four places mutual exclusivity was hiding.
probabilitiesgained amultilabelargument and is the single home of the softmax-or-sigmoid decision; every overlap-based loss reads it throughSegmentationLoss.probabilitiesrather than calling the functional form, so Dice, IoU, Tversky, focal Tversky, combo and the surface term all moved with one line.cceandfocalgained binary forms, metrics threshold each channel instead of taking anargmax, andpredictreturns a stack whose channels do not sum to one.binary_focalagrees withtorchvision.ops.sigmoid_focal_lossto within float32’s resolution over five (gamma, alpha) settings, and reduces exactly tobinary_cross_entropyatgamma=0- a control the implementation could not satisfy by accident. Both are in the suite, and the torchvision numbers are baked in rather than imported because torchvision arrives only with theencodersextra.No tighter number than that is pinned, because there is not one to pin: these are float32 reductions over 384 elements, so the last digit belongs to the order the hardware adds them in. macOS on ARM and Linux on x86 disagree by 8.6e-08 relative, under float32’s eps of 1.19e-07, and a first version of the test asserting 2e-08 absolute turned one macOS job red while being right about the arithmetic. The bound that replaced it is
rel=1e-6, chosen against both ends: twelve times the platform noise, and five orders of magnitude under the 55% to 67% that the mutation this test exists to catch actually moves the numbers by.The reduction differs from the categorical form and that is deliberate. Categorical cross-entropy sums over channels, which picks out the one true class of a one-hot target. Here every channel contributes, so a sum would make the loss grow with the number of regions: three regions would read three times the scale of one, and
cce_weightin a blended loss would mean something different on every dataset. The mean keeps one voxel worth the same whatever it was asked.label_smoothingdivides by two rather than byn_classfor the same reason - each channel is a two-outcome question.A metric now reports what the model was asked. With an
argmax, a voxel correctly predicted in both the core and the whole tumour was credited to whichever channel read higher and scored as a miss in the other. On the smallest case that can show it - one voxel, in two regions, both predicted - Dice went from 0.833 to 1.000.
Changed
inspect_masksreports regions by name, andunmatchedmeans something different there.missing_classeskeeps its meaning exactly and gains the failureregionsinvites:of: [3]against data holding4is a channel of zeros, which trains to predict nothing and scores a Dice of 0 while every other number looks ordinary. It is refused before training with the region named.unmatched, on the other hand, counts background - which is deliberately not a region - so it sits near 1 on any dataset where the thing being found is small. On BraTS that is the correct answer and it looks like the catastrophic one, so the warning that reads it is suppressed forregionsrather than left to cry wolf on every correct run.The class fingerprint written into every run record and weights sidecar now names the regions.
n_classalone cannot tell three exclusive classes from three overlapping ones, and weights from one must not be read back as the other.
Refused rather than served
lovaszwithregions. Lovasz-Softmax sorts the errors of a softmax over mutually exclusive classes; the independent form is the Lovasz-Hinge, a different construction rather than a setting on this one. Run as it stands on sigmoid channels it would return a number and a gradient, which is the worst available outcome. The property lives on the loss specification (supports_multilabel), so the refusal arrives at load time andpyplatypus.objectives.lossesreads it rather than keeping a second list.include_background: falsewithregions, but only when it was written down. There is no background entry, so channel 0 is the first region somebody asked for and dropping it would drop a class.cldicedefaults the flag to False and a default is not a request, so with regions the setting is ignored rather than honoured -model_fields_settells those apart, the same waychannels_match_the_dataalready does forchannels.A colour map holding an overlap.
onehot_to_coloursrefuses an array where some voxel is confidently in two classes instead of taking theargmaxand writing one of them, which would have produced a plausible picture of something else. Detected from the array rather than from a flag, so a caller holding only a prediction can answer it; a softmax output never trips it, because its channels sum to one.
Not done, so it is not looked for
classes_from- one binary file per class - is the only shape that can express genuinely independent overlap, a vessel crossing an organ or two annotators’ masks. Deferred, not dropped: #91 stays open for it andunite_masks’s element-wise maximum is still where per-file identity is destroyed.- Drawing a multilabel prediction. What one picture of three overlapping regions should look like is a real question with no answer yet, and half of one would be worse than none.
onehot_to_coloursrefuses rather than guessing, which is the honest state until it is designed. - A guide section. The guide’s section list is pinned and paired with the R package’s (“change both or neither”), so a narrative section on
regionslands with the R half rather than documenting in R something R cannot do. The field’s own description is on the generated configuration reference now, which is where a reader meets it.
For the R package
- Nothing moves yet, and the pin should not.
regionsis reachable from R the moment the pin moves, because R forwards the data block it is given - butavailable_weights()-style free inheritance is not what this is: the R surface documents its fields by hand, soregionsneeds roxygen prose of its own, andsave_masks()needs the refusal the author chose for an overlapping prediction. Both are the R half’s work, filed as its own issue. - The field-prose ledger will fire, and that is the mechanism working:
regionsandRegion.ofare new descriptions R has never been written against.
[0.8.0a13] - 2026-10-12
Added
pyplatypus.instances: the Data Science Bowl’s own metric, and the number the published weights score under it. First piece of instance segmentation, and it deliberately builds no model. Detection worked here because it was built metrics-first - every piece checked against something outside itself - and a model chosen before there is a way to score it is a model chosen on nothing.The baseline, measured on the exact 134 cases
dsbowl-unet’s card reports:Dice, on the model's grid 0.9205 instance average precision, source grid 0.4888The card for those weights says semantic, not instance, and that caveat has been true and unmeasured since they were published. Touching nuclei come back as one region; connected components found 4658 objects where the data holds 5774, and every nucleus a merged region swallows costs twice - a false negative, and a false positive through the region that swallowed it.
The split is reproduced rather than assumed, and the Dice is the control that proves it. The 134 directories sitting in
stage1_validationon the machine this was measured on are a different 134 from the card’s - the card’s worst case is not among them - so scoring those and quoting the published Dice beside it would have compared two different sets of images.split_datasetwith the card’s fractions and seed rebuilds the right ones, and the script refuses to report anything unless Dice comes back as the sidecar’s0.9205236150257623to seven decimals. That mistake has a history on this dataset: a directory of 134 images and a card measuring 134 held-out images were taken for the same 134 once before.What is in the module:
label_map()andread_instances()- the per-object files read as instances instead of united into one mask.unite_masks()takes the element-wise maximum, which is where instance identity is thrown away at read time; nothing new had to be collected.iou_matrix()- pairwise IoU from a contingency table rather than pair by pair, because one image in this dataset holds 375 objects and the pairwise form is 140,000 full-image comparisons. Checked againstpycocotoolsto 1e-12 on three seeded problems, then baked in, so the suite needs no dependency - the arrangement the detection metrics already have with that library.average_precision()- the challenge’sTP / (TP + FP + FN)at ten thresholds from 0.5 to 0.95, averaged. Not a precision-recall curve and nothing interpolated, because nothing is ranked: an instance post-process produces regions, not scored proposals.instances_from_mask()- connected components, 4-connectivity, untuned. A yardstick, not a contribution, and a baseline that has been tuned is no longer what later work is compared against.summarise_instances()- the mean over images, which is what the challenge ranked on, and the pooled number beside it. This dataset holds images of 2 objects and images of 375, so the two differ and reporting one alone is how it gets quoted as the other.
Thresholds below 0.5 are refused, and the strictness of the comparison is load-bearing. Above 0.5 a prediction can satisfy at most one object - two disjoint regions cannot each cover more than half of the same third region - so counting matches is exact and needs no assignment algorithm. The comparison is
iou > threshold, not>=: with>=, two predictions each covering exactly half of one object would both count, and the test that catches this is the one where a merged region scores two true positives instead of none.Overlapping truth is refused rather than resolved. A mask layer that holds more than one thing per pixel is open work -
pyplatypus#158withpyplatypus#91- and a metric that quietly took the topmost label would answer that question wrongly rather than decline it.Closes pyplatypus#157.
For the R package
Nothing, and the pin stays where it is. These names live under pyplatypus.instances rather than in __all__, so they are not on the reference page and R cannot reach them: instance segmentation becomes a configuration people write when task: instance_segmentation lands (pyplatypus#160), and that is the release where the reference groups and R’s shared order move together. platypus#103 is the R issue and it says the same thing.
[0.8.0a12] - 2026-10-12
Added
fives-unet, the third published weights, and the first that are not MIT. A U-Net on 512x512 tiles over FIVES’ 2048x2048 fundus photographs, trained on the dataset’s own split and pinned in the registry atc4492f7a.weights: fives-unetfetches it, the sidecar refuses a model it does not belong to, and nothing about the numbers can change under the name.Measured on the 200 held-out images, seed 1, one score per image on masks reassembled from the tiles:
Dice mean 0.8789 sd 0.1051 median 0.9092 worst 0.1055 (122_G) IoU mean 0.7956 sd 0.1280 median 0.8335 clDice mean 0.8330 sd 0.1268 median 0.871440 epochs were asked for;
early_stoppingstopped at 24 and restored epoch 16. The previous 40-epoch retinal run measured 0.8509, so stopping earlier cost nothing.The per-disease table reads picture quality as pathology, and the card says so before it says anything else. FIVES ships a quality grading - every image rated for illumination and contrast, blur, and low contrast - that nothing in the training pipeline uses, and 14 of the 15 test images flagged for low contrast are glaucoma:
all images graded clean on all three axes AMD 0.9107 0.9229 n=42 diabetic retinopathy 0.8818 0.9056 n=36 glaucoma 0.8347 0.9315 n=22 normal 0.8884 0.9006 n=33 graded clean n=133 dice 0.9141 graded poor n= 67 dice 0.8089Glaucoma is the weakest group over all 200 images and the strongest over the 133 graded clean. The 0.1052 between clean and flagged images is larger than the 0.0761 between the best and worst disease, and larger again than the 0.0309 between them once the flagged images are set aside. A card reporting
glaucoma 0.83besidenormal 0.89would invite a clinical conclusion that is wrong, so every figure on it is generated from the run rather than typed, and the generator refuses to print if that ordering ever stops holding.weights_licenceis CC BY 4.0, not MIT.dsbowl-unetwas trained on CC0 data andbccd-yolo3on MIT, so neither constrained anything. FIVES is CC BY 4.0, these weights are plausibly a derivative work, and attribution therefore travels with them: the sidecar carries the citation, the source and the licence, the registry description says so, and the Hub repository now declareslicense: otherwithlicense_name: mit-and-cc-by-4.0because one field cannot describe three files under two licences.examples/publish_fives_weights.py, which produced them. The configuration is imported fromexamples/segment_retinal_vessels.pyrather than copied, so the published weights are the run that example documents and the two cannot drift. It uploads nothing, on purpose. Its one deviation is amodel_checkpointwatchingval_dice- the metric the example’searly_stoppingwatches, becauserestore_besthands back the epoch the stopping rule chose and two monitors would leave a file on disk from one epoch while the published weights came from another.It also refuses to write anything if the mean Dice comes in under
--floor 0.80, or if the quality grading does not hold the three counts every claim on the card depends on: 200 graded, 15 flagged for low contrast, 14 of those glaucoma. Under the opposite polarity it would be 185 images - not a flag - and the glaucoma share would be chance.The published file was loaded the way a user reaches it, before this entry was written.
weights: fives-unetwithfit: false, resolved through the registry, downloaded from the pinned commit into a cache that had never seen it, sidecar checked, and scored on the same 200 images: Dice, IoU, clDice and all four graded-clean per-disease means came back identical to the published sidecar, to every digit, and the downloaded file is byte-identical to the local one. Green on both halves proves the halves; this is the join.
For the R package
The pin moves to 0.8.0a12 and nothing else is needed: available_weights() reads the registry from the engine, so the third name appears on the R side as soon as the pin does. platypus#131 is the issue, and it stays open until that lands.
[0.8.0a11] - 2026-10-11
Added
deterministic, the opt-in that makes a seed mean something on a card.seedhas said where it stops since0.8.0a8: measured on a GTX 1070, two runs of one configuration at one seed agreed to twelve decimals on the processor and differed in the fourth after a single epoch on CUDA, because cuDNN picks algorithms nothing constrained. This constrains them -torch.use_deterministic_algorithms(True),cudnn.deterministic, andcudnn.benchmarkoff, which is the one that was choosing per shape.An opt-in rather than the default, because the cost arrives at a time nothing else here does. Some convolutions become much slower, and an operation with no deterministic implementation raises when it is reached, so a run can stop ten minutes in. Every other refusal in this package happens before anything is read, and this one cannot: whether an operation has a deterministic algorithm is a fact about the installed torch and the device, not about the configuration. The field says so.
It needs
seed, and asking without one is refused. Constraining the algorithms while the initialisation, the shuffle and the augmentation all still vary leaves the run exactly as unrepeatable as before and only slower - half a promise, which is what platypus#122 was filed about in the first place.It also sets
CUBLAS_WORKSPACE_CONFIGto:4096:8when nothing else has: from CUDA 10.2 on, cuBLAS needs it or torch raises, and the variable is read when CUDA initialises - which is why this happens in the engine’s constructor and not infit(). An existing value is somebody’s deliberate choice and is left alone.What is tested is that the flag reaches torch, that nothing is asked of torch when nobody asked, that the variable is set without trampling one, that the specification refuses the half-promise, and that an ordinary run still trains with it on. What the field is for - two CUDA runs agreeing - needs a card, and CI has none;
tests/test_seeding.pysays the same about the other half rather than asserting something it cannot see.Closes platypus#122, whose documentation half shipped in
0.8.0a8.save_spec(), the way back out of a specification.from_yaml()read a configuration and nothing wrote one, so the two interfaces were one pipeline and a half: an example could write the YAML of the run it had just done only by keeping the raw dict it started from. Now a specification built in code - or in R, where the bridge already drops unset arguments - becomes a file somebody else can run.It writes what was set, not what the object holds, and that is the whole design. On a two-field model
to_dict()returns 29 fields, and the difference is not verbosity: a model givenweightsand noarchitectureadopts the architecture from the weights sidecar, and the adoption fires onarchitecturenot being inmodel_fields_set. Dump the defaults and the reloaded specification has all 29 set, so a file that looks like the original quietly stops doing what the original did.defaults=Trueis the opposite want, kept as a second mode: freeze this run exactly as it resolved, at the cost of it adopting nothing ever again.Two things only the round trip could have found, both now tests:
Every discriminator has to be written even when unset.
taskis the obvious one.DiceLoss(smooth=0.5)is the one that is easy to miss:nameis aLiteralwith a default, so a dump of what was set givesloss: {smooth: 0.5}- a block with no tag, which comes back as Unable to extract tag using discriminator ‘name’.And “annotated
Literal” is the wrong rule for finding those tags. It also catchesbox_lossandannotation_format, which are choices a user makes, and writing them unset would freeze exactly the kind of default this function exists to leave out. A discriminator pins one value, so the rule counts them: measured across the spec, 31 single-valueLiteralfields, every one of themnameortask, and the only two with more are those choices.Closes platypus#120.
from_yaml’s docstring promised this round trip throughas_dict(), a method no spec has ever had; it now names the function that exists.available_losses(),available_metrics(),available_models(),available_optimizers(),available_callbacks()andavailable_tasks()- the rest of the verbavailable_transforms()andavailable_weights()already answered. The number of named components keeps growing, and the only way to see what is on offer was to leave for a documentation site.Three columns, in the order a reader needs them: the name you pass, the arguments you may tune, and what it is for. Every row is read from the same pydantic models the schema is generated from, so a loss added to the engine appears in the listing with nothing else edited - and the tests compare each listing against the schema’s own
discriminator.mapping, which is the authoritative answer to what may I write here, rather than against a list of names in a test file.The description shown is the component’s first paragraph, which is the summary line; the rest, including every measurement, stays in
spec_schema()and inhelp().Detection is the case that does not fit, and it refuses rather than inventing rows. A detection spec chooses no loss component - the objective is fixed and
box_losspicks the box term - and chooses no metrics at all, sincemap_50,map_50_95andmean_matched_ioucome out ofreport. Both raise with a message naming what detection actually offers: thebox_lossvalues are read from the schema, and a test ties the three metric names to the keys of the report itself, so a rename fails here rather than in somebody’s console. An empty table would have been a third answer and the wrong one.The architectures are the one hand-written part: they are an enum, and
UShapedNetis a single class taking the choice as a switch, so there is no docstring per member to read. The four notes say what the code does differently - nested skips and the only architecture that can takedeep_supervision, residual blocks, additive skips and the memory they save- and a test requires every member of the enum to have one.
Closes platypus#119, which was blocked on the descriptions below.
26 of the 29 things you can name in a configuration now say what they are. Three did:
boundary,cosine_annealingandswa, the three written most recently with a measurement in hand. Every one of the 201 described fields had its text, sosmoothexplained itself whilelovaszdid not say what a Lovasz loss is for - which left the generated configuration reference printing a heading and a table of knobs with nothing under the heading, and left?lossesin R listing ten names without the one sentence a reader needs: which of these do I want.Where this project has measured something, the description carries it.
cldicenow states what it was worth on a real model - FIVES, 200 cases, correlation 0.9779 with Dice, mean difference +0.0041, 127 cases higher and 73 lower - alongside the constructed pair where Dice reads 0.8750 and 0.9474 and so prefers the severed vessel while clDice reads 1.0000 and 0.9425 and does not. Both of those pairs are pinned by a test.Where it has measured nothing, the description says what the thing answers and what it costs, and says so once rather than eight times: no run here has compared the eight optimisers on segmentation, so
adam’s text is where that is admitted.Four of the descriptions state an identity, and each is now held by a test rather than by a claim:
tversky(alpha=0.5, smooth=1) == dice(smooth=2) exactly, not dice(smooth=1) iou == dice / (2 - dice) without smoothing, so same ranking focal(gamma=0) == cross_entropy focal_tversky(gamma=1) == tverskyThat last group is the useful kind of sentence for a knob - at this value this is another loss - and the kind most likely to go quietly wrong in a refactor, because every other test in the suite would still pass.
A coverage test holds the level, driven from
spec_schema()for the reason the field-level one gives at length: a definition is a component when itsnameis a literal, which finds 29 and correctly excludesAugmentationStepandSegmentationModel, whosenameis prose the user writes. It also refuses a description under 150 characters and one that only restates the component’s own name, both proven able to fail.Closes platypus#118. Note that the configuration reference prints a definition’s first paragraph by design, so the measurements live in the schema, in
help()and - once platypus#119 lands - inavailable_losses()and its family.
[0.8.0a10] - 2026-10-11
Fixed
Four transforms were reported as unable to take a volume when what they could not take was the probe.
available_transforms(rank=3)finds its answer by offering each transform a probe volume, and the probe was 8x8. A refusal is now retried once at 1024x1024 before it is believed, which is whatCropneeds - its default crop box is 1024x1024, so no plausible small probe would ever have admitted it. The listing goes from 87 names to 91 on albumentations 2.0.8, and the four areCrop,FrequencyMasking,TimeMaskingandSuperpixels.Why two sizes rather than one bigger one, measured on one Linux machine, as a ratio because seconds are not portable: offering every transform the large probe takes 250x the 8x8 listing, while retrying only the refusals takes 8x. Most of that 8x is
Superpixels, whose work scales with the pixel count. It is anlru_cached call made once per process, and a spec with no augmentation never makes it.The escalation can only add names - a transform that passed at 8x8 is never asked again - and a test takes the large size away and asserts
Cropgoes back to absent, because the straightforward test would pass for any reason at all, including an albumentations release that changed those defaults.The 87-against-88 disagreement was never about the platform, and now has a mechanism. It had been recorded as “Windows with Python 3.13, and no mechanism is claimed”. The first version of the escalation test asserted that all four names were what escalation added, and
ubuntu-latestwith Python 3.10 reported three - which is how the real answer arrived:Superpixels at 8x8 4 of 60 attempts succeed; it samples `n_segments`, and whether the segmentation divides by zero depends on the draw eight listings, 8x8 87, 87, 87, 87, 87, 87, 88, 87 - one process, one machine Superpixels at 1024 40 of 40 succeed eight listings, now 91, eight timesSo the probe was a random variable and the matrix was reading its noise. The count is still not pinned anywhere, because stable on one machine is not portable - but it is no longer unexplained, and the test now asserts only what holds on every run: escalating never removes a name, never adds one outside the four, and always adds
Crop.The three-channel nine are still refused, deliberately. That is a different decision, not an unfinished one: a three-channel probe would list
ChromaticAberrationand its eight relatives as available to someone whose CT has one channel, and a listing cannot know the channel count. Only the pipeline-build check can, and it already probes at the model’s own input size.
Changed
The docstring’s account of the refusals was wrong, and wrong in a way arithmetic shows. It said “eleven of the 31 are the probe’s limits” while naming nine three-channel ones and four size-dependent ones, which is thirteen. Counting the categories instead of recalling them gives a different answer again - on albumentations 2.0.8, of 27 refusals:
10 no volume support, which is the question being asked - `KeyError: 'images'` 9 require three channels, where the probe has one 8 require a target the probe does not supply - seven want metadata of their own, and `BBoxSafeRandomCrop` wants bounding boxesSo 17 of 27 are the probe’s limits and only 10 are a real no, and the third category was not named anywhere before this. A new test asserts that every refusal falls into one of the three, which holds the categories rather than the counts: an albumentations upgrade is expected to move the numbers and is not expected to invent a new kind of refusal. If it does, the test names the transform and prints its message.
The README no longer says how many transforms take a volume. It said 87. That number is the outcome of probing the installed library and one CI matrix of twelve once answered 88 where the other eleven answered 87, so by this project’s own rule it must not be pinned at all, only explained - and a test now asserts the README states no such count. The file’s README test cited “a transform count of 97 where the measurement is 87” as one of the four stale claims it was written for, and then asserted nothing about it.
CITATION.cff’sdate-releasedis the release date again. It said 2026-10-08 through0.8.0a9, which shipped on the 10th.tests/test_version.pyholds three places to the version and nothing holds this field to anything.
Noted, not fixed
- Eight transforms are listed at rank 2 that no specification can name, which is the third category above seen from the other side:
FDA,HistogramMatching,Mosaic,OverlayElements,PixelDistributionAdaptation,RandomCropNearBBox,MaskDropoutandBBoxSafeRandomCropneed a target supplied at call time, and anAugmentationStepis a flat name and a dict of parameters. The same argument that removed the ten composition classes in0.7.0a2applies to them, and it is a rank-2 change with its own blast radius, so it is not smuggled in here.
[0.8.0a9] - 2026-10-10
Added
An “About the author” section in the README, which is also this package’s page on PyPI. It carries a photograph, the fact that both halves of the project are by one person, and links out. The same section, in the same place, went into
platypus’s README - the paired tests on both sides hold the section order, so adding it to one would have failed the other.It reaches different numbers of readers on the two sides, which was not noticed until the release was confirmed.
platypus’s site renders its README as the home page, so the section is there; this site’s home page is a hand-writtenindex.qmd, so it is not. The asymmetry is left standing rather than papered over, and nothing tests it: §3F’s About pair holds the navbar’s order, not what the home page is built from.The R half of this release is deliberately not done, by §3E:
platypusgets nothing from a section on the engine’s own page, so its pin stays at0.8.0a8. Its README got the same section in its own change.The photograph is 200 x 200 and 69 KiB. Larger than it needs to be for a 130-pixel avatar and smaller than two of the three figures already there, which is the trade: quantising a portrait to 128 colours would have saved 55 KiB and risked banding on a face.
[0.8.0a8] - 2026-10-10
Changed
seedsaid “set it if you want a reproducible run”, and that was the whole description. It is now the one field on the specification that says where its guarantee stops, because the nuance lived in a private docstring and half of that docstring was false.What the field now states, measured rather than reasoned:
repeatable the split, a detector's fitted anchors, the order the data arrives in and its augmentation - workers included - and, on the processor, every number to twelve decimal places not repeatable a run on a CUDA device: two runs at one seed agreed to twelve decimals on a processor and differed in the fourth after one epoch on a GTX 1070, because cuDNN picks algorithms nothing here constrains. Nor across versions - `0.8.0a3` changed how a tiled dataset is shuffled, so one seed draws a different order than it didThe practical sentence, which is the point of the whole entry: it is the field for comparing two of your own runs, not for publishing a number somebody else can land on.
seed_everything’s docstring claimed “two runs at one seed on one machine agree”. True on the processor, false on a card, and the card is where anybody with a GPU trains. Corrected, with the measurement and a note saying which half is tested and which is not.It also explains why the CUDA half is tested nowhere: a test asserting that two runs differ passes by luck and fails by luck, and CI has no card to run it on. So the documentation carries that half and nothing else can - said out loud rather than left as a gap somebody later mistakes for an oversight.
tests/test_seeding.pynames its scope. The tests always forceddevice="cpu"and never said so, which madetest_the_same_seed_gives_the_same_runread as a universal claim while guarding a device-specific one. Renamed to..._on_the_processor, with the module docstring pointing attest_the_same_seed_gives_the_same_splitfor the guarantee that holds on any device - and is the one that matters most when two results are compared.
Note
The R half is platypus#122’s, and unlike the last few §3E releases it is not nothing: R’s
@param seedcarries the same bare sentence in its own prose, and the configuration reference on R’s site is generated from this schema, so it shows the new text only once the pin reaches this release.Also still open there, and deliberately not decided here: whether to offer
deterministic = TRUEas an opt-in.torch.use_deterministic_algorithmswould make a card agree with itself at a cost this docstring has always named - some convolutions much slower, some raising outright. That adds a public field on both surfaces, so it is a decision rather than a documentation fix.
[0.8.0a7] - 2026-10-09
Fixed
evaluate_cases(group_by=...)refused a whole-mask metric instead of averaging it. 0.8.0a6 taughtscore_casesto reassemble a case’s tiles before measuringcldice, and stopped there. Withgroup_by, several whole images arrive under one name - fifty fundus photographs under one disease, a patient’s slices under one patient - and the guard written for the tile case fired on them:'cldice' reads the shape of a whole mask and this case arrived in 50 piecesIt also named the wrong cause, suggesting several files under one key when the cause was the grouping. A group’s figure is now the mean of its images’ scores.
That is a different kind of pooling from Dice’s and the difference is documented rather than smoothed over: Dice is a ratio of sums, so a group adds the overlap counts and applies the formula once. A skeleton has no counts to add, so there is nothing to pool and the mean is the only thing the number could be. Weaker, and reported as such.
Found by writing the R vignette, which is the only way it could have been: nothing in either suite grouped a tiled run by anything, and the combination needs a dataset whose case names carry a group. §4’s a feature is not shipped until something has used it the way a user reaches it, on a release that was green on both halves.
Note
- The R half is deliberately not done (§3E). Nothing R sends changes; the pin moves with platypus#123, which is the work that found this.
[0.8.0a6] - 2026-10-09
Changed
A tiled run can ask for
cldicenow, andevaluate_casesreassembles before measuring it. The combination used to be refused outright. The refusal was right about the arithmetic - a skeleton is a property of a whole mask, and a tile severs every structure crossing its edge - and wrong about the remedy, which it left to the caller: the FIVES example carried forty lines stepping the model over one sample’s tiles, stitching, and scoring, to get a number the engine could have produced.score_casesnow holds a case’s tiles until its image is complete, stitches the prediction and the target, and measures the whole-mask metrics once on the pair. One image at a time - the loader is never shuffled there, so a case’s tiles arrive together and the buffer empties as the last one does.It is still absent from the epoch, and that is the honest half of the change. An epoch reads its metrics per batch and averages, which is exact for Dice - a ratio of sums - and meaningless for a skeleton. So on a tiled run
val_cldicedoes not exist, the history does not carry it, andmonitorabledoes not offer it, which makes the existing monitor check refusemonitor: val_cldicewhen the specification is read, with a message listing what is available. One validator fewer than before, not one more: the blanket refusal is gone and the narrow one was already there.The split-level figure comes from
summarise_casesover the per-case rows - the mean over images, which is what a whole-mask metric’s split-level value means anyway, and more defensible thanevaluate’s average over batches.examples/segment_retinal_vessels.pylost its second pass.cldicesits inmetricsbesidedice,evaluate_casesreturns both per case, and forty lines went away along with atorchimport. This is the change proving the feature: the example existed in its old shape only because the engine could not do this.Run at full scale to check it rather than assumed - 600 training retinas, 200 scored, one epoch, 2048 cut 4x4:
peak memory 1.42 GB against 2.22 for the two-pass version it replaces, and the ~20 GB that killed a finished run (#178) scoring 1.8 min 200 reassembled images, inside the same walk that produces dice and iou, instead of a second passLess memory than the workaround, not merely less code: the workaround stitched and scored one image at a time too, but it did it after a full
evaluate_caseswalk rather than during one.A measured number in the configuration reference was the wrong one.
iterationssaid five peels is “well past a retinal vessel at one to five”. A FIVES vessel is about nine pixels wide, measured as mask area over skeleton length; one to five is what a naive resize leaves behind. Five is therefore enough for vessels and not much more than enough, which is a different thing to tell a reader. The field also now says wherecldiceis reported on a tiled run and where it is not - on both sites, since the page is generated from the schema.
Added
Trainer._stitch_channels_first, the device-side counterpart ofdata.images.stitch, with a test holding the two to each other over a non-square grid and non-square tiles. Scoring would otherwise copy a four-megapixel mask to the host and back twice an image.
Note
- The R half is deliberately not done and the pin stays at
0.8.0a2(§3E), but this is the release that makes platypus#123 possible: R already hasmetric_cldice()andevaluate_cases(group_by=), so the vignette needs no new R surface for this - only the pin moved. That move belongs to platypus#123’s own pull request.
[0.8.0a5] - 2026-10-09
Added
Engine.predict_stream, becausepredictcannot do a large tiled split at all.predictreturns one stacked array, so the whole split has to be resident: 200 FIVES retinas at 2048 is 6.7 GB for the result alone, and the old implementation held three copies on the way - every tile’s probabilities, their concatenation, and the stack of stitched images. That killed a run which had finished training (#178).The shape of the problem is worth stating, because it is the opposite of what tiling is for:
splitsexists for images too large to resize, and the stacked form is least usable exactly wheresplitsis most needed.predict_streamyields(case, prediction)one source image at a time, stitching only the tiles of the image being assembled, so peak memory is one image whatever the split’s size. The case name travels with the image rather than being left to the caller to line up againstsamples: anything that pairs two sequences by position is onedrop_lastaway from scoring the wrong picture.It buffers by example and not by batch, which is the only real risk in the thing - an image’s tiles can straddle a batch boundary, and a version that stitched each batch would mix two pictures. There is a test with four tiles an image and batches of three.
The model name is resolved before the generator is returned rather than inside it, so a mistyped name is an error now instead of on the first
next, by which time the caller has opened the file it was going to write into.
Changed
predictholds one copy instead of three, since it is nownp.stackover the stream. Same signature, same numbers, same refusal of a partial grid - a test asserts the streamed and stacked results are identical element for element. For 200 retinas at 2048 that is 6.7 GB rather than about 20.examples/segment_retinal_vessels.pycalls the public method now. It had twenty lines stepping the model over one sample’s tiles by hand, which is what prompted #178: an example reaching past a public method says the method is missing something. Both of its callers moved over - the clDice pass and the figure, which draws 2 of 200 images and now reads the stream for those two instead of asking for all of them at full resolution.
Fixed
- Two DICOM tests depended on a download and reported a network failure as a reader bug.
CT_small.dcmandMR_small.dcmship inside pydicom;SC_rgb.dcmdoes not - it is fetched on first use, andget_testdata_filereturnsNonewhen the fetch fails rather than raising. Two CI runners hit that on the same commit, and the symptom wascould not read 'None'from inside the reader, which names neither the file nor the network. The absence is now named where the file is resolved and the two rows that need it skip, because a test that cannot run and a test that fails are different facts. Nothing about the reader changed; only what the suite says when its data is missing.
Note
- The R half is deliberately not done and the pin stays at
0.8.0a2(§3E). Nothing here changes a configuration field or an interface R sends, so an R caller is unaffected - but this is groundwork R will need rather than a change R does not want:predict.platypus_fittakes a whole split and nothing else, so platypus#123’s vignette cannot score whole images from R until R reaches this. That is platypus#123’s own R half, not this release’s.
[0.8.0a4] - 2026-10-09
Added
examples/segment_retinal_vessels.py- FIVES retinal vessels, and the first example that setssplits. It exists because three things had no worked demonstration: tiling, a whole-mask metric, and scores reported per group rather than as one mean.A FIVES fundus is 2048 x 2048 and its vessels are about nine pixels wide, measured as mask area over skeleton length. Resized to 256 they are 1.2, and clDice reads 0 for a one-pixel structure displaced by one pixel - so the usual resize lands the data where no overlap metric can tell a near miss from a total one. That is the argument for
splits, end to end.It scores twice on purpose. Dice and IoU come from the tiled run; clDice cannot, because a skeleton is a property of a whole mask and a tile severs every vessel crossing its edge - the specification refuses the combination. So a second pass steps the model over one retina’s tiles, stitches, and scores that. One at a time rather than through
predict, which holds three copies of a split and was killed on this one (pyplatypus#178); streaming it peaks at 2.22 GB, and the skeleton on the card takes the pass from 11.96 s an image to 0.37.The run, 40 epochs over 600 retinas, 403.4 minutes, 1,942,594 parameters:
dice 0.8509 iou 0.7739 (best at epoch 34; nothing after it improved) per disease dice clDice, whole images AMD 0.9105 +-0.0474 0.9137 +-0.0530 diabetic 0.8792 +-0.0697 0.8886 +-0.0652 glaucoma 0.8393 +-0.1770 0.8402 +-0.1771 normal 0.9020 +-0.0452 0.9051 +-0.0500The glaucoma spread is not glaucoma, and the per-disease table is in the example because finding that out needed it. It replicated across two independent runs, so it is the data; FIVES then ships a quality grading that explains it. Fourteen of the fifteen low-contrast test images are glaucoma, and on the images FIVES grades clean, glaucoma is the best of the four and the tightest - 0.9325 +-0.0232. clDice splits the same way, so it is not a Dice artefact.
And Dice and clDice agree here - correlation 0.9779, mean difference +0.0041 at a spread of 0.0219 over 200 cases. Said plainly because a new metric that reorders nothing should be reported as redundant at this quality level rather than as a second opinion. What clDice adds on this run is the three worst cases, not the ranking of the four diseases.
The R half is deliberately not done, and the pin stays at
0.8.0a2. This release is an example script, a.gitignoreline and a help string: nothing here is reachable from R, no interface moved and no configuration field was added, so there is nothing for the R package to call. That leaves the pin three releases behindmain, which is the mechanism working rather than drift - but three is further behind than it has ever been, and0.8.0a3’s windowed sampler is the first skipped release an R user would actually want, since anyone settingsplitsfrom R pays 13.8 minutes an epoch instead of 9.4 until the pin moves.
[0.8.0a3] - 2026-10-08
Changed
A tiled run shuffles in windows, and trains roughly twice as fast. The dataset has always cached decoded samples -
_loadsays “cached because every tile asks again” - but training shuffled over tile indices, so a cache of eight held nothing against a working set of six hundred and nearly every tile paid for its own decode.TileShuffledraws a window of samples, shuffles all of their tiles together, and moves on. One decode then serves every tile of its sample, and a batch still draws from several sources. The window is the cache size by construction: a wider one would evict a sample while its own tiles were still being asked for.Measured on the loader alone, FIVES retinas at 2048 cut sixteen ways:
96 tiles in order 4.68 s 49 ms a tile 96 tiles shuffled 24.37 s 254 ms a tile 96 tiles, windowed 4.72 s 49 ms a tileAnd end to end, Data Science Bowl cut 2x2 at 128, three seeds of thirty epochs each:
windowed dice 0.8996 +/-0.0024 23.0 s an epoch full shuffle dice 0.9036 +/-0.0037 40.6 s an epochThe speed is established and the quality difference is not. Paired by seed the difference is +0.0023, -0.0060, -0.0082 - mean -0.0040 against a standard error of 0.0032, so 1.24 standard errors, with two seeds of three favouring full shuffling and one against. A hint rather than a finding, and three seeds cannot settle a difference that size. Recorded here rather than rounded away: at 1.76x the epochs for the same minutes, a run can buy back more than 0.004 of Dice, which is what makes shipping it the honest call rather than a convenient one.
Nothing external changes, and no interface moved. A seeded tiled run will not reproduce a result from before this release, because the order the tiles arrive in is different - which affects nobody known: no example, configuration or article sets
splits, checked rather than assumed.SegmentationDataset.cache_sizeis public, because the loader sizes its window from it.
[0.8.0a2] - 2026-10-08
Added
cldice, a metric for structures where Dice asks the wrong question. Centerline Dice (Shit et al., CVPR 2021): each mask is scored against the other’s skeleton, so it measures whether a structure is connected rather than whether its pixels coincide. Vessels, airways, neurons, cracks, roads, catheters.The argument, measured here rather than quoted: a nine-pixel vessel drawn two pixels thin scores Dice 0.875, and the same vessel severed in the middle scores Dice 0.947 - Dice prefers the severed one. clDice gives them 1.000 and 0.943, which is the other way round. Its limit is measured too: at one pixel wide, a one-pixel displacement leaves no overlap at all and every overlap-based metric reads 0, this one included.
The soft skeleton is iterated min and max pooling, which is differentiable, so the same function can serve a loss later; a hard skeleton would have been cheaper and not comparable with the paper. Rank-generic, and verified against
scipy.ndimage’s own morphology - exact agreement, 2D and 3D, on random masks.Two silent failures are refused rather than scored:
- a structure thicker than
iterationscan peel has an empty skeleton, and the ratios then read smooth/smooth. Measured: a 24-pixel square atiterations=1gives clDice 1.0 to a prediction whose Dice is 0.0017. Refused by name; include_backgrounddefaults to False here where every other metric defaults to True. The background’s skeleton lies inside the background by construction, so that class scores 1.0 whatever the model did - averaging it in moved 0.7865 to 0.8933 on a three-pixel vessel. Not a flattering average: a number with no meaning in it.
- a structure thicker than
Changed
- A tiled run refuses a whole-mask metric.
splitshands the model pieces, and a skeleton is a property of a whole mask, so every structure would be severed at four tile edges and come back low for a model that is perfectly connected - silently. Refused when the specification is read, which is before anything is loaded. Dice is unaffected: its pieces sum, which is whatcombineexists for.
[0.8.0a1] - 2026-10-08
Added
The engine draws.
plot_masks,plot_boxes,plot_anchors,overlay_maskandoverlay_agreement, under the names the R package gave them, returning a matplotlibFigureor an RGB array and never showing or saving anything - the caller decides. matplotlib is a hard dependency: a plotting function behind an extra is a documented feature that fails for whoever did not know to ask for it, which has happened here before.The decisions a drawing makes - which colours mean found, missed and invented, how much of the image an overlay lets through, how a box is labelled, which boxes are worth drawing - live in
pyplatypus.styleand are reachable in one call asdrawing_style(). Two packages that each chose their own would come to disagree about what red means.read_imageis public, with theArgsandReturnsit never had. Boxes come back frompredictin the source image’s own pixels, so drawing them needs the image at its own size, and until now that meant reaching intopyplatypus.data. R has exportedread_images()since the rewrite began.plot_anchorstakes aDetectionEngine, as R’s takes a fit, and asks it for the anchors and the box shapes in one call. Widths from one place and anchors from another is how a figure comes to show boxes in different places from where the anchors were fitted to them, which looks like a bad fit and is a bug.plot_masksdraws a plane of a volume, and refuses a volume without one. A volume shown as one picture is either a lie or a projection nobody asked for.--figureson all four example scripts, each drawing what its table cannot say.
Changed
Nine engine methods take the default they documented. Every one of them said
model_name“defaults to the first” and every one required it, so omitting the name raisedTypeErroron nine reference pages.evaluate_cases,predict,report,crops,box_shapes,anchor_coverage,evaluate_classesandevaluate_images, across both engines. The resolution is one method onEngineBase, so the two cannot come to answer it differently.plot_masksdefaults to the black-and-white colormap R defaults to, andplot_anchorsto a linear scale as R does.
Fixed
A mask holding a class the colormap has no colour for was drawn rather than refused, on one of the two ways in. A one-hot mask with too many channels was refused by name; an index mask was clipped, so a four-class mask drawn with two colours showed classes 2 and 3 in class 1’s colour and said nothing.
plot_boxeslabelled every real prediction with an integer.predictputs the class indices underlabelsand the names undernames, and the figure readlabels. Both halves were green and the join was wrong.Three example scripts could not build a configuration at all, and had not been able to since 0.5.0a1: they sent
n_class, which left the specification in that release, and three of them never sent the requiredtask. Nothing ran them -examples/is in ruff’s gate, which reads their layout.tests/test_examples.pynow hands each one’s configuration to the loader, with the arguments read off each script’s ownparser.add_argumentcalls so a renamed flag is followed rather than restated.
[0.7.0a3] - 2026-10-07
Added
A guide to writing a configuration, by hand, from one model to several - and a page that explains every field, generated from
spec_schema()at docs-build time: every block, every field, its type, its default and the description the pydantic model carries. 206 descriptions were written for 0.7.0a1 and until now the only way to read one was to callspec_schema()in Python - the site’s own “see every field a configuration accepts” pointed at that function, which is documentation that requires an interpreter. An R user could reach them not at all.It is the engine’s page and there will not be a second one. The configuration is the one thing that is identical between the two packages - the same YAML, read by the same models
- so the R package’s site links here rather than keeping a copy, which is the arrangement §4aa of the project notes spent a day establishing elsewhere.
A Citation page, and
CITATION.cff. The R site had one and this one did not: R generates it from DESCRIPTION, which is that language’s convention, and CFF is this one’s - GitHub reads it for “Cite this repository”, and the page is rendered from it so the two cannot disagree. A test holds itsversiontopyproject.tomland__version__, because it is a committed file no release step reads and nothing else would notice it going stale. The year comes fromdate-releasedrather than the clock, so a page built next year does not restate the citation as next year’s.The About section is one ordered list now rather than pages-then-links, which is what forced Licence before Citation and could not express the order the R sidebar uses.
The JSON Schema is published, so
# yaml-language-server: $schema=...on the first line of a configuration gives completion and checking in any editor usingyaml-language-server.
Fixed
SCHEMA_IDnamed a URL that was a 404. It saidmaju116.github.io/platypus/schema/spec.schema.json- the R package’s site - and nothing there served it, so the$idpromised editor validation that could never work. Verified 404 on both sites rather than assumed. It is now on this package’s own site, which is where the file is generated and published from; pointing it at the R site would mean one repository serving another’s artefact for no gain. The old value cannot be in use by anybody, because it never resolved.
Notes on how the page is built, because three choices were measured rather than picked
Definition lists, not tables. A table was the first shape, and measuring the descriptions killed it: median 202 characters, ninth decile 383, four carry fenced code blocks - which do not render inside a
|cell - and one carries a|of its own, which silently splits the cell it lands in.Unions are named by their
name:tags, not by the pydantic classes behind them, because the tag is what gets typed. Those discriminators sit on the field rather than behind a$ref-loss,metrics,optimizerandcallbacksall do - and reading only the$refleft four fields described as “any”.Every cross-link points at an explicit
{#id}. Guessing how the renderer derives an id got it wrong: pandoc keeps the underscore intask: semantic_segmentation, so a link written as#task-semantic-segmentationwent nowhere. Measured in the rendered HTML.Every configuration the guide shows is validated by a test, which is the check a written-by-hand page needs and a generated one does not. It earned its place while the page was being written: three of the six blocks were wrong before the prose was finished
model_checkpointhas nomode, it does require apath, andanchors: autois not a thing,autobelonging towindowwhile anchors are fitted by being left out. A reader would have copied each one and been refused. The guide’s section titles are pinned too, because the R package’s guide walks the same ones.
Five tests on the generated page, each proven able to fail. Coverage is asserted against the schema’s own reachable definitions rather than against a count - a count is what let §4as’s coverage guard pass with a third of the model tree invisible to it - and removing the nested-block expansion, which is how
split:andaugmentation:reach the page, fails two of them.
[0.7.0a2] - 2026-10-07
Fixed
available_transforms()decides membership by type rather than by the shape of the name, so the ten things it offered that a specification cannot name are gone: the eight composition classes (Compose,OneOf,OneOrOther,RandomOrder,ReplayCompose,SelectiveChannelTransform,Sequential,SomeOf) and the two parameter dataclasses (BboxParams,KeypointParams). None was ever usable - anAugmentationStepis a flat name and a dict of parameters with no nesting - so naming one passed the check here and failed when the pipeline was built, two layers below the question asked.The old filter kept anything capitalised that did not start with
Base,BasicorDual, which was doing two jobs at once: excluding the interface classes and excluding non-transforms. Type does the second properly. For the first there is no rule to derive, and that was measured rather than assumed -DualTransform(),ImageOnlyTransform()andTransform3D()all instantiate without complaint, forty genuine transforms inheritapplyinstead of defining it, and “is a superclass of another public transform” catchesAffine,Blur,HorizontalFlip,NoOp,PadandD4, which are all usable. So those four are excluded by identity, with a test pinning the resulting counts so a base added upstream fails rather than appearing silently.NoOpis why the defining module cannot decide it either: a real transform living beside the four inalbumentations.core.transforms_interface.The docstring’s counts were wrong, and one of them was never a fact. It said “71 work on volumes and 33 do not”, which is 104; on the same albumentations 2.0.8 the old list returned 130. The corrected list is 118 transforms, and a test parses that number out of the prose and compares it to what the function returns -
albumentationsis pinned only as>=1.4, so an upgrade now names the new value instead of letting the documentation drift again, which is how the previous numbers survived two corrections elsewhere.The volume count is not pinned, because it is not portable, and that was found by pinning it: the first version of this test asserted all three numbers and one job of twelve answered “the docstring says 118/87/31; measured 118/88/30”. The rank-3 list is produced by running each transform against a probe, and eleven of the thirty-one it rejects fail for the probe’s reasons rather than albumentations’ - nine require three channels where the probe has one, and
Crop,FrequencyMasking,TimeMaskingandSuperpixelsfail on its 8x8 size - so which of them tips over is environmental.Which job it was is worth stating precisely, because the obvious reading is wrong: 87 on all four Linux builds, on both macOS builds and on Windows with Python 3.10, and 88 on Windows with Python 3.13 alone. Neither axis explains it, and no mechanism is claimed. So the prose states the portable number, says the other one is not, and explains why; what is asserted about rank 3 instead is that it is a strict, non-empty subset of rank 2.
Accounting, so the change is checkable: 130 -> 118 removes the 8 composition classes, the 2 dataclasses, and
ImageOnlyTransformandTransform3D, which the name filter had admitted. On volumes the old 97 becomes 87 here, the difference being the 10 non-transforms, which had been passing the volume probe spuriously.
Noted, not fixed
- The rank-3 probe is one channel and 8x8, which is why eleven transforms are reported as unable to take a volume when what they cannot take is the probe. Enlarging it is not obviously right: a three-channel probe would list
ChromaticAberrationand its eight relatives as available to someone whose CT has one channel, and the listing cannot know the channel count - only the pipeline-build check can, and it already probes at the model’s own input size. The size half (Crop,FrequencyMasking,TimeMasking,Superpixels) has no such objection and is worth doing on its own.
[0.7.0a1] - 2026-10-07
One name per concept, across both packages. The R surface and this engine had grown two words for several of the same things - available_augmentations against available_transforms, save_weights against export_weights, mask_report against inspect_masks - and a reader moving between the halves paid for every one of them. The rule settled on is that the engine’s name wins, because it is the layer that cannot be renamed later without touching the configuration format and the schema; the exception is where the R package already had a family of names, and available_* was one.
Changed
known_weights()is nowavailable_weights(). The R package already called it that,available_transforms()is the same verb, and “known” said nothing the other two did not say better. A breaking rename rather than an alias: two names for one thing is the thing this release removes.
Added
available_transforms()is exported from the package root. It was reachable only aspyplatypus.spec.components.available_transforms, while the refusal a user meets when a 3D augmentation is unsupported tells them to “seeavailable_transforms(rank=3)” and does not say where it lives.from pyplatypus import available_transformsraisedImportError.tests/test_public_api.py. Four checks on the front door, none of which existed: every name in__all__resolves,__all__is sorted, both listings are reachable, and- the general form of the bug above - every function a user-facing message tells somebody to call is importable from
pyplatypus. Each was proven able to fail by mutation; removing theavailable_transformsimport fails three of them, namingaugmentation.pyas the file whose message would have lied.
- the general form of the bug above - every function a user-facing message tells somebody to call is importable from
Not changed, and deliberately
onehot_to_colours()keeps its name. Pairing it with the R package’smask_colours()was proposed and measuring killed it: this one takes a one-hot or probability array and argmaxes it, R’s takes class indices. Two names because they are two functions.Engine/DetectionEngine/build_enginekeep theirs. The R package has no name for the engine at all, which is a difference of idiom - an object with methods against verbs on a fitted model - and not a divergence to resolve.
[0.6.0a4] - 2026-10-07
Added
swa: average the weights over the last part of the run. Closes maju116/pyplatypus#25.callbacks: - name: swa start: 0.75 # the fraction of the run after which averaging begins learning_rate: 1e-3 # held while it averagesWhat it is worth, and it is not what a table of scores shows. Three seeds, 60 epochs, lesions with ambiguous edges:
Dice volume bias |volume error| plain 0.9639 ±0.0100 +1.71% ±12.18% 12.60% ±4.19% swa 0.75 0.9667 ±0.0087 +2.08% ±2.15% 12.38% ±4.31% swa 0.5 0.9640 ±0.0085 +2.78% ±3.44% 13.75% ±4.21%Dice does not move and neither does the per-case error - both inside the seed noise. What moves is reproducibility: the volume bias of the plain runs was +4.5%, +12.2% and -11.6% across seeds, and with averaging -0.1%, +4.2% and +2.1%. A spread 5.7 times tighter, and paired per seed the distance from unbiased improved on all three, by 7.34% at 4.9 standard errors. Which is what averaging is for: a point in the middle of a flat region is the same point whichever corner the last epoch wandered into.
Batch-normalisation statistics are recomputed by a pass over the training data, and that is the step this feature mostly consists of. An averaged weight tensor inherits the statistics of whichever epoch was last rather than averaging them, so without the pass the model is evaluated under the wrong normalisation and scores far worse than it should with nothing to say why.
TrainingStategainedtrain_loaderfor it - a callback that cannot reach the data cannot do SWA honestly.swawithcosine_annealingis refused. Averaging needs the weights to still be moving; a cosine has decayed to its floor by the time averaging begins, so the average is just the last epoch and the callback did nothing - configured, silent, and indistinguishable from not having asked.swa.learning_rateis the other half of the recipe.reduce_lr_on_plateauis not refused: it lowers the rate on evidence rather than on schedule and may never fire.Nothing is replaced when a run ends before averaging began - early stopping can do that, and substituting one epoch’s weights for “the average” would be a lie about what happened.
[0.6.0a3] - 2026-10-07
Changed
EngineBase: the half of the two engines that is the same work. Closes maju116/pyplatypus#100, which asked for the split into a segmentation and a detection engine plus a gate for future ones plus shared methods in a base. The first two shipped earlier - two classes, andtaskas a required discriminated union, which turned out to belong in the specification rather than in a class hierarchy. This is the third.The width was measured rather than chosen. Across the two engines twelve method names are shared and only two were the same work:
__init__at 0.70 similarity and_discover_testat 0.65, the latter differing in nothing but its docstring and the name of one hook.predictis 0.05 similar and equal in length by coincidence. So the base holds split discovery, the test-split fallback, and the two refusals that go with them - and nothing else, because pulling uppredictordatasetwould produce a method that is mostly a branch on its caller.The argument was never tidiness. These two had already diverged twice: detection recorded which splits carry annotations while segmentation threw the same fact away, and the guard order that let “no masks” stand in for “no split” was wrong in both. The second time, the same conditional was written twice on one night.
Engine 22 -> 20 methods __init__ similarity 0.70 -> 0.61 DetectionEngine 28 -> 27 methods the discovery block: ~25 lines -> 2, in bothA subclass provides
_has_any_labels()- masks and annotations are found in different ways - andlabels_are, the one word the shared refusal has to name.tests/test_engine_base.pyasks the same question of each and compares the answers, which is the test that was missing; reverting the base’s own logic breaks three of them across two files.
[0.6.0a2] - 2026-10-07
Added
validation: false: train on everything and measure nothing, said out loud. The third and last way of answering the questionvalidation_pathandsplitanswer.data: train_path: images/ validation: falseA final fit on every case you have, once the hyperparameters are settled, is a legitimate thing to want - and until now it meant inventing a split and ignoring the number it produced. Closes maju116/pyplatypus#44, whose third case was exactly this.
Silence is still an error. A specification with neither a path nor a split is refused as before, and the message now names this option: “I have no validation set” and “I forgot” look identical, and only one of them is a decision. Giving
validation: falseand a path or a split is refused too - they say where the validation set comes from and this says there is not one.The validation split is then absent rather than empty. An empty one makes every count read zero and every average read nan, which is a number for something nobody asked for; a missing split makes
evaluatesay so.A callback cannot wait for a number that will never arrive. Early stopping on
val_lossin a run with no validation trains to the last epoch while waiting, and checkpointing writes nothing - both silently. Refused where the model and the data are both visible, since neither alone can answer it.
Fixed
- “no masks” and “no split” are different things, and the messages had them confused.
evaluate()defaults to"validation", so a run specified withvalidation: falsemet “the ‘validation’ split has no masks, so there is nothing to score against” - true of nothing, and it sends somebody looking for files they never wrote. Both engines now ask whether the split exists before asking whether it is labelled.
[0.6.0a1] - 2026-10-06
A minor bump rather than another alpha letter: the data path grew a third item and the loss interface grew a flag, both of which a custom loss or loader would notice.
Added
boundary: a loss that knows how far a wrong voxel is from the truth. Dice and IoU count a voxel the same wherever it sits, which is why a model can reach 0.88 on Dice while its volumes run a fifth too large - the overshoot is all at the boundary, and for a small lesion the boundary is most of the object.loss: name: boundary region: {name: focal, gamma: 2.0} # or dice, iou, tversky, ... alpha: 0.9mean(phi * p)added to a region loss, wherephiis the signed distance to the truth’s boundary - negative inside, positive outside. Closes maju116/platypus#37, which asked for focal combined with a distance metric;regionis how any of the nine is combined with it rather than one hard-coded pair.What it buys and costs, measured. Three seeds, 60 epochs, lesions with ambiguous edges, against Dice alone:
Dice volume bias volume |error| dice alone 0.9525 ±0.0027 -5.18% ±3.11% 16.90% ±0.90% boundary a=0.9 0.9411 ±0.0093 -0.06% ±4.15% 22.17% ±2.88%It trades accuracy per case for being unbiased over a series. “Is there a lesion” wants the overlap; “has it grown since March” wants a volume that is not systematically wrong, and no single number answers both. The bias improvement is suggestive on three seeds (the baseline’s own bias wanders ±3.11%); the costs are established.
alphadefaults to 0.9, not 0.5, because 0.5 was measured and is unusable: at that weight the surface term has half the objective while the prediction is still random, and three seeds gave a volume error spread of ±28.28% with every number worse than the baseline. Kervadec schedules it downwards from near 1; 0.9 is the closest a single number comes.
Changed
The data path can carry a signed distance map, and the loss decides. A loss sets
needs_distance,loss_needs_distance(spec)answers it from the specification, the loader computes the transform in its workers and the batch arrives with three items instead of two.In the loss it would have dominated training: one transform costs 5.3 ms at 256x256, 23.4 ms at 64x64x32 and 709.8 ms at 128^3, against an epoch of about half a second for a small 3D model. The paths that score or predict rather than optimise never call the loss, so they ask for two items and pay nothing.
It is recomputed every epoch rather than cached: augmentation moves the mask, and a map cached against a sample index would describe a shape that is no longer there - silently, since nothing ever looks at it.
scipyis a direct dependency. It was always installed, because albumentations requires it, but a package whose code imports scipy should say so rather than rely on somebody else’s dependency list not changing.
[0.5.0a6] - 2026-10-06
Added
crop_boxes()andDetectionEngine.crops(): every detection cut out of the image it was found in. The pipeline is a detector followed by a classifier it does not contain - find objects with three classes, crop them, hand the crops to something that knows eighty.predictreturns boxes in each image’s own pixels precisely so they can be used on the photograph they came from; this is what uses them.for found in engine.crops("bccd", "test", size=(224, 224)): batch = np.stack(found["crops"]) # one shape, ready for a classifierFive decisions, each of which taken the other way quietly changes what a downstream model sees:
- Cut from the source image, not the network input.
DetectionDataset.source_imagere-reads at native size through the same reader and the same options asread(), so a crop and a prediction cannot disagree about channels or the DICOM window. Cropping from the letterboxed frame would cut a downscaled object and then scale it back up. - Rounded outward, so the crop contains the whole box. Rounding to nearest loses up to a pixel per side, a twelfth of a 26-pixel platelet.
contextexpands by a fraction of the box’s own size, default 0, so one value suits a platelet and a white cell and nothing is expanded silently.sizeletterboxes rather than stretches. Resizing a tall box to a square changes the aspect of every non-square object;fit="stretch"exists and must be asked for.- Always a list, even when
sizemakes the shapes equal. A return type that depends on an argument makes every caller branch, andnp.stack(crops)is the batch.
crops()filters atoperating_pointrather thanscore_threshold, which is near zero so that average precision can integrate the whole ranking - cropping that would hand a classifier the tail AP exists to measure over.It also clips and
drop_degenerates first, reportingdropped. That was found by the tests rather than reasoned about: a model may predict a box off the frame andpredictreports what it said, so at a low threshold some arrive with no extent at all once the letterbox is undone. The same two stepsDetectionDataset.readalready applies to truths.Closes maju116/platypus#95.
- Cut from the source image, not the network input.
[0.5.0a5] - 2026-10-06
Added
box_loss: score the boxes as1 - GIoUinstead of as YOLOv3’s offsets. Defaultoffsets, which is what the publishedbccd-yolo3weights were trained with, so nothing changes unless asked.It is not the better objective, and that is measured. BCCD’s own test split, three seeds each, 150 epochs:
mAP@0.5 mAP@COCO matched IoU giou 0.8666 ±0.0147 0.5078 ±0.0083 0.7929 ±0.0069 offsets 0.8583 ±0.0167 0.5172 ±0.0195 0.8038 ±0.0001Average precision cannot separate them in either direction - both gaps are inside the noise. Matched overlap can, and
giouis worse by 0.0109, which is 2.7 standard errors of the difference; it is also sixty times less repeatable on exactly that quantity (offsetsgave 0.803853 / 0.803656 / 0.803861 across its seeds).The reason is in the same runs’ numbers: GIoU exists because IoU is a flat zero for boxes that do not touch, and anchors fitted by k-means already cover BCCD’s truths at a mean IoU of 0.877, so predictions never start disjoint and the advantage never arrives. Where fitted anchors cover poorly it should be a different story, which is untested and therefore not claimed.
What it is for is reading the loss. The offsets term cannot reach zero - cross-entropy against a soft target bottoms out at that target’s entropy - so all three runs converge to 5.90-5.94 against a measured floor of 5.891, and a converged run prints what a stalled one prints. Under
gioua prediction constructed to be exactly right scores0.000000, and on real data the term reads 0.05 on training against 0.47 on validation: a localisation gap that is visible because zero means zero. On BCCD that legibility costs about 0.011 of matched IoU._giouagrees withtorchvision.ops.generalized_box_iouexactly (0.0e+00 over 42 random pairs), with the cases baked into the tests so the suite needs no torchvision.Closes maju116/platypus#27.
[0.5.0a4] - 2026-10-06
Fixed
Anchors may be a grouped array, and the flattened form is refused by name.
_flatten_anchorsopened withif not anchors:, which an ndarray answers withValueError: the truth value of an array is ambiguous- so the guard whose only job is to explain empty anchors reported numpy’s complaint about emptiness instead, and a grouped(3, n, 2)array, the natural type, could not be passed at all.Two things made it reachable rather than theoretical:
encodeanddecodeare public, and the package offers the wrong-typed value under an inviting name -AnchorFit.flatis an(N, 2)array and is what one reaches for after fitting anchors.grouped tuple / list / (3, n, 2) ndarray accepted, identical output empty list / empty ndarray "anchors is empty; YOLOv3 needs one group ..." AnchorFit.flat / a list of N pairs refused, naming `.anchors` not `.flat`A flat
(N, 2)array is refused rather than divided by three. It has thrown away how the anchors split between the output grids, which is half of what the function returns, and three equal groups is right for YOLOv3 and wrong for a two-head model; an anchor assigned to the wrong stride shows up in no metric.The R surface already refused a flat matrix by name, so this brings the engine up to the standard the visible half already set. Found while reading the issue tracker, where a 2022 report of the same mistake in R -
the condition has length > 1- was being closed.
[0.5.0a3] - 2026-10-06
Added
split: divide the training folder instead of naming three paths. A researcher with one directory had to run a splitting tool, point three paths at its output, and remember to switch mode - and when they did not, the refusal said onlyvalidation_path: Field required, which is true and names nothing they could do about it.data: train_path: images/ split: fractions: [0.8, 0.2] # two, or three to cut a test set as well group_by: "^(patient\\d+)_" # required key, may be nullExactly one of
splitandvalidation_path, for the reasoncolormapandlabelsare exactly one: two sources for one thing are two places to change it.group_byis required and may benull. Everything sharing a group lands in a single split - usually a patient. It is required rather than optional because the mistake it prevents leaves no trace: slices of one patient in training and validation at once make validation measure memory rather than generalisation, and the score comes out several points too high with nothing in the output to say so. An omitted key would be that choice made silently;nullis the same choice made on purpose.splits.pyhas refused a pattern that matches nothing since it was written, for the same reason; this extends it to never having asked.Nothing is written.
split_samplespartitions what was already discovered.split_dataset()is still the tool when the CSV files are the point - to keep, to hand to a colleague, to cite - but being read should not leave files behind.A test set cut this way is scoreable, because it came from annotated data. Unlike a separate
test_path, which may be images alone and is recorded as unlabelled, the third fraction can be evaluated and not only predicted on.The two-or-three rule is not restated in the spec: it calls
_fractionsfrom the splitting module, which already had it.
[0.5.0a2] - 2026-10-06
Fixed
Segmentation now records which splits carry masks, as detection always has. It discovered the fact and threw it away: a test split was always found with
only_images=True, so two things were wrong at once and in opposite directions.A test folder of images alone built a dataset that would try to read masks and fail on the first item with
MaskError: no masks to unite- true, two layers below the question that was asked, and about the wrong thing.evaluate("test")now refuses by name: “the ‘test’ split has no masks, so there is nothing to score against. predict(‘test’) works on it.”And a test folder that did carry masks was never recognised as scoreable, because discovery never asked for them.
evaluate("test")on a complete test set now simply works, where before it failed exactly as it did on an empty one.dataset(..., only_images=...)defaults to what the split actually has rather than toFalse. Passing it explicitly still overrides.“No masks” and “some masks” stay different. Falling back whenever labelled discovery failed would turn a split with two missing files into an unlabelled one, discarding the seventy that are there and reporting nothing - so the fallback happens only when the split carries no masks at all, and an incomplete one raises. Taken from the detection side, which met this first.
[0.5.0a1] - 2026-10-05
Breaking. Three fields in a model block were assertions wearing the clothes of settings - each one restating a fact that lives somewhere else, able only to agree or to be wrong.
Removed
n_classis no longer a model field. The number of classes comes from the data, fromcolormaporlabels, and always did. The proof that the field was wrong is what left with it: a spec-level validator existed for the sole purpose of catching a model disagreeing with its own data. There is nothing left to disagree.The count still reaches the weights sidecar - contributed by the engine, from the half of the specification that knows it - so weights trained for a different number of classes are refused exactly as before.
build_model(spec, n_class=...)takes it as an argument now: a network’s head is that wide, so it has to be told, and saying so in the signature is honest.
Changed
channelsis derived fromchannels_fromwhen the model does not state it. Unliken_classthe field stays, because withoutchannels_fromit is a real choice - the same files can be read as one channel or as three. Stated, it is still checked and still refused when it disagrees; silent, it is filled in.A weights file’s own geometry is adopted.
architecture,blocksandfilters- andanchors_per_gridfor a detector - are taken from the sidecar where the specification stayed silent. Using somebody else’s published model meant knowing its internals (dsbowl-unetis four blocks of sixteen filters) and being refused for guessing. Detection has adopted its anchors this way since 0.3.0a12; this is the same move applied to the rest of the fingerprint.model_fields_setis what makes it safe: a value you wrote and a default that happened to be there are the same number and not the same claim. Anything stated is left alone and still has to agree, so this loosens what may be omitted and nothing about what is checked.input_shapeandchannelsare deliberately not adopted. The rank comes frominput_shapeand is needed while the specification is validated - before any sidecar can be reached without a download - and the data pipeline reads both before a network exists. A specification that cannot be checked offline is the air-gapped hospital problem this project has carried since RECON.md. Pinned by a test, so it reads as a decision rather than a gap.
Migrating
Delete n_class from every model block; nothing replaces it. If the count was right it was redundant, and if it was wrong the run was already being refused.
[0.4.0a1] - 2026-10-05
Breaking. A minor bump rather than another alpha letter, because the configuration format changed and a number that hides that is a number doing nothing.
Changed
taskis required. It was defaulted to segmentation so that files written before detection existed kept working. The default is gone: a configuration that does not say what it is asking for means whatever version reads it, and more tasks are coming.The default also sent the bill to the wrong person. A detection configuration missing its
taskwas validated as segmentation and reportedclassesandanchors_per_gridas extra fields, never naming the tag - exactly the confusion a discriminator exists to prevent.Both task names are spelled out:
segmentationis nowsemantic_segmentationanddetectionis nowobject_detection.segmentationstops naming one thing the moment instance segmentation exists, and a value that has to be reinterpreted later is worse than a longer one now. These are also the two words the 2022 package used for its own top-level configuration keys, so this is a return rather than an invention.Both old values are recognised by name, because they are the only strings an existing file or an older script can contain:
task: segmentation -> "`task: segmentation` was renamed to `semantic_segmentation`." task: detection -> "`task: detection` was renamed to `object_detection`." (missing) -> "a configuration has to say what it is asking for: add `task`, one of 'semantic_segmentation', 'object_detection'."Left to pydantic, each of these would have been an “input should be …” list that the reader has to decode. A rename the reader must deduce is a rename done to them.
Migrating
Add one line to every configuration, and change it if it was already there:
task: semantic_segmentation # or object_detectionNothing else moves. The R package builds task from its own constructors and sends it, so R code needs no change beyond pinning an engine of this version or later.
[0.3.0a15] - 2026-10-05
Fixed
0.3.0a14 reports itself as 0.3.0a13, and this release is that release with its version corrected. The version lives in two places -
pyproject.tomlandpyplatypus.__version__- and 0.3.0a14 bumped only the first. Nothing failed: the wheel built, the metadata was right, 942 tests passed and the release went out. The only visible symptom was the R package refusing to believe the engine was the version it had pinned, which is that check doing exactly what it is for.It matters beyond cosmetics because
__version__is what gets written down.write_record()stamps it into every run record andexport_weights()into every weights sidecar astrained_with, so a wrong value is wrong provenance in files that outlive the release. Anything produced by 0.3.0a14 is labelled 0.3.0a13.tests/test_version.pynow pins the two literals to each other, and to the installed distribution’s metadata when there is one. Every release from 0.3.0a11 to 0.3.0a13 happened to keep them in step; nothing required it.Use 0.3.0a15. 0.3.0a14 works - the only thing wrong with it is the number it gives for itself - but a package that misreports its own version has no business being pinned.
[0.3.0a14] - 2026-10-05
Added
evaluate_images(): one row per image for detection. The counterpart of the segmentation engine’s per-case scores, and the question a table of averages cannot reach - not how well on average, but which images it fails on. A mean over a split says 0.86; it does not say the misses are concentrated in four frames where the stain is dark, and that difference is usually about the data rather than the model.Columns are
key,n_truth,n_predicted,matched,missed,spuriousandmean_matched_iou. Sort bymissedfor the frames it cannot see, bymean_matched_ioufor the ones where it sees everything and places it badly - different problems, usually the data and the anchors respectively.There is deliberately no average precision per image. AP is the area under a precision-recall curve and therefore a property of a ranking over a whole dataset; computed on one image with three boxes it swings on a single box’s rank and means nothing - the same degeneracy as a per-case Dice on an empty truth mask. What is meaningful for one picture is counting and overlap, so that is what the row carries.
Counts are read at the specification’s
operating_point, not over the whole ranking. “How many were missed” is undefined at a threshold of zero, where every box the model dimly considered counts as a prediction andspuriouswould count the tail that average precision exists to integrate over.mean_matched_iouisNonerather than0.0when nothing matched: an image where the model found nothing and one where it found badly-placed boxes are different failures, and a zero merges them.Matching reuses
match_detections, the same function the dataset-wide report uses, so the rows are a decomposition of the table rather than a second implementation - pinned by a test that asserts they sum to it. The example prints the five worst frames and how many were exactly right.
[0.3.0a13] - 2026-10-04
Fixed
The colormap was described and not recorded.
pyplatypus.weightshas said since it was written that it cannot catch weights trained on a different colormap with the same class count - “those load cleanly and predict nonsense” - and it could not, because the colormap went into no sidecar. It was not inherent: the detection side already compared its class names, which is the same check. The colormap, or the labels for a label-map dataset, now go beside the weights and are compared on load.Weights published before this keep working, by construction rather than by a version check: the comparison skips a field the sidecar does not carry, and
dsbowl-unetcarries none. Pinned by a test rather than reasoned about.
Added
A run leaves a record. The weights are not the whole of a trained model: a segmentation model is meaningless without the colormap, and a detector without the anchors its boxes are relative to - which, when they were fitted rather than named, existed only in memory and in a weights sidecar somebody had to remember to export.
fit()now writes<output_dir>/<model>/run.json, only whenoutput_dirwas given.model_fields_setanswers that honestly: a field with a default cannot otherwise be told apart from one the user set to that default, and writing files into somebody’s working directory because a default exists is not a thing to do by surprise.The record is the specification plus what the run derived from it, rather than a summary: a summary is for reading and a specification is for running again. For detection that means the anchors, whether they were fitted, their coverage and the target survey; for segmentation
derivedis empty, which is the honest answer rather than an omission - the specification already carries the colormap, the input shape and the window.The test that matters puts the specification and
derived.anchorsback together and checks the engine used those anchors rather than fitting new ones.shape_table()andDetectionEngine.box_shapes(): every annotated box as a width and a height with the class it belongs to, beside the anchors in use, in one call and in one set of coordinates. What a picture of the anchor fit needs - a cloud of shapes coloured by class says whether a class has anchors near it at all, which no summary statistic does.box_shapes()andshape_table()share one implementation of the letterbox arithmetic, deliberately: two copies is the duplication that reads as harmless and ends with a plot showing boxes in different places from where the anchors were fitted to them - which looks like a bad fit rather than like a bug. A test holds them to the same numbers.box_shapes()keeps its old contract and does not require labels. The first version of the shared helper read them unconditionally and broke every caller standing in for an annotation with boxes and a frame.
Fixed
LossParts.as_dictturned tensors that still tracked gradients into scalars, which torch 2.14 warns about. Invisible in this package’s own environment: the venv here pins torch 2.7.1 for a Pascal card and does not warn, whilepy_require()in the R package resolves a current torch and does - so the R test suite is what saw it. The same mistake had already been made and fixed intraining/trainer.py, whose comment says exactly this.Not covered by a test, deliberately: the value is identical either way and the warning does not fire on the torch installed here, so a test would pass with the fix removed.
[0.3.0a12] - 2026-10-04
Object detection, end to end: a specification with task: detection trains a YOLOv3 through the same engine as a segmentation one, scores it per class against pycocotools-agreeing average precision, and hands the boxes back in each image’s own pixels. On BCCD over five seeds: mAP@0.5 0.8660 +/- 0.0159, mAP@[.50:.95] 0.5159 +/- 0.0199, mean overlap of matched boxes 0.8041 +/- 0.0026 - which brackets and exceeds what a hand-rolled version of the same recipe scored before any of this existed.
Still unreleased, and for the same reason as before rather than a new one. The §4f loop exists so the R package can reach a feature; R has no detection surface yet, so a release would serve nothing but the ceremony. It happens when the R side needs it.
Added
pyplatypus.detection, starting with metrics. The package this replaces had a YOLOv3 that trained and drew pictures and reported no precision, no recall and no average precision - its only number was mean IoU per grid, computed inside the loss, which measures agreement with the model’s own training target. So there was no way to say whether it detected anything, and no number to put beside published weights. Everything else is unmeasurable until this exists, which is why it is firstiou_matrix,match_detections,average_precision,detection_report. Pure numpy and no torch: they work on boxes, so they are testable without a model- Agreement with
pycocotoolsis a test, not a one-off check. mAP@0.5 and mAP@[.50:.95] match the COCO reference implementation to 1e-12 - the tolerance the suite asserts - on five reproducible problems, and those values are baked into the suite so the agreement is verified on every run without pycocotools installed. A detection number that disagrees with COCO is a number nobody can compare to anything
Added — detection in the specification
task, a discriminator on the specification:segmentation(the default) ordetection. It selects the type ofdataand of every entry inmodels, rather than switching a flag, so a detection configuration carrying acolormapor a segmentation one carryinganchorsis refused by name instead of silently ignored. One task per spec, not one per model, for the same reason there is one rank per spec: every model in a spec shares a data pipeline, and masks and boxes are not the same pipeline- A configuration with no
taskis a segmentation one, so every file and every released R package written before this keeps working unchanged DetectionData-classesin class order (position is the class index, stated rather than read from the files, where it would come out alphabetical),annotation_format,coordinatesfor the VOC 1-based-inclusive convention,strict_labels. No background entry, unlike a colormap: a region of an image holding no object is not a boxDetectionModel-anchorsas fractions of the input, fitted to the training data when unset;anchors_per_grid,ignore_threshold,score_threshold,nms_threshold,operating_point. Every one of these was a command-line flag inexamples/detect_blood_cells.py, which is where a setting lives when it has nowhere better to beDataSpecandModelSpec, the shared bases the two tasks are built from. What they deliberately do not carry islossandmetrics: segmentation picks both from a menu of nine and three, YOLOv3’s objective is part of its architecture, and mean average precision is not one option among several. A field that accepts a value and ignores it is worse than no field- Refusals that cost nothing now and a confusing failure later: detection at rank 3 (ImageNet is images and YOLOv3 is a 2D architecture), an input side that is not a multiple of 32, anchors given in pixels rather than fractions - with the conversion named, since COCO publishes its nine in pixels at 416 - anchors that disagree with
anchors_per_grid, grids with different anchor counts, duplicate class names, andcoordinatesset for LabelMe, which stores continuous pixel coordinates and has no convention to pick
Added — detection in the engine
bccd-yolo3in the weights registry: YOLOv3 at 416x416 for RBC, WBC and Platelets, trained on BCCD (MIT) using the dataset’s own split, pinned to commit24fbff08.mAP@0.50.857 on the 72 held-out images - the median of five seeds, not the best, because the spread is 0.0159 and reporting one run would be reporting whichever seed was chosen. The card states what decides whether the weights answer someone’s question: platelets are the unreliable class, precision 0.54 at confidence 0.5 and four times the seed-to-seed variance of the other two.Verified by fetching it by name from the Hub on a cold cache and scoring it: 0.8571 / 0.5003 / 0.8058, equal to the card and the sidecar to four places
DetectionEngine, andbuild_engine(spec)which returns it orEngineaccording to the task, so a caller holding a spec never has to ask. Two classes rather than one with a branch in every method: past discovery the two tasks differ at every step - three target tensors instead of one, a loss that is part of the architecture, and an evaluation that cannot be accumulated per batch because average precision is a property of a whole split’s rankingDetectionDataset- one sample to one example, through the letterbox and the target encoder. One sample is one example, with no tiling: cutting an image into a grid cuts boxes in half, and half a box is not a smaller objectDetectionTrainer, reporting the four parts of the loss separately for train and validation. A YOLOv3 total means nothing alone - cross-entropy against a soft target bottoms out at the target’s own entropy, so the coordinate term has a floor above zero that depends on the data.coordinates 5.93 / objectness 0.001is the difference between a model that has learned what is where and one that has stalled, and the total cannot tell them apartAnchors are fitted to the training annotations when the spec does not give them, and recorded on the run and in the weights sidecar. Not optional metadata: the same weights read with other anchors decode every box scaled by a fixed factor, with plausible boxes, plausible scores, wrong places, and nothing in any output to say so
The targets are surveyed before the first epoch, and a dataset the encoder loses more than 2% of warns. Two boxes of one shape whose centres land in one cell share a slot, so the second is never shown to the model and never counted as missed. Measured on BCCD at a 416 input: 3 boxes of 2804
evaluate()returns the detection columns -map_50,map_50_95,mean_matched_iou- and no overall precision or recall. Averaging those over classes needs a weighting and every weighting is a different claim: summed over BCCD’s 4155 red cells, 372 white and 361 platelets, a single precision is a statement about red cells wearing the costume of a statement about the model. They are inevaluate_classes(), per classpredict()returns a list, in each image’s own pixels. There is no array form - images differ in size and so does the number of boxes found in each - and a box in a letterboxed 416x416 frame cannot be drawn on the photograph it came from. The same decision asspace="source"on the segmentation side, except that here there is no alternativeanchor_coverage(), asked of whichever split you like. The useful question is about a split the anchors were not fitted on: 0.92 on training and 0.70 on validation says the two hold different objects, and no training curve shows thatA test split without annotations can be predicted and refuses to be scored. Scoring it against empty truth would report zero, which is a different statement from “there is nothing to score against”
config_filemode reads anannotationscolumn for a detection spec - the second slot is named after what labels an image, andwrite_splits(label_column=...)writes it
Added — a learning-rate schedule the specification can state
cosine_annealing, a callback decaying the rate from its initial value tomin_lralong a cosine. Nomonitor: it is a function of how far through the run you are rather than of how the run is going, which is the difference fromreduce_lr_on_plateau, and a run may legitimately want both.It exists because wiring detection into the engine found that the specification could not express the run that produced this package’s published detection number. The measured BCCD run decayed its rate; a spec could only hold it constant.
What the schedule is actually worth was then measured, and it is less than the gap it was reached for: adding it moved BCCD’s test
mAP@[.50:.95]from 0.4700 to 0.4761 andmAP@0.5from 0.8479 to 0.8496. The first explanation of that gap was wrong, and the measurement refused it; the rest of it was augmentation, which the engine did not do at all - the entry below. Attributing a gap to the plausible cause is the mistake this project keeps catching, and this time it took two tries.Both of those runs are single draws, so part of +0.0061 is the schedule and part is the draw - and five seeds of the finished recipe later put the standard deviation of
mAP@[.50:.95]at 0.0199, which is three times that difference. The schedule is kept because it is the recipe the measurement used and because the spec could not state it, not because its effect was established.DETECTION_RECON.md§12 has the account.Checked against
torch.optim.lr_scheduler.CosineAnnealingLRepoch for epoch, at four run lengths and two floors. “The rate goes down” is not the claim worth testing: if this were a schedule that merely resembled torch’s, comparing a run through the specification with the measured one would compare two experiments and blame the difference on the wrong thing.Each parameter group decays from its own initial rate, so
encoder_learning_rateis not flattened at the first epoch - which would have been invisible, since the history records onelearning_rate, the first group’s.TrainingStategainedtotal_epochs. A schedule that is a function of progress needs the horizon, and nothing else in the state implies it:epochcounts up and stops wherever early stopping stops it.
Added — augmentation for boxes
BoxAugmenterandbuild_box_augmenter: a spec’saugmentationlist now applies to a detection run, with the boxes following the pixels. albumentations again, declared the same way as for masks, so a detection spec and a segmentation spec name transforms identically- Every geometric transform in albumentations 2.0.8 moves boxes with the pixels, which was measured rather than assumed. A bright rectangle with the box labelling it, twenty seeded draws per transform, comparing the box that came back with the bounding box of the bright pixels in the output. Eight are exact to 0.00 px - the flips,
RandomRotate90,Transpose,D4, a pure translation, the crops - and five land within 1.00 px:Affinewith a rotation or a scale,Rotate,Perspective,GridDistortion. For those five the box bounds the warped corners while the pixels are what survived interpolation, so the test asserts the box still covers the object rather than equals its extent. A property of the library, so it lives in the tests where a version bump re-runs it min_visibilityon a detection model: how much of a box must survive a transform that removes part of the frame. A convention rather than a measurement, and the direction is what is defensible - a box keeping two pixels of a cell teaches the model that a two-pixel fragment is a whole cell, which produces false positives everywhere, while dropping a heavily truncated object only fails to teach it about that object. Pascal VOC marks such objectstruncatedfor the same reason. Irrelevant unless a transform can lose part of the frame, which flips and rotations never do- Training is augmented and validation never is: measuring a model on distorted data measures the distortion
Fixed
A probe that failed for its own reasons. The check that names a transform which cannot handle boxes ran against a fixed 32x32 image, so
RandomCrop(height=64, width=64)- a perfectly good transform - was refused with “crop size exceeds image dimensions”. A probe that fails for the wrong reason is indistinguishable from a real refusal, and this one reported the user’s transform as unsupported when it was the check that was too small. Both probes now run at the model’s own input size, which also keeps the refusal correct for a crop genuinely larger than the input.The 3D volume probe had the same defect and had had it since it was written: a fixed 4x8x8 volume refused any larger 3D crop. Found only because the box probe made the shape of the mistake obvious.
albumentationsrejects bad parameters with a pydanticValueError, not Python’sTypeError, so a misspelled argument escaped the handler that exists to name it and arrived as schema prose. Both are caught nowA decaying learning rate was invisible in the output.
learning_ratewas printed to four decimal places like every other quantity, so a cosine going from 1e-4 to 1e-8 readlearning_rate=0.0000from epoch 90 on, and a run with a schedule looked identical to one without. Found by watching a run and trying to confirm the rate was moving; no test would have askedseeddid nothing. The field has been on the specification since the first release, described as “set it if you want a reproducible run”, and no code read it - so in R,platypus_spec(seed = 1)made a promise and two runs of it disagreed. Both engines now seedrandom, numpy and torch at construction, which also seeds the generatorDataLoaderderives its workers’ seeds from, so augmentation in a worker process is reproducible too. Found while wiring detection in, where the anchors are fitted by k-means and the seed had to come from somewhere.Asserted by training twice and comparing, and - the half that makes the first half mean anything - by checking that two unseeded runs differ. Without that second test the first would pass on a package that ignores
seedentirely, which is the state it was in.What it does not do is ask torch for deterministic algorithms: that makes some convolutions much slower and makes others raise, so the result would be a seed that sometimes refuses to run. Two runs at one seed on one machine agree; across machines or cuDNN versions they need not
Changed
examples/detect_blood_cells.pywas rewritten onto the specification, which is the test of whether the specification earned its place. The first version assembled a detector by hand out ofpyplatypus.detection: a Dataset class, a training loop, a decode-and-score function and twenty flags. What is left is the part that is genuinely about BCCD - where its files are and what its canonical splits say - and the script writes out the YAML of the run it just did, beside the resultsLoading weights into a detector adopts the anchors recorded beside the file, because a detector’s weights only mean anything with them: read with any others, the same weights decode every box scaled by a fixed factor - plausible boxes, plausible scores, wrong places, and nothing in the output to say so. A file that carries no anchors is refused rather than guessed at, and so is one whose anchors-per-grid does not fit the head.
A specification naming both
weightsandanchorsis refused: two claims about one model with one of them untrue. Taking the file’s and warning would mean the specification no longer describes the run, which is the property everything else here rests on.The engine also checks what the model specification cannot answer for itself -
n_class, which sets the head’s width and lives on the data, and the class names, because weights trained on the same number of differently ordered classes load cleanly and label every box wrongly. The detection counterpart of weights trained on a different colormap.fit: falseis therefore a usable thing for a detector: load a published detector and predict with it, which is what a vignette needs to open with.The test is a round trip - train, export, load into a specification that names no anchors at all, and compare the boxes. Verified to catch wrong anchors by scaling the adopted ones by 1.2
weights_fingerprint()moved onto the spec, so what identifies a file of weights is an architecture’s own answer.blocksandfiltersidentify a U-shaped model and mean nothing to a detector, whose head width is set by its anchor count instead - a fixed list inpyplatypus.weightshad to reach for a field that is not thereA union tag no longer reads as a field. pydantic puts the matched tag at the head of every nested location, so a problem in a detection spec was reported at
detection.models[0].anchors; it now saysmodels[0].anchors. An enum used as a tag is also no longer rendered withrepr, so a mistyped task is told to use'detection'rather than<Task.DETECTION: 'detection'>The JSON Schema’s top level is now a
oneOfover the two tasks with adiscriminator, and the per-task fields live under$defs. Its docstring claimed it was shipped inside the R package; it is not, and has not needed to be - the R package sends the configuration to the engine and translates the engine’s refusal, which keeps one validator instead of two that can disagreeEnginerefuses a detection spec and says why. The spec validates and nothing trains from it yet; saying so beats failing somewhere inside the data pipeline, and beats a feature that is advertised and does not work. A detector is still assembled by hand frompyplatypus.detection, the wayexamples/detect_blood_cells.pydoesPlatypusSpecis now the shared base ofSegmentationSpecandDetectionSpecand is not built directly.from_dictandfrom_yamlreturn whichever the task asks for, and both are instances of it, so nothing that only needed a seed or a rank changes. Building the base directly says so rather than failing as two “extra inputs are not permitted”
Added — annotations, letterboxing and the target encoder
read_voc,read_labelme,read_annotationsanddescribe_annotations. Pascal VOC first, because that is what BCCD ships and what the old package’s readers handledLetterbox, which scales by one factor and pads, replacing the plain resize the old package used. That resize stretched a 640x480 photograph; it was internally consistent, since boxes were normalised by the source dimensions, but the COCO weights were trained on letterboxed input so loading them onto stretched images is a silent mismatch. The transform is reversible and carries what it did, so a box predicted in the network’s space goes back onto the pixels it came from - the detection counterpart ofpredict(space="source"). Padding is grey rather than black: black is a legitimate pixel value in a radiographencode/decode, boxes to the three target tensors and back, tested as exact inverses.anchors_per_gridcomes from the anchors given rather than a constant, and anchors are fractions of the input so the same ones describe the same shapes at 416 and at 608Encoding.unplacedcounts the boxes that cannot be represented: two objects of one shape whose centres fall in the same cell share one slot, so the second is lost. At the density of a blood smear a 416 input loses about one object in eleven and a 608 input loses none, which makes the input size a decision rather than a default - and is the difference between “the model is poor” and “the target never held half the cells”
Added — a detector, and the first number anyone can compare
Yolo3,Darknet53andbuild_yolo3. 61,949,149 parameters for 80 classes and three anchors, which is YOLOv3’s published figure - the one external check on the architecture’s inventory, and what the COCO weights require, since a structure that merely resembles Darknet-53 loads them cleanly and predicts nonsenseYolo3Loss, reported in four parts because one number cannot say what is wrong: a run whose coordinate loss falls while its objectness does not is finding the right places and refusing to commit. The ignore mask is the part most reimplementations drop - a cell that was not assigned a truth but predicts a box overlapping one contributes nothing to the objectness term, rather than being trained towards zero, which would teach the model to suppress correct answersnon_max_suppression, per class by default: a platelet on a red cell is two objects at one place and suppressing across classes deletes one of themDetectionMetrics.mean_matched_iouand a third return frommatch_detections: how well the boxes that matched actually fit. Average precision uses IoU as a threshold and says nothing about the fit, so this is the quantity the AP figures only imply. Weighted by how many matched, not a mean of per-class meansexamples/detect_blood_cells.py: BCCD fromgithub.com/Shenggan/BCCD_Dataset(MIT, and not the Kaggle mirror, for the reason given in 0.3.0a8’s notes), trained from nothing, with its own train/val/test split
Measured
150 epochs, 33 minutes on a GTX 1070, BCCD’s own test split:
mAP@0.5 0.8576 mAP@[.50:.95] 0.5050 mean IoU of matched boxes 0.8046
class AP@0.5 IoU truth prec@0.5 rec@0.5
RBC 0.7986 0.809 805 0.720 0.804
WBC 0.9546 0.854 71 0.922 1.000
Platelets 0.8197 0.707 69 0.524 0.942
The first number in this package’s history that can be compared with anybody else’s - the old YOLOv3 reported mean IoU per grid from inside its loss and nothing else, which is why its Blood Cell Detection example ended on a picture.
The ceiling is localisation, and it is size-dependent exactly as geometry predicts. AP by threshold: white cells hold 0.789 at IoU 0.80 while platelets fall from 0.820 to 0.041. A two-pixel error per side costs a 30-pixel box a sixth of its overlap and a 200-pixel box almost nothing. So mAP@[.50:.95] on a dataset of small objects measures how finely a box can be placed, not how well objects are found.
And the loss converged rather than stalled. It plateaus at 5.936 against a floor of 5.891, computed exactly on real batches: cross-entropy against a soft target bottoms out at the target’s own entropy, so the coordinate term cannot reach zero. Two runs agreed to 0.003 of mAP.
Added — anchors fitted to your own boxes
generate_anchors,fit_shapes,box_shapesandanchor_coverage. k-means over box shapes with IoU as the distance, k-means++ seeding, carried over from the old package - the piece of it with no equivalent anywhere in RAnchorFitcarriesmean_iou, the quantity the fit maximises and the number that says whether these anchors describe this data. Comparing it acrossanchors_per_gridis how the count gets chosen instead of assumed; the old implementation printed a class table and drew a scatter plot as side effects and reported no number at allanchor_coverageanswers “are COCO’s anchors good enough for my data” in one number rather than a training run. On blood-cell-shaped boxes: 0.67 borrowed against 0.92 fitted- The whole pipeline is verified against COCO’s published anchors. Plant the nine as clusters of boxes, refit from nothing, and COCO’s anchors come back in COCO’s groups to within 1-3 pixels at 416 - which checks the seeding, the distance, the convergence and the grouping at once
Fixed, in work carried over rather than in released code
Anchors are grouped into scales by area, not by width. Verified against the one external reference there is: sorting the nine COCO anchors by area reproduces their published grouping exactly, and sorting by width - what the old code did - does not. It puts (30, 61) in the finest grid and (33, 23) in the middle one, swapping them
Box shapes are measured in the space the encoder uses. The old code divided a box by its source image, which equals the fraction of the network input only when the image is stretched to fill it. With letterboxing a square object in a 640x480 image is square after letterboxing and 33% taller than it is wide under source normalisation. For a dataset of one image size the distortion is uniform and the model compensates; it stops being harmless the moment sizes are mixed or COCO weights are loaded
Pascal VOC’s one-pixel convention. VOC stores 1-based inclusive indices, so pixels 1 to 10 are ten pixels wide and
xmax - xminis nine - leaving 81% of the true area, which on a fifteen-pixel platelet is not a rounding question. The minima have 1 subtracted, once, where the format is known. Choosing wrongly is caught rather than silent: a minimum of 0 cannot occur under a 1-based reading, so a file containing one is refused with the alternative namedAn infinity in the old target encoding. It stored
logit(centre - floor(centre)), and that fraction is zero whenever a box’s centre lands on a cell boundary. Measured on a 416 input at grid 13: 37 of 1200 integer-pixel boxes, so about one in thirty had a-inftarget. The target now holds the offset itself and the loss applies the sigmoid, so nothing is inverted and nothing can be infinite
Decided, and said in the code rather than assumed
Two numbers both honestly called “mAP” can differ by points on identical predictions, so detection_report returns the conventions it used beside the score.
- Boxes are continuous
(xmin, ymin, xmax, ymax). Pascal VOC stores pixel indices and adds 1 per side, which raises a 10-pixel box’s IoU by 21%; that belongs in the annotation reader, not here - Matching is greedy by descending score, one truth each, so a duplicate box is a false positive - which is what makes non-maximum suppression worth doing
- Predictions are pooled across images before AP, never averaged per image. The curve is one ranking over the dataset; a mean of per-image APs is dominated by images with one object. Same reason the segmentation metrics sum TP, FP and FN before applying their formula - a ratio of sums is not the mean of ratios
- A class with no ground truth scores
None, not zero, and is left out of the mean;classes_without_truthsays which. Three interpolations are offered -all(VOC 2010+),101(COCO) and11(VOC 2007) - because papers quote all three difficultobjects are excluded when annotations carry the flag, as VOC’s own evaluation excludes them
[0.3.0a11]
2026-10-03
Added
fit()refuses to train on masks the colormap does not describe. A colormap matching none of the labelled tissue is the quietest failure in segmentation: every mask reads as background, the loss falls because background is most of a medical image, the metrics look plausible, and the model learns to answer “nothing here”. Nothing in a training log says so- The refusal is on class presence, not on the unmatched fraction, and that choice is the substance of this change. The unmatched fraction scales with the size of the thing being segmented, so on a small lesion - the ordinary medical case - the most dangerous mistake makes the quietest signal. Measured on synthetic masks with a colormap asking for VOC red where the masks are white: a foreground covering 20% of the image gives 19.8% unmatched, 5% gives 4.96%, and 0.6% gives 0.61% - indistinguishable from the 0.72% that JPEG compression leaves around the edge of a correct mask. A declared class that appears in no mask does not scale: the same measurement gave per-class pixel counts of [15984, 400] for the correct colormap and [16384, 0] for the wrong one, at any lesion size
n_classhigher than the data has classes is caught by the same check and is invisible to the fraction entirely - every voxel matches an entry, so the unmatched figure is exactly zero while one output channel can never be trainedSegmentationDataset.inspect_masks()returns aMaskReport: the unmatched fraction, which classes appear, which are missing, and how much of the dataset was read.colormap_coverage()is unchanged and now delegates to it- A high unmatched fraction with every class present is a warning rather than a refusal, because some of it is legitimate. The threshold is 5%, which sits in the measured gap between compression artefacts (under 1%) and a wholesale mistake (19.8% and 100%)
Engine(..., check_masks=False)skips it, and the refusal names that along with the call that looks at more of the data than the check does. Both were run as written before being printed
Changed
- The sample the check reads is spread across the dataset and ordered so that any prefix still spans it - first, last, middle, then midpoints. Real datasets arrive sorted, by patient or acquisition date or class, so a prefix is a biased sample and “this class is absent” drawn from one can mean only “the positives are later in the list”. Tested on a dataset whose only labelled tissue is in the last 3% of a sorted listing, which a prefix would have refused
- The scan stops once every class has turned up and at least five masks have been read, so effort goes where there is doubt. On Data Science Bowl, where each sample carries one mask file per nucleus, a fifty-sample scan cost 3.8 seconds; it now answers in 0.13
[0.3.0a10]
2026-10-02
Added
- Pretrained encoders.
encoder: resnet34builds a timm backbone as the contracting path andpretrained: trueis a separate flag that loads its ImageNet weights - separate on purpose, so naming a backbone never reaches the network on a machine that has none.timmis the optionalencodersextra freeze_encoder: 5holds the transferred layers still for that many epochs, andencoder_learning_rategives them a rate of their own. Both act on the layers that actually arrived pretrained and not on the full-resolution stage added in front of them, which starts random and is the one part that must keep learning. Parameter groups are split by object identity, so no rename can misfile one- Freezing sets
eval()as well asrequires_grad, and does it aftermodel.train(): a frozen BatchNorm otherwise rewrites its running statistics from every batch it sees, which changes the very thing the freeze was protecting examples/compare_pretrained_encoders.pyand the measurement it produced, in the README: three datasets, one per modality, three seeds each. The mechanisms work and the transfer does not. Usefreeze_encoderrather thanencoder_learning_ratealone - on Kvasir a tenth of the rate is the worst configuration in the table. Expect convergence in half the epochs rather than a better score. A bigger encoder earns its place where the target is thin, pretrained or not: on SIIM-ACR every ResNet variant roughly doubles the built-in encoder, whose seed spread there is larger than its own mean
Changed
verify_encoderchecks a supplied encoder by measurement rather than by its declaration: one tiny probe at build time confirms the level count, thatchannelsmatches what comes back, that level 0 is at input resolution, and that every level halves. The seam had an unstated contract - an encoder whose stem strides by 2, which is every ImageNet backbone, was accepted in silence and produced masks at half the size of the ones scoring them, surfacing much later as a bare tensor size error from inside the loss- Levels are chosen from a backbone by downsampling factor rather than position, so
vgg16’s full-resolution level is used directly and the patch-based backbones (convnext_*,swin_*), whose features start at 1/4, are refused by name with the reason instead of having a 1/2 level invented for them - CI installs the
encodersextra. An optional extra CI does not install is a feature shipped untested behind a green run, because its tests skip rather than fail
Refused
pretrainedwithoutencoder, which would otherwise read as transfer learning and do nothingencoderat rank 3, caught while the specification is read so a 3D run fails before anything is downloaded. ImageNet is images; there is nothing to transfer to a volumeblocksdeeper than the backbone has stages, and backbone names timm does not know
[0.3.0a9]
2026-09-27
Added
examples/compare_dsbowl_architectures.py: all four architectures in one specification, on one split, reported with the size and the cost beside the score. Dice alone cannot decide which weights are worth publishing - a model scoring 0.001 higher for twice the epoch time is a different trade, not a better choice- The comparison itself, in the README and the model card, because the result is the useful part: the spread across the four architectures is 0.0030 while the spread across images within one of them is 0.054. Re-running the same U-Net with another seed moves the mean by 0.0012, 40% of the whole between-architecture spread. On this problem the architecture is not where the result comes from, and that is worth an hour of somebody’s compute to learn rather than a fortnight of swapping decoders
- It is also why
dsbowl-unetremains the only published entry: four names meaning the same thing would be four permanent promises nobody needed
[0.3.0a8]
2026-09-27
Added
- The first published weights:
dsbowl-unet, a U-Net at 256x256 that separates cell nuclei from background in light microscopy. Trained on BBBC038v1 - the 2018 Data Science Bowl images, CC0, taken from the Broad Bioimage Benchmark Collection rather than the Kaggle mirror. Dice 0.9205 mean over 134 held-out images, sd 0.053, median 0.9314, worst case 0.7240; the five worst images are named in the sidecar - It is semantic, not instance: touching nuclei come back as one region, so the numbers are not comparable to the challenge’s own leaderboard, which scored instances. The registry description and the model card both say so, because someone counting nuclei with these weights would otherwise get a wrong answer with no warning
- Pinned to commit
5e035c6aofmaju116/platypus-weights. Verified end to end against the real Hub: the name resolves, the file lands in the Hugging Face cache, the sidecar travels with it, and the reloaded weights score 0.9201 on the same validation split. A second call takes two milliseconds and no network
[0.3.0a7]
2026-09-27
Added
- Published weights by name. Three forms, in the order they will be used:
dsbowl-unetfrom the registry,hf://owner/repo/file.safetensors@commitfor anything else on the Hub, and a local path. A registry name carries the commit it was published at, and thehf://form requires one - weights that change under a stable name are the worst kind of irreproducibility, since the code is identical and the result is not - A sidecar beside every published file, recording the architecture, input shape, channels, classes, blocks and filters the weights were trained with, plus provenance. Loading refuses a model they do not belong to before touching torch: a shape mismatch torch would catch anyway, but weights trained on a different colormap with the same class count load cleanly and predict nonsense
Engine.export_weights()writes safetensors plus that sidecar, and takes arbitrary extra fields - the dataset, its licence, the citation, the measured validation distribution. Weights whose provenance is only in somebody’s memory cannot be used by anybody elsesafetensorsis a hard dependency;huggingface_hubis the optionalhubextra, since most runs never fetch weights and an air-gapped one cannot. Asking for a name without it gives a message saying which command fixes itexamples/publish_dsbowl_weights.pytrains the first published weights from BBBC038v1 at the Broad Institute, not the Kaggle mirror. The images are identical; the Kaggle copy is governed by competition rules accepted at download, while BBBC038v1 carries an explicit CC0 waiver, and weights are a derivative of the data behind them
Notes
- Downloads land in the Hugging Face cache (
~/.cache/huggingface/hub, orHF_HOME), which sits outside any virtual environment - so weights survive reticulate rebuilding its uv environment, and a pinned commit needs no network call once cached. Air-gapped sites now have two caches to warm: that one and~/.cache/uv
[0.3.0a6]
2026-09-27
Added
predict(space="source"): each prediction mapped back onto the grid of the file it was computed from, undoing the resampling and the crop. Until now a prediction came back on the model’s grid only, which meant a mask that could be scored but not laid over the patient’s scan -save_volumes()refused to write it, correctly, since a mask with the wrong geometry lands in the wrong place- It returns a list, not an array, and that is the honest type: sources differ in size, a stack needs one shape, and resizing them to match would produce a mask describing anatomy it was not computed from.
space="model"keeps the stacked array and remains the default - The inverse is built from the forward path rather than guessed: crop or pad to the shape resampling produced, then resize to the source’s own shape, which lands on the source shape by construction rather than by rounding. Works with or without
target_spacing, and at both ranks spatial_shape(),volume_shape()andseries_shape()read a source’s size from headers alone - for volumes the canonical shape, matching the array the reader returns rather than the file’s own axis order
[0.3.0a5]
2026-09-26
Added
- Augmentation in 3D. Volumes go to albumentations through
volumeandmask3drather thanimageandmask, and one set of parameters applies to the whole volume - a per-slice augmentation would tear the anatomy apart, and there is a test that every slice gets the same geometry - Support is uneven and that is handled rather than hidden. Of the transforms in albumentations 2.0.8, 97 can take a volume -
Affine,ElasticTransform,D4,CubicSymmetry, the flips, the blurs, the 3D-native crops - while others raise from inside the library,GaussNoiseandChannelDropoutasKeyError: 'images', which is not a sentence anyone can act on. Each transform in a 3D spec is tried against a small probe volume while the pipeline is built, and an unsupported one is named then rather than forty minutes into training - Probed per step rather than as a pipeline, so the message names the offending transform instead of leaving a user to bisect eight of them
available_transforms(rank=3)lists what can be used on volumes. Transforms that need arguments cannot be probed with defaults and are kept rather than dropped -CenterCrop3Dis one of them, and it is written for volumes. “Could not check” is not “does not work”
Fixed
- The probe forces
p=1. Without it the check asked its question only half the time, because most transforms default top=0.5: an unsupported transform passed roughly every other run and crashed mid-epoch instead. The first version of the tests was flaky for the same reason from the other side, and was caught by running them eight times rather than once
[0.3.0a4]
2026-09-26
Added
channels_from: one pattern per channel, in channel order, for datasets that keep one channel per file. BraTS ships four MRI sequences per patient - T1, T1 after contrast, T2, FLAIR - because different tumour structures are visible in different sequences; the 38-Cloud satellite set keeps its bands the same way. Works at both ranks- The order is stated, never inferred. Sorted, BraTS gives flair, t1, t1ce, t2: perfectly reproducible and anatomically meaningless. A model trained with FLAIR in channel one and then used on data whose channel one is T1 returns a plausible answer, with the right shape and the right range, and nothing downstream can detect it
- Refusals, each naming the sample: a pattern matching no file, a pattern matching two (
_t1matches_t1.nii.gzand_t1ce.nii.gzalike), two channels resolving to one file, and a file matched by no pattern - which left alone would be data the model never sees, and on a dataset where an extra sequence appears for some patients only, a difference between cases - Volume channels are compared before anything is resized, and a mismatch is an error. Resizing each channel to the model’s shape separately would hide it: the channels would arrive the same size with their anatomy in different places. Spacing is checked too when resampling. In 2D the bands of one scene may legitimately differ in resolution - Sentinel ships 10 m and 20 m bands of one tile - so there no geometry is asserted
channels_fromis cross-checked against every model’schannels, so a mismatch is a specification error rather than a shape failure deep inside torch
[0.3.0a3]
2026-09-26
Added
target_spacingon the data section: resample every volume to a common voxel size, then centre-crop or pad to the model’sinput_shape. Without it a volume is resized into the box, and that is only harmless when two scans cover the same extent. Clinical scans do not: 40 slices of 1 mm is 40 mm of patient and 40 slices of 2.5 mm is 100 mm, so resizing makes the same organ a different size in each and nothing in the data says so. Resampling fixes the millimetres per voxel - the quantity anatomy is measured in - and cropping or padding afterwards is what turns the varying shape into the one shape a network needs without stretching away what the resampling establishedresample_to_spacing()andcrop_or_pad(), centred, usable on their own- Measured on a 10 mm sphere: 4189 mm3 in theory, 4224 at 1 mm slices. The same sphere at 2.5 mm slices reads 1688 voxels against the fine scan’s 4224 - a 60% difference in what is physically one object - and 3760 after resampling, an 11% difference. The rest is honest: at 2.5 mm the caps were never measured, and resampling recovers no information an acquisition did not take
Fixed
- Masks went down a different reading path from images. With
target_spacingthe image was resampled and cropped while a single-file mask was merely resized, so every label sat beside the anatomy it was labelling - a misalignment that trains quietly and shows up as a model that cannot learn. Both now go through one function, and a test asserts the mask covers the tissue rather than merely having the right shape
[0.3.0a2]
2026-09-26
Added
- Reading a DICOM series: a folder of slices becomes one volume, which is how data leaves a hospital. Four decisions, each of which produces a volume that trains without complaint when taken wrongly:
- order comes from
ImagePositionPatientprojected onto the slice normal. Not the filename, which sorts slice 10 before slice 2, and notInstanceNumbereither, which need only be unique within a series and is not required to follow the anatomy - it is the documented fallback when there is no geometry at all, andSeries.sorted_bysays which was used - one series at a time. A folder out of an archive usually holds several - a scout, a reconstruction, a phase - and
SeriesInstanceUIDseparates them. Stacking two interleaves two anatomies at two resolutions - one window for the whole series. Slices of one series can record different windows; honoured slice by slice they produce a brightness gradient the scanner never measured
- canonical orientation, through the same path a NIfTI takes, so one CT read from DICOM and the same CT converted to NIfTI arrive identically oriented
- order comes from
describe_series()checks a series without reading a pixel, because checking a hundred cases should not cost a hundred gigabytes- Slice spacing is measured from the positions, never from
SliceThickness- thickness is how thick a slice is, not how far apart they sit, and for an overlapping reconstruction using it puts every slice past the first in the wrong place - A gap in the positions is an error. A volume stacked over a gap does not lose a slice, it puts everything past the gap somewhere else, and no metric would show it. With too few slices for the median gap to mean anything the message says it cannot tell which gap is wrong instead of naming one by arithmetic accident
- Series reading is wired into the pipeline two ways: a 3D model with several DICOM files in one sample, and a path to a series directory in a CSV
Changed
- Several volumes per sample - one per modality, as BraTS ships - is refused with a message saying so, rather than the first one being read and three quarters of the data ignored
[0.3.0a1]
2026-09-26
Volumes. The spec, the model builder, the losses, the metrics and the tiling were already rank-generic - input_shape = [64, 64, 32] has validated and built a 3D U-Net since 0.2.0a1 - so what was missing was reading volumes, naming classes the way volumes do, and two refusals that existed to stop a half-working 3D run.
Added
- NIfTI reading (
read_volume,volume_spacing), dispatched fromread_imageso everything reads “whatever is at this path, the way training would”. Two corrections happen before anything looks at the array:- canonical orientation. A NIfTI stores an affine, not an array in a known order, and the same anatomy can arrive in any of 48 permutations and flips. Read two datasets naively and one has the patient’s left on the right; train on both and the model can learn which dataset a scan came from. Every volume is reoriented to closest-canonical RAS, and there is a test that two files describing the same anatomy through different affines come back byte-identical
- a fixed intensity window, the same named windows the DICOM reader uses, so ‘lung’ means one thing across the package.
autofalls back to the range present for NIfTI, which stores no window - stated rather than silent, since that is the one case where a bright outlier still rescales everything else
labelsin the data section: masks as label maps rather than pictures, which is how every volume format stores them. Exactly one ofcolormapandlabels- not both even when they agree, since two sources for the number of classes means one going stale, and not neither, since guessing it from the data would let a validation set with no tumour quietly train a model with one class fewer- 3D patch sampling, which is
splitsat rank 3 and the same code as the 2D grid resize_volume(), through torch rather than scipy: one library fewer to conflict with
Changed
- The data pipeline and the engine no longer refuse a 3D spec. Trained end to end on synthetic 64x64x32 CT volumes on a GTX 1070: 0.5s an epoch, per-case Dice, and predictions returned as whole volumes
dicom_windowis nowwindow, since NIfTI needs the same thing and the old name had become a lie.dicom_windowis still accepted - a released R package sends it - and giving both is an error rather than a coin toss- A class-count mismatch names whichever of
colormaporlabelsis in use, instead of always blaming the colormap nibabelis a hard dependency. A medical imaging package that cannot open a.nii.gzis not one
Not done, on purpose
- Resampling to isotropic spacing. Spacing is read and carried, because losing it would make resampling impossible later; applying it changes the voxel grid the model sees, which is a decision to take explicitly rather than inside a reader
- Augmentation in 3D. albumentations ships 3D transforms through a different call signature; a 3D spec asking for augmentation is refused, not silently ignored
- DICOM series to volume. Reading one DICOM slice works; assembling a directory of them into a volume needs sorting by geometry and a consistency check, and is its own piece of work
[0.2.0a3]
2026-09-26
Added
split_dataset()- split one directory into train/validation/test CSVs, keeping every group whole.group_byis a regular expression read against the sample key, and a group is whatever must not straddle the split: usually a patient, sometimes a study, a scanner or a site. Slices of one patient on both sides of a split is the most common way to report a segmentation score that means nothing, and it leaves no trace in the output. Deterministic given the same samples, fractions, pattern and seed, in any order; groups are handed to whichever split is furthest below its target share in samples, so patients of wildly different sizes do not skew the fractionsevaluate_cases()- one row per case rather than one number per split, optionally grouped by patient, andsummarise_cases()for the distribution: mean, sd, median, range, and the name of the worst case. A model averaging Dice 0.855 on the Data Science Bowl scored 0.006 on three images; nothing in the mean could say so- A
keycolumn in aconfig_fileCSV now names the sample, instead of it being called ‘row 55’. Written by the splitter, so a bad score can be traced back to an image
Changed
- Each metric is now one formula, written on overlap statistics and reused for tensors - which is what lets a tiled case be scored as a whole. Tiles are summed, not averaged: a ratio of sums is not the mean of ratios, and averaging punishes a case whose object happens to straddle a tile boundary
- Finding samples no longer needs a full specification (
discover_samples), since splitting a dataset has no model, no colormap and no loss to invent
[0.2.0a2]
2026-09-26
Added
- DICOM reading, done the way the modality requires rather than the way the file allows: stored values passed through the modality LUT so they are real units (Hounsfield units for CT), a fixed window rather than one derived from the image itself, and MONOCHROME1 inverted. A window taken per image lets one bright pixel - an implant, a marker, an artefact - rescale everything else, and makes two scans incomparable
dicom_windowon the data section: a named window such aslungorsoft_tissue, an explicit(centre, width)pair,autoto use the window recorded in the file, orfullfor the whole range present- Format detected from content, not from the file extension: DICOM files often carry none
[0.2.0a1]
2026-09-25
The 2022 TensorFlow package replaced by a PyTorch one. Not a port - a rewrite, sharing the earlier version’s shape (a specification, many models from one file) and almost none of its code. Everything below is 2D semantic segmentation; the spec and the model builder already handle volumes, the data pipeline is where 3D stops.
Added
- A specification with two constructors and one result: built from arguments or loaded from YAML, producing the same validated object, so nothing downstream can tell which was used. pydantic v2,
extra="forbid", exportable as JSON Schema - Four architectures from one builder: U-Net, U-Net++, Res-U-Net, LinkNet, each composable with separable convolutions, spatial dropout, learned or interpolated upsampling, deep supervision and configurable block width
- Nine losses (IoU, Dice, CCE, CCE-Dice, Focal, Tversky, Focal-Tversky, Combo, Lovász) and three metrics, reducing over every axis except batch and channel - so they work unchanged on volumes
- The engine: trains every model in a specification, then evaluates and predicts, reporting a comparison table that names the objective beside the loss column
- Data pipeline with two layouts,
nested_dirsandconfig_file, and albumentations declared per model - Tiling that goes both ways: a large image cut into a grid instead of shrunk, and a full-size mask reassembled from the pieces
- Packaging and CI: published to PyPI through trusted publishing, tested on Ubuntu, macOS and Windows across Python 3.10-3.13
- A
pascalextra pinning the last CUDA 12 torch, because CUDA 13 dropped the Maxwell, Pascal and Volta generations and no driver update brings them back
Removed
- TensorFlow and Keras, and with them the
.hdf5weights format - Stacked ensembling and the YOLOv3 branch work: out of scope for v0.1, not abandoned
[0.1.0rc2]
2022-10-07
The TensorFlow package. Still installable as pyplatypus==0.1.0rc2, and unrelated to everything above in implementation.
Added
- Platypus engine - allows to train and evaluate multiple CV models with YAML config
- Generalized multiclass semantic segmentation models: U-Net, U-Net++, Res-U-Net, LinkNet
- Semantic segmentation loss functions and metrics: Focal loss, CCE, Dice loss/coefficient, Tversky loss/coefficient, IOU loss/coefficient, Focal-Tversky loss, Combo loss, Lovasz loss
- Semantic segmentation augmentations