Skip to content

v1.4.0

Choose a tag to compare

@github-actions github-actions released this 05 Nov 00:51
· 22 commits to main since this release

Added

  • primitives.greedy_match, COCO's greedy matcher on a (D, G) similarity
    array, pycocotools-exact: its dt_matches, gt_matches, and dt_ignore equal
    COCOeval's evalImgs at every threshold and area range. group_of= applies
    the Open Images rule; iscrowd in its place undercounts with no error. See
    greedy_match.
  • primitives.segment_overlaps and match_segments: panopticapi's
    (gt_id, pred_id) pixel counts for two label maps, and PQ's matching of one
    image's segments_info lists. 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_imgs keeps each image's match records — image_id and
    match_segments' four lists — where evaluate() kept only per-category counts.
    Rust: PanopticEval::eval_imgs(). See eval_imgs.
  • Build your own metric,
    a guide that writes F1 at one IoU, a cross-class confusion matrix, and PQ in
    Python from primitives and metrics. 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.0 when count is
    0 — the one producer of the sentinel metrics.is_computed reads, so a composed
    metric never spells -1.0 itself.
  • Warning categories. Every warning hotcoco emits is one of four
    HotcocoWarning subclasses — ReferenceDeviationWarning, CallOrderWarning,
    ConversionWarning, and DatasetWarning — exported from the top level, so a
    filter names a kind instead of matching text. HotcocoWarning subclasses
    UserWarning. See Filtering the warnings.
  • COCOeval.ious, pycocotools' {(image_id, category_id): (D, G) array or []}
    after evaluate(), which torchmetrics' extended_summary=True reads. Rust:
    COCOeval::iou_matrices(), the public IouMatrix, and POOLED_CAT, the pooled
    cell's key under use_cats = false.
    See ious.
  • load_res warns on corner-pair boxes: a DatasetWarning when 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. mDice and per-class Dice
    are mmsegmentation's, in SemanticEval, metrics.mean_iou, and
    PanopticEval.report(). mBIoU and per-class BIoU follow Cheng et al.'s
    paper per class, not detectron2's label-map version; boundary_dilation=None
    or --no-boundary-iou turns them off. See Boundary IoU.
  • SemanticEval.update_folders pairs nested layouts, such as Cityscapes'
    folder per city, through recursive, gt_suffix, and pred_suffix — the
    CLIs' --recursive, --gt-suffix, and --pred-suffix; the defaults are the
    old behavior. Rust: update_folders takes a semantic::FolderPairing. See
    Evaluate saved predictions.
  • Rust: panoptic::match_image, the per-image step PanopticEval runs,
    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.dataset is 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
    and createIndex() reads it back at once, so torchmetrics' bbox+segm area
    switch reaches hotcoco. Rust: COCO::reindexed, ann_position. See
    Migrating.
  • evaluate() refuses a detection with a NaN score, the ValueError
    load_res() raises, so a results set built from a dict — torchmetrics' path —
    is checked too. Rust: COCO::check_scores, run by COCOeval::check_inputs.
  • A call made before its step emits a CallOrderWarning:
    CocoEvaluator.accumulate() and summarize() with nothing to evaluate, which
    printed to stdout, and PanopticEval.summary_lines() before evaluate() and
    SemanticEval.summarize() and summary_lines() before anything is counted,
    which were silent.
  • The Rust library no longer prints loader warnings to stderr. COCO::warn
    records them for load_warnings(); Python emits them as DatasetWarning, and
    hotcoco-cli prints them after a load, so a terminal shows the same lines.
  • primitives.bbox_iou and mask_iou take iscrowd=None for no crowd
    region, as does mask.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_NAMES appends mDice and mBIoU, so stats keeps its
    first four positions. Rust: SemanticEval::update and update_maps take the
    map's height and width, which the boundary band needs, and ClassScores and
    SemanticScores gain the Dice and boundary IoU fields.
  • An int32 label map is read in place, as uint8, uint16, uint64, and
    int64 maps are, by SemanticEval.update, metrics.pixel_confusion, and
    primitives.segment_overlaps; it is what panopticapi's rgb2id returns. Rust:
    LabelMap gains I32, so a match on it without a wildcard arm breaks.
  • Rust: ImageMatches is { image_id, matches: MatchIds }, the four id lists
    moved into MatchIds. JSON output is unchanged; matches is flattened.
  • primitives::panoptic::match_segments treats 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 PanopticEval is read field by field, not
    through json.dumps: a numpy scalar id is accepted, a bad record is a
    ValueError naming it, and "isthing": None reads as no isthing, in a
    COCO dict too, which refused it.
  • A tuple of records in a dataset dict reads as a list, as pycocotools
    iterates it, in COCO and PanopticEval; COCO raised ValueError before.
  • The panoptic isthing warning starts with hotcoco: , 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_segments raises 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.py covers the new primitives; and
    tests/test_stubs.py checks 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, as true
    is in a JSON file: bbox, area, score, keypoints, obb, polygon points,
    and a panoptic segment's bbox read True as 1.0 before. A list of numbers
    must be a sequence, not a set, a dict, or a generator.
  • getAnnIds(areaRng=...) and get_ann_ids(area_rng=...) exclude the range's
    end points
    , as pycocotools' getAnnIds does; filter() and evaluation's
    area ranges still include them, as pycocotools' evaluation does.
  • getAnnIds() and get_ann_ids() return ids in pycocotools' order —
    dataset order, image by image in imgIds order — where they sorted them.
  • Type stubs: primitives.bbox_iou and mask_iou accept 0/1 iscrowd
    flags, and COCO(path, image_dir) takes image_dir by position, as the
    runtime always has; pyright rejected both.