diff --git a/CHANGELOG.md b/CHANGELOG.md index 52a374dd..8aacf7ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to this project will be documented here. ## [unreleased] +## [0.25.1] - Aug 5th, 2026 +- The `ConfidenceSlider` toolbox item now also filters `bitmask` annotations + ## [0.25.0] - Aug 5th, 2026 - Add a `bitmask` annotation mode for raster (per-pixel) segmentation, selectable via `allowed_modes: ["bitmask", ...]`. - Painted with the brush (toggle with `toggle_brush_mode_keybind`, default `g`); erase with `toggle_erase_mode_keybind` (default `e`); resize the brush with `increase_brush_size_keybind` / `decrease_brush_size_keybind` (defaults `]` / `[`) or `alt+scroll`. The brush/erase toggles now apply to both `polygon` and `bitmask` modes. diff --git a/api_spec.md b/api_spec.md index 53ee150a..9efdab16 100644 --- a/api_spec.md +++ b/api_spec.md @@ -484,7 +484,7 @@ This toolbox item requires no configuration and can be added to the `toolbox_ord ### `confidence_slider_toolbox_item` -The `ConfidenceSlider` toolbox item (added to `toolbox_order` via `AllowedToolboxItem.ConfidenceSlider`) deprecates (hides) or shows spatial annotations based on their confidence values. Unlike the deprecated `KeypointSlider`, it works with **all** spatial annotation types that have a confidence payload (`bbox`, `bbox3`, `polygon`, `polyline`, `contour`, `tbar`, and `point`), across every subtask. +The `ConfidenceSlider` toolbox item (added to `toolbox_order` via `AllowedToolboxItem.ConfidenceSlider`) deprecates (hides) or shows spatial annotations based on their confidence values. Unlike the deprecated `KeypointSlider`, it works with **all** spatial annotation types that have a confidence payload (`bbox`, `bbox3`, `polygon`, `polyline`, `contour`, `tbar`, `point`, and `bitmask`), across every subtask. It supports two modes: diff --git a/package-lock.json b/package-lock.json index 5e9f7648..09f3c256 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ulabel", - "version": "0.25.0", + "version": "0.25.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ulabel", - "version": "0.25.0", + "version": "0.25.1", "license": "MIT", "devDependencies": { "@eslint/config-inspector": "^1.3.0", diff --git a/package.json b/package.json index 0fa6406c..f16f467e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ulabel", "description": "An image annotation tool.", - "version": "0.25.0", + "version": "0.25.1", "main": "dist/ulabel.min.js", "module": "dist/ulabel.min.js", "types": "dist/index.d.ts", diff --git a/src/version.js b/src/version.js index 1a902fc9..1e78b199 100644 --- a/src/version.js +++ b/src/version.js @@ -1 +1 @@ -export const ULABEL_VERSION = "0.25.0"; +export const ULABEL_VERSION = "0.25.1"; diff --git a/tests/annotation_operators.test.js b/tests/annotation_operators.test.js index f56d2c74..4a6a5cf5 100644 --- a/tests/annotation_operators.test.js +++ b/tests/annotation_operators.test.js @@ -44,7 +44,7 @@ describe("get_annotation_confidence_for_class", () => { describe("CONFIDENCE_FILTERABLE_SPATIAL_TYPES", () => { test("includes the spatial modes and excludes the non-spatial modes", () => { expect(CONFIDENCE_FILTERABLE_SPATIAL_TYPES).toEqual( - expect.arrayContaining(["contour", "polygon", "polyline", "bbox", "tbar", "bbox3", "point"]), + expect.arrayContaining(["contour", "polygon", "polyline", "bbox", "tbar", "bbox3", "point", "bitmask"]), ); expect(CONFIDENCE_FILTERABLE_SPATIAL_TYPES).not.toContain("whole-image"); expect(CONFIDENCE_FILTERABLE_SPATIAL_TYPES).not.toContain("global"); diff --git a/tests/confidence_slider.test.js b/tests/confidence_slider.test.js index cfc177ae..43df09fd 100644 --- a/tests/confidence_slider.test.js +++ b/tests/confidence_slider.test.js @@ -135,6 +135,22 @@ describe("ConfidenceSlider", () => { expect(low.deprecated).toBe(false); }); + test("filters bitmask annotations by confidence like any other spatial type", () => { + const high_mask = make_annotation("high_mask", "bitmask", [{ class_id: 10, confidence: 0.9 }]); + const low_mask = make_annotation("low_mask", "bitmask", [{ class_id: 10, confidence: 0.1 }]); + const cs = new ConfidenceSlider(make_ulabel([high_mask, low_mask], { + class_filter_mode: "all-only", + default_values: { all: 60 }, + filter_on_load: false, + })); + + cs.filter_annotations(false); + + expect(high_mask.deprecated).toBe(false); + expect(low_mask.deprecated).toBe(true); + expect(low_mask.deprecated_by.confidence_slider).toBe(true); + }); + test("lowering the threshold un-deprecates previously filtered annotations", () => { const low = make_annotation("low", "bbox", [{ class_id: 10, confidence: 0.1 }]); const cs = new ConfidenceSlider(make_ulabel([low], {