From 2ad16cf9e28ba683e791213da6b9459b7cd0deed Mon Sep 17 00:00:00 2001 From: BP <11394934+benjipeng@users.noreply.github.com> Date: Fri, 7 Aug 2026 11:58:09 -0400 Subject: [PATCH] Bump to 0.0.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit First release since 0.0.3, and not a documentation-only one. It adds the EoMT-DINOv3 panoptic family, `Result.draw()` visualization in viz.py, and changes to the DA3, RF-DETR, and SAM 3.1 paths. It also removes `mlx_cv.parity` from the wheel. That tooling now lives in tools/, where it belongs: it exists to compare against upstream reference checkouts, which are not something a runtime dependency should carry. Any caller importing `mlx_cv.parity` breaks on upgrade. Two version literals stop being literals: - `tests/test_version.py` asserted `__version__ == "0.0.3"`, which only ever proved that someone had edited that file. It now compares `__version__` against the installed distribution metadata, so it catches the real failure — a release that bumps pyproject.toml and forgets __init__.py, or the reverse. - `convert_locateanything_checkpoint.py` defaulted `--converter-version` to a hard-coded `mlx-cv-0.0.3`. That string is stamped into checkpoint provenance metadata, so every conversion run after a release quietly mislabelled itself. It reads `__version__` now. The Hugging Face model cards move their pinned install to 0.0.4. Those cards only reach the Hub through `tools/huggingface_release.py upload`, which is manual and needs the weights present, so the published cards stay on 0.0.3 until someone runs it. The 0.0.3 strings left under .agent/work/ are historical release records and stay as written. Verified in a clean venv: distribution metadata and `__version__` both report 0.0.4 and agree, test_version.py passes, and the converter stamps `mlx-cv-0.0.4`. --- pyproject.toml | 2 +- .../appautomaton/locateanything-3b-bf16-mlx.md | 2 +- .../appautomaton/sam3.1-multiplex-bf16-mlx.md | 2 +- src/mlx_cv/__init__.py | 2 +- tests/test_version.py | 11 +++++++++-- tools/convert_locateanything_checkpoint.py | 5 ++++- 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 0752748..5d821c7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "mlx-cv" -version = "0.0.3" +version = "0.0.4" description = "MLX-native computer vision for Apple Silicon: open-vocabulary grounding, object detection, depth and camera geometry, segmentation, and video object tracking." readme = "README.md" requires-python = ">=3.13" diff --git a/scripts/hugging_face/model_cards/appautomaton/locateanything-3b-bf16-mlx.md b/scripts/hugging_face/model_cards/appautomaton/locateanything-3b-bf16-mlx.md index f5f12fe..140ed41 100644 --- a/scripts/hugging_face/model_cards/appautomaton/locateanything-3b-bf16-mlx.md +++ b/scripts/hugging_face/model_cards/appautomaton/locateanything-3b-bf16-mlx.md @@ -19,7 +19,7 @@ tags: Final-layout BF16 weights for running [NVIDIA LocateAnything-3B](https://huggingface.co/nvidia/LocateAnything-3B) with [`mlx-cv`](https://github.com/appautomaton/mlx-cv) on Apple Silicon. BF16 is reduced precision, not integer quantization. ```bash -pip install "mlx-cv[mlx,hub]==0.0.3" +pip install "mlx-cv[mlx,hub]==0.0.4" ``` ```python diff --git a/scripts/hugging_face/model_cards/appautomaton/sam3.1-multiplex-bf16-mlx.md b/scripts/hugging_face/model_cards/appautomaton/sam3.1-multiplex-bf16-mlx.md index eddd7f4..0c5963b 100644 --- a/scripts/hugging_face/model_cards/appautomaton/sam3.1-multiplex-bf16-mlx.md +++ b/scripts/hugging_face/model_cards/appautomaton/sam3.1-multiplex-bf16-mlx.md @@ -19,7 +19,7 @@ tags: Final-layout BF16 detector and Object Multiplex tracker weights for running Meta SAM 3.1 with [`mlx-cv`](https://github.com/appautomaton/mlx-cv) on Apple Silicon. BF16 is reduced precision, not integer quantization. ```bash -pip install "mlx-cv[mlx,hub]==0.0.3" +pip install "mlx-cv[mlx,hub]==0.0.4" ``` ```python diff --git a/src/mlx_cv/__init__.py b/src/mlx_cv/__init__.py index 3fe38c2..def9c11 100644 --- a/src/mlx_cv/__init__.py +++ b/src/mlx_cv/__init__.py @@ -65,7 +65,7 @@ register_model_loader, ) -__version__ = "0.0.3" +__version__ = "0.0.4" __all__ = [ "__version__", diff --git a/tests/test_version.py b/tests/test_version.py index 27acd9c..3c1a647 100644 --- a/tests/test_version.py +++ b/tests/test_version.py @@ -1,8 +1,15 @@ +from importlib.metadata import version + import mlx_cv -def test_version(): - assert mlx_cv.__version__ == "0.0.3" +def test_version_matches_distribution_metadata(): + # The version is written twice: in pyproject.toml, which becomes the + # installed distribution metadata, and in __init__.py, which is what + # callers read. Asserting a hard-coded literal here only proved that + # someone had edited this file; comparing the two catches the release + # that bumps one and forgets the other. + assert mlx_cv.__version__ == version("mlx-cv") def test_public_surface(): diff --git a/tools/convert_locateanything_checkpoint.py b/tools/convert_locateanything_checkpoint.py index 14f777a..438ee5a 100644 --- a/tools/convert_locateanything_checkpoint.py +++ b/tools/convert_locateanything_checkpoint.py @@ -10,6 +10,7 @@ ROOT = Path(__file__).resolve().parents[1] sys.path.insert(0, str(ROOT / "src")) +from mlx_cv import __version__ as MLX_CV_VERSION from mlx_cv.hub import read_safetensors_header, rewrite_safetensors_metadata, sha256_file from mlx_cv.models.locateanything import LOCATEANYTHING_CHECKPOINT_METADATA @@ -19,7 +20,9 @@ def main() -> None: parser.add_argument("input", type=Path, help="Existing final-layout BF16 Safetensors") parser.add_argument("output", type=Path, help="Strict output Safetensors") parser.add_argument("--source", type=Path, required=True, help="Source checkpoint for provenance") - parser.add_argument("--converter-version", default="mlx-cv-0.0.3") + # Derived, not written out: this stamps provenance into the checkpoint, so a + # literal here silently mislabels every conversion run after a release bump. + parser.add_argument("--converter-version", default=f"mlx-cv-{MLX_CV_VERSION}") args = parser.parse_args() header = read_safetensors_header(args.input)