Recent Releases of Zamba
Zamba - v2.7.2
- Fix single-GPU image training wrongly running under DDP when
devices="auto". - Compile only the image backbone, not the whole module, so
torch.compileno longer breaks training under DDP. - Reconcile
_orig_mod.checkpoint keys so compiled-model checkpoints load on any setup.
Biosphere - Terrestrial Wildlife
- Python
Published by pjbull 27 days ago
Zamba - v2.7.1
- Fix video and image training on PyTorch 2.7+ by dropping deprecated scheduler kwargs like
verbose. - Fix image training LR finder crash by deferring
torch.compileuntil after tuning. - Set
torch-backend = "auto"in[tool.uv]for clone-based uv installs. - Document uv install tips:
--torch-backend=autoand protobuf/setuptools overrides forzamba[video,image].
Biosphere - Terrestrial Wildlife
- Python
Published by pjbull 28 days ago
Zamba - v2.7.0
- Add the
speciesnetimage classification model, azamba-compatible conversion of Google's SpeciesNet classifier (EfficientNetV2-M backbone, 2,000+ class global taxonomy). Select it withzamba image predict --model speciesnetorzamba image train --model speciesnet. See the Available Models page. - Persist the preprocessing
model_familyon image classifier checkpoints and derive inference transforms (resize size, interpolation, normalization) from the loaded checkpoint rather than from themodel_namestring. This fixes incorrect preprocessing (and near-random predictions) when runningzamba image predict --checkpoint <ckpt>on a fine-tuned SpeciesNet model without also passing--model. - Split core dependencies into optional extras:
video(av, ffmpeg-python, pytorchvideo, pixeltable-yolox, etc.),image(megadetector, Pillow),tests(pytest, black, flake8, coverage, nvidia-ml-py, etc.), anddocs(mkdocs, mike, mkdocstrings). Base install no longer pulls in video/image stacks; usepip install zamba[video],zamba[image], orzamba[video,image]. - Remove
requirements-dev.txtandrequirements-dev/; useuv pip install -e ".[image,video]" --group devfor development orpip install -e ".[tests,image,video,docs]"with pip. - Replace
mlflowwithmlflow-skinnyin core dependencies. Addpyarrow>=23.0.0. Add Windows-specific torch version constraint for gloo bug. Declare Python 3.11–3.13 support andrequires-python = ">=3.11, <3.14". - Remove DensePose from optional dependencies so the package is publishable to PyPI. DensePose (detectron2, detectron2-densepose) must be installed from GitHub; see docs. Running
zamba denseposewithout them prints install instructions and exits. Add[tool.uv.extra-build-dependencies]for detectron2 (torch) so CI can build it from GitHub. - Pin
setuptools<82so the image extra works on Python 3.12 (megadetector’s yolov5 stack requirespkg_resources, which setuptools 82 removed). Add[tool.uv]override-dependencies for protobuf and setuptools. - Add
zamba.models.config_commonwith shared types and validators (ModelEnum, MonitorEnum, ZambaBaseModel, RegionEnum, get_filepaths, validate_model_cache_dir, etc.). Move video-specific file/checkpoint logic intozamba.models.configand reuse common helpers. - Add
zamba.models.instantiationand moveinstantiate_model, head-replacement, and resume logic out ofmodel_managerfor clearer separation. - Add lazy model registration in
zamba.models.registry(ensure_registered()): video model classes are imported only when needed so the package can be imported without video dependencies. Config validation callsensure_registered()when resolving checkpoint/model name. - Register image and utils sub-apps lazily so
zamba --helpand non-image/non-utils commands work without image or densepose dependencies. Defer imports of VideoLoaderConfig and config classes into the train, predict, and depth command callbacks. - Handle missing DensePose dependencies in the
denseposecommand: catch ImportError when running the model and print install-from-GitHub instructions and exit with code 1. - Make NPY cache path hashing stable: use a JSON-serializable, order-invariant representation of the config (including Enum and Path) instead of
str(hashed_part). For local absolute paths, use a relative-style path in the cache key. - Fix cache cleanup in
npy_cache.__del__by comparingPath(cache_path).parents[0]withPath(tempfile.gettempdir()). - Import image classifier lazily from
zamba.imagesto avoid pulling in torch at package import time. Images config and manager usezamba.models.config_commonandzamba.models.instantiationinstead of config/utils from video. - Make megadetector import resilient: try
megadetector.detection.run_detector, fall back todetection.run_detector. Make MLflow optional in image training (log warning and continue without it if import or setup fails). Disabletorch.compileon Windows in addition to macOS. - Add pytest markers
videoandimageand skip test files when the corresponding extra is not installed (conftestcollect_ignorebased on_HAS_VIDEO/_HAS_IMAGE). Define video-only fixtures and the dummy video model only when video deps are present. SetCUDA_VISIBLE_DEVICES=0in conftest to avoid DDP issues under pytest-xdist. - Add Makefile targets
test-fast(fail on first failure) andtest-image-only/test-video-only(isolated venvs with only image or video extra). CI runs these isolation steps and installs image,video extras for the main test matrix. DensePose tests install detectron2 from GitHub with--no-build-isolationinstead of using a densepose extra. - Update tests to use new config/instantiation imports and markers; add image dataset import check in the install smoke test.
- Installation docs: document optional extras (video, image), PyPI install (
pip install zamba[video]etc.), and Windows (image extra no extra tools; video needs Visual Studio Build Tools and FFmpeg). State FFmpeg only required for video workflows and recommend FFmpeg 4.x. Contribute page: dev install with--group dev, DensePose deps from GitHub,make requirementswith uv. DensePose doc: install detectron2/detectron2-densepose from GitHub; note thatzamba denseposeprints instructions if deps missing. - Re-enable PyPI publish steps in the release workflow (Test PyPI and Production PyPI). Docs workflows and release job install
.[docs]instead ofrequirements-dev/docs.txt. - Add
deterministicoption (defaultFalse) to video and image prediction configs. Inference always seeds RNGs (INFERENCE_SEED, default55); setdeterministic=Truefor strict CUDA/cuDNN reproducibility at some GPU throughput cost. - Fix non-deterministic frame ordering in MegadetectorLite
score_sortedfill mode when frame scores tie; equal scores now break by lowest frame index.
Biosphere - Terrestrial Wildlife
- Python
Published by pjbull 28 days ago
Zamba - v2.5.0
Note: This version removes support for python 3.8 and 3.9.
What's Changed
- Fix ffmpeg install on macos by @ejm714 in https://github.com/drivendataorg/zamba/pull/329
- Fix ModelManager import in docs by @klwetstone in https://github.com/drivendataorg/zamba/pull/325
- Add code of conduct by @pjbull in https://github.com/drivendataorg/zamba/pull/330
- Pin numpy < 2 by @pjbull in https://github.com/drivendataorg/zamba/pull/335
- Replace maximize-build-space action by @jayqi in https://github.com/drivendataorg/zamba/pull/336
- Upgrade the required python version to python>=3.11 by @westford14 in https://github.com/drivendataorg/zamba/pull/337
New Contributors
- @westford14 made their first contribution in https://github.com/drivendataorg/zamba/pull/337
Full Changelog: https://github.com/drivendataorg/zamba/compare/v2.4.1...v2.5.0
Biosphere - Terrestrial Wildlife
- Python
Published by ejm714 almost 2 years ago
Zamba - v2.3.0
Model release
- Adds a depth estimation module for predicting the distance between animals and the camera (PR #247). This model comes from one of the winning solutions in the Deep Chimpact: Depth Estimation for Wildlife Conservation machine learning challenge hosted by DrivenData.
Biosphere - Terrestrial Wildlife
- Python
Published by ejm714 over 3 years ago
Zamba - v2.2.1
- Turn off showing local variables in Typer's exception and error handling (PR #237)
- Fixes bug where the column order was incorrect for training models when the provided labels are a subset of the model's default labels (PR #236)
Biosphere - Terrestrial Wildlife
- Python
Published by ejm714 almost 4 years ago
Zamba - v2.2.0
Model releases and new features
- The default
time_distributedmodel (African species classification) has been retrained on over 250,000 videos. This 16x increase in training data significantly improves accuracy. This new version replaces the previous one. (PR #226, PR #232) - A new default model option is added:
blank_nonblank. This model only does blank detection. This binary model can be trained and finetuned in the same way as the species classification models. This model was trained on both African and European data, totaling over 263,000 training videos. (PR #228) - Detect if a user is training in a binary model and preprocess the labels accordingly (PR #215)
Bug fixes and improvements
- Add a validator to ensure that using a model’s default labels is only possible when the species in the provided labels file are a subset of those (PR #229)
- Refactor the logic in
instantiate_modelfor clarity (PR #229) - Use pqdm to check for missing files in parallel (PR #224)
- Set
model_namebased on the provided checkpoint so that user-trained models use the appropriate video loader config (PR #221) - Leave
data_diras a relative path (PR #219) - Ensure hparams yaml files get included in the source distribution (PR #210)
- Hold back setuptools so mkdocstrings works (PR #207)
- Factor out
get_cached_array_path(PR #202)
Biosphere - Terrestrial Wildlife
- Python
Published by ejm714 almost 4 years ago
Zamba - v2.1.0
- Retrains the time distributed species classification model using the updated MegadetectorLite frame selection (PR #199)
- Replaces the MegadetectorLite frame selection model with an improved model trained on significantly more data (PR #195)
Biosphere - Terrestrial Wildlife
- Python
Published by ejm714 about 4 years ago
Zamba - v2.0.4
- Pins
thopto an earlier version (PR #191) - Fixes caching so a previously downloaded checkpoint file actually gets used (PR #190, PR #194)
- Removes a lightning deprecation warning for DDP (PR #187)
- Ignores extra columns in the user-provided labels or filepaths csv (PR #186)
Biosphere - Terrestrial Wildlife
- Python
Published by ejm714 about 4 years ago
Zamba - v2.0.1
Releasing to pick up #167 and #169.
- PR #169 fixes error in splitting data into train/test/val when only a few videos.
- PR #167 refactors yolox into an object_detection module
Other documentation fixes also included.
Biosphere - Terrestrial Wildlife
- Python
Published by pjbull over 4 years ago
Zamba - v2.0.0
Releases new version v2 of the zamba package including:
- New and improved models
- Additional species and habitats
- Model finetuning and training
Previous model: Machine learning competition
The algorithms used by zamba v1 were based on the winning solution from the Pri-matrix Factorization machine learning competition, hosted by DrivenData. Data for the competition was provided by the Chimp&See project and manually labeled by volunteers. The competition had over 300 participants and over 450 submissions throughout the three month challenge. The v1 algorithm was adapted from the winning competition submission, with some aspects changed during development to improve performance.
The core algorithm in zamba v1 was a stacked ensemble which consisted of a first layer of models that were then combined into a final prediction in a second layer. The first level of the stack consisted of 5 keras deep learning models, whose individual predictions were combined in the second level of the stack to form the final prediction.
In v2, the stacked ensemble algorithm from v1 is replaced with three more powerful single-model options: time_distributed, slowfast, and european. The new models utilize state-of-the-art image and video classification architectures, and are able to outperform the much more computationally intensive stacked ensemble model.
New geographies and species
zamba v2 incorporates data from western Europe (Germany). The new data is packaged in the pretrained european model, which can predict 11 common European species not present in zamba v1.
zamba v2 also incorporates new training data from 15 countries in central and west Africa, and adds 12 additional species to the pretrained African models.
Retraining flexibility
Model training is made available zamba v2, so users can finetune a pretrained model using their own data to improve performance for a specific ecology or set of sites. zamba v2 also allows users to retrain a model on completely new species labels.
Biosphere - Terrestrial Wildlife
- Python
Published by pjbull over 4 years ago