Repository navigation
v1.4.0
Added
primitives.greedy_match, COCO's greedy matcher on a(D, G)similarity
array, pycocotools-exact: itsdt_matches,gt_matches, anddt_ignoreequal
COCOeval'sevalImgsat every threshold and area range.group_of=applies
the Open Images rule;iscrowdin its place undercounts with no error. See
greedy_match.primitives.segment_overlapsandmatch_segments: panopticapi's
(gt_id, pred_id)pixel counts for two label maps, and PQ's matching of one
image'ssegments_infolists. PQ, SQ, and RQ written from them equal
PanopticEval's on every panopticapi parity case. The three matchers are
provisional until the tracking family exercises them.PanopticEval.eval_imgskeeps each image's match records —image_idand
match_segments' four lists — whereevaluate()kept only per-category counts.
Rust:PanopticEval::eval_imgs(). Seeeval_imgs.- Build your own metric,
a guide that writes F1 at one IoU, a cross-class confusion matrix, and PQ in
Python fromprimitivesandmetrics. A test runs every block on the page and
holds each number to the evaluator that owns it. metrics.mean_or_missing(total, count): the mean, or-1.0whencountis
0 — the one producer of the sentinelmetrics.is_computedreads, so a composed
metric never spells-1.0itself.- Warning categories. Every warning hotcoco emits is one of four
HotcocoWarningsubclasses —ReferenceDeviationWarning,CallOrderWarning,
ConversionWarning, andDatasetWarning— exported from the top level, so a
filter names a kind instead of matching text.HotcocoWarningsubclasses
UserWarning. See Filtering the warnings. COCOeval.ious, pycocotools'{(image_id, category_id): (D, G) array or []}
afterevaluate(), which torchmetrics'extended_summary=Truereads. Rust:
COCOeval::iou_matrices(), the publicIouMatrix, andPOOLED_CAT, the pooled
cell's key underuse_cats = false.
Seeious.load_reswarns on corner-pair boxes: aDatasetWarningwhen most bbox
detections run past their image read as[x, y, w, h]but fit it read as
[x1, y1, x2, y2]. The numbers came out plausible and wrong before. See
Bbox format.- Dice and boundary IoU in the semantic family.
mDiceand per-classDice
are mmsegmentation's, inSemanticEval,metrics.mean_iou, and
PanopticEval.report().mBIoUand per-classBIoUfollow Cheng et al.'s
paper per class, not detectron2's label-map version;boundary_dilation=None
or--no-boundary-iouturns them off. See Boundary IoU. SemanticEval.update_folderspairs nested layouts, such as Cityscapes'
folder per city, throughrecursive,gt_suffix, andpred_suffix— the
CLIs'--recursive,--gt-suffix, and--pred-suffix; the defaults are the
old behavior. Rust:update_folderstakes asemantic::FolderPairing. See
Evaluate saved predictions.- Rust:
panoptic::match_image, the per-image stepPanopticEvalruns,
panoptic::labels_from_ids,ImageMatches::from_indices,
Overlaps::from_counts,primitives::greedy::match_group_of,
params::default_iou_thrs,metrics::counts::score_order, and
metrics::semantic::boundary, the boundary IoU kernel, are public.
Changed
Rust-visible breaks ship in minor releases while the crate has no outside
dependents; each one is named below.
COCO.datasetis the dataset, not a copy: the same dict on every access,
the one assigned if there was one. An edit is read back before the next call
andcreateIndex()reads it back at once, so torchmetrics' bbox+segmarea
switch reaches hotcoco. Rust:COCO::reindexed,ann_position. See
Migrating.evaluate()refuses a detection with a NaN score, theValueError
load_res()raises, so a results set built from a dict — torchmetrics' path —
is checked too. Rust:COCO::check_scores, run byCOCOeval::check_inputs.- A call made before its step emits a
CallOrderWarning:
CocoEvaluator.accumulate()andsummarize()with nothing to evaluate, which
printed to stdout, andPanopticEval.summary_lines()beforeevaluate()and
SemanticEval.summarize()andsummary_lines()before anything is counted,
which were silent. - The Rust library no longer prints loader warnings to stderr.
COCO::warn
records them forload_warnings(); Python emits them asDatasetWarning, and
hotcoco-cliprints them after a load, so a terminal shows the same lines. primitives.bbox_iouandmask_ioutakeiscrowd=Nonefor no crowd
region, as doesmask.bbox_iou, the same object;mask.iou, pycocotools'
spelling, still requires the flags. Pass them whenever a ground truth might be
a crowd region: a crowd box scored as plain IoU is a different number.semantic.METRIC_NAMESappendsmDiceandmBIoU, sostatskeeps its
first four positions. Rust:SemanticEval::updateandupdate_mapstake the
map's height and width, which the boundary band needs, andClassScoresand
SemanticScoresgain the Dice and boundary IoU fields.- An
int32label map is read in place, asuint8,uint16,uint64, and
int64maps are, bySemanticEval.update,metrics.pixel_confusion, and
primitives.segment_overlaps; it is what panopticapi'srgb2idreturns. Rust:
LabelMapgainsI32, so amatchon it without a wildcard arm breaks. - Rust:
ImageMatchesis{ image_id, matches: MatchIds }, the four id lists
moved intoMatchIds. JSON output is unchanged;matchesis flattened. primitives::panoptic::match_segmentstreats a label listed twice as one
segment, its last entry at its first one's position, as panopticapi's dict
does; it also listed the overwritten entry as a miss or false positive.
PanopticEval's numbers do not change.- A panoptic dict passed to
PanopticEvalis read field by field, not
throughjson.dumps: a numpy scalar id is accepted, a bad record is a
ValueErrornaming it, and"isthing": Nonereads as noisthing, in a
COCOdict too, which refused it. - A tuple of records in a dataset dict reads as a list, as pycocotools
iterates it, inCOCOandPanopticEval;COCOraisedValueErrorbefore. - The panoptic
isthingwarning starts withhotcoco:, as every other
warning does, so a filter anchored at its old first words needs the prefix.
No other warning text changed. - Panoptic errors say "label map" rather than "PNG" or "mask", since
match_segmentsraises them too, and the error for a matched pair with no
union names both segments and both causes. - Tests: the synthetic panoptic cases moved to
scripts/helpers.py, shared with
tests/test_composed_metrics.py, with new hand cases checked against
panopticapi;tests/test_array_spellings.pycovers the new primitives; and
tests/test_stubs.pychecks each stubbed callable's parameters, not only its
name.
Fixed
- Open Images under a custom area range credited group-of boxes the range
ignores: the best detection inside one was a true positive against a count
that left the box out. It is now ignored. The default single range was
unaffected. - A bool inside a number field of a dict record is a
ValueError, astrue
is in a JSON file:bbox,area,score,keypoints,obb, polygon points,
and a panoptic segment'sbboxreadTrueas1.0before. A list of numbers
must be a sequence, not a set, a dict, or a generator. getAnnIds(areaRng=...)andget_ann_ids(area_rng=...)exclude the range's
end points, as pycocotools'getAnnIdsdoes;filter()and evaluation's
area ranges still include them, as pycocotools' evaluation does.getAnnIds()andget_ann_ids()return ids in pycocotools' order —
dataset order, image by image inimgIdsorder — where they sorted them.- Type stubs:
primitives.bbox_iouandmask_iouaccept 0/1iscrowd
flags, andCOCO(path, image_dir)takesimage_dirby position, as the
runtime always has; pyright rejected both.