Skip to content

v1.2.0

Choose a tag to compare

@Josef-Haupt Josef-Haupt released this 16 Oct 09:07
· 41 commits to main since this release
c0c0a16

A custom classifier release. Custom classifiers trained on the BirdNET 3.0 base now load and run, load_custom can read the base version from the file, and recent 2.4 exports load again. Scores from a 2.4 Raven classifier change in this release.

Features

  • Custom classifiers on the BirdNET 3.0 base. birdnet.load_custom("acoustic", "3.0", "tf", ..) loads a 3.0 TFLite export for predict(..) and encode(..), and load_custom(.., "3.0", "pb", .., is_raven=True) loads the 3.0 Raven SavedModel. by @Josef-Haupt in #111
  • version="auto" for custom TFLite classifiers. load_custom("acoustic", "auto", "tf", ..) reads the base version from the file. The new birdnet.inspect_custom_tflite(model) describes a classifier file the same way, without importing TensorFlow into your process. by @Josef-Haupt in #111

Changes

  • Scores from a 2.4 Raven classifier change. The sigmoid was applied twice, which compressed every score into 0.5 to 0.73; predict(..) now returns the export's scores, so revisit thresholds tuned against the old values. by @Josef-Haupt in #111
  • The acoustic 3.0 tf and pb backends reject batch_size above 1 with a ValueError; their exports take one segment at a time, and a larger batch used to crash the worker or return a single row. onnx and pt take any batch size. by @Josef-Haupt in #111
  • A Raven export's labels/label_names.csv loads as a species list, without the id column in every name. by @Josef-Haupt in #111
  • classifier_type is accepted but no longer selects anything; the layout is read from the file. by @Josef-Haupt in #111

Bugfixes

  • Custom 2.4 classifiers exported with Keras 3 (TensorFlow 2.16 or newer) load again, instead of failing with "Failed to detect custom classifier type" or reading the wrong tensor. by @Josef-Haupt in #111
  • encode(..) on an append-mode custom 2.4 classifier returned wrong embeddings. by @Josef-Haupt in #111
  • A model that hangs while opening no longer holds load_custom past its timeout. A Linux script that calls load_custom or inspect_custom_tflite without a __main__ guard now needs one, as predict(..) already does. by @Josef-Haupt in #111
  • On Windows, the lock around the one-time V3.0 label setup could be left behind, and every process waiting for it then timed out. by @Josef-Haupt in #111
  • pip install birdnet[tf] on Intel macOS could resolve to packages that do not import together. The tf extra now pins TensorFlow 2.16 and pyarrow below 26 there. by @Josef-Haupt in #111

Known limitation

The acoustic 3.0 pb and onnx exports, and the custom 3.0 Raven export, return NaN scores for a segment with no variance such as digital silence. This is in the exports, not in birdnet.

Under the hood

  • The test suite builds custom classifier exports from the official models and runs the custom classifier paths against them. by @Josef-Haupt in #111

Full Changelog: v1.1.1...v1.2.0