Mosaic -- mosaic-behavior
Copyright (C) 2025-2026 Max-Planck-Gesellschaft zur Foerderung der
Wissenschaften e.V., for the Max Planck Institute of Animal Behavior

Mosaic is free software licensed under the GNU Affero General Public
License, version 3 or (at your option) any later version. The complete
license text is in LICENSE.

This file records the third-party attributions that travel with mosaic and
the obligations attached to them. AGPL v3 section 5 requires such notices to
be preserved in modified and redistributed versions. Keep this file with the
code.


HOW COMPONENTS REACH A USER
===========================

Everything under src/, scripts/, tests/, docs/ and notebooks/ is the work of
the mosaic authors unless a module docstring says otherwise. Mosaic ships no
trained model weights.

  incorporated   Third-party source inside src/, adapted or verbatim. It
                 ships in the wheel.

  invoked        A separate program mosaic starts and talks to over a pipe,
                 a socket or the filesystem. Mosaic does not link, import or
                 ship it; the user installs it.

  read           A file format mosaic reads or writes without importing,
                 shipping or starting the program that produces it.

  optional       A distribution named in an optional extra. Installing
                 mosaic-behavior does not install it.

  fetched        Model weights downloaded from a hub at first use. Nothing
                 is fetched at install time and nothing is redistributed
                 here.

  implemented    A method mosaic carries out in its own code from a
                 published description. No upstream code is used.

Three components carry restrictions the AGPL does not. keypoint-MoSeq
prohibits commercial use. TRex requires a paid license for company use. The
MegaDescriptor identity weights, which a user may name but mosaic never
selects, are CC-BY-NC-4.0: they prohibit commercial use and require
attribution. All three are stated in full below.


INCORPORATED SOURCE
===================

The complete list of third-party work inside src/. Each module also names
its origin in its own docstring.

BeesInADish
  Developed with:  Valerie Kuklovsky, University of Konstanz
  Terms:           unpublished; used with the author's permission
  In:              src/mosaic/behavior/feature_library/pair_facing.py
                   src/mosaic/behavior/feature_library/attention_target.py
  Taken:           Dish.compute_social_facing and its angle-wrapping
                   helper. attention_target generalizes the in_pair /
                   out_pair attention metric to any id-to-group mapping.

train-custom-YOLO-Colab
  Developed with:  Angela Albi, Max Planck Institute of Animal Behavior
  Origin:          https://github.com/albiangela/train-custom-YOLO-Colab
  Terms:           no license document upstream; used with the author's
                   permission. Name the license here when one is added.
  In:              src/mosaic/tracking/pose_training/prep.py
  Taken:           dataset filtering, label simplification,
                   train/val/test splitting and data.yaml generation from
                   utils/prep.py. Mosaic adds pose (kpt_shape) and POLO
                   (radii) handling, drops the tiling and Colab interface
                   code, and has diverged further since.

trajognize
  Origin:          https://github.com/vasarhelyi/trajognize
  Copyright:       (c) Gabor Vasarhelyi and contributors
  License:         GPL-3.0
  In:              src/mosaic/behavior/feature_library/approach_avoidance.py
  Taken:           the approach-avoidance decision logic: role-specific
                   speed thresholds for approacher and avoider, the
                   distance threshold, the cosine thresholds between
                   velocity and pair direction, the approacher
                   forward-motion gate against body orientation, and the
                   event-continuity rule.
  Citation:        Nagy, M., Vasarhelyi, G., Pettit, B., Roberts-Mariani,
                   I., Vicsek, T., Biro, D. (2013). Context-dependent
                   hierarchies in pigeons. PNAS 110:13049-13054.
                   https://doi.org/10.1073/pnas.1305552110

                   Nagy, M., Davidson, J. D., Vasarhelyi, G., Abel, D.,
                   Kubinyi, E., El Hady, A., Vicsek, T. (2024). Long-term
                   tracking of social structure in groups of rats.
                   Scientific Reports 14:22857.
                   https://doi.org/10.1038/s41598-024-72437-5

bb_pipeline_models (BeesBook)
  Origin:          https://github.com/BioroboticsLab/bb_pipeline_models
  Copyright:       the BioroboticsLab contributors (the upstream LICENSE
                   names no holder)
  License:         Apache-2.0
  In:              src/mosaic/tracking/pose_training/localizer_model.py
  Taken:           get_conv_model, a fully convolutional heatmap encoder.
  Changes:         ported from TensorFlow/Keras to PyTorch. The layer
                   structure and its strides, padding and output geometry
                   are preserved; the framework and the surrounding code
                   are mosaic's own. Stated as Apache-2.0 section 4(b)
                   requires.
  Citation:        Wild, B., Sixt, L., Landgraf, T. (2018). Automatic
                   localization and decoding of honeybee markers using deep
                   convolutional neural networks. arXiv:1802.04557.
                   https://doi.org/10.48550/arXiv.1802.04557

Lightning Pose configuration template
  Origin:          https://github.com/paninski-lab/lightning-pose
  Copyright:       (c) 2021 Dan Biderman, Matthew Whiteway, Liam Paninski
  License:         MIT
  In:              src/mosaic/tracking/litpose/templates/config_default.yaml
  Taken:           scripts/configs/config_default.yaml from release 2.3.1,
                   verbatim. Used when a caller names no config.


INVOKED PROGRAMS
================

TRex
  Origin:      https://trex.run/ -- https://github.com/mooch443/trex
  Copyright:   (C) Tristan Walter and contributors
  License:     AGPL-3.0-or-later. The Application/src/commons subtree is
               GPL-3.0.
  Driven by:   src/mosaic/tracking/trex/
  Obligation:

      Company use of TRex requires a paid commercial license from the TRex
      project. Free use is available under AGPL v3 or later. Enquiries:
      a@trex.run

               A user who runs TRex obtains it from the TRex project and
               is bound by its license, the commercial-use clause
               included. Nothing in mosaic's license substitutes for that.
  Citation:    Walter, T. and Couzin, I. D. (2021). TRex, a fast
               multi-animal tracking system with markerless
               identification, and 2D estimation of posture and visual
               fields. eLife 10:e64000.
               https://doi.org/10.7554/eLife.64000

  src/mosaic/core/track_library/ also reads TRex track exports. Reading a
  file format creates no license obligation.

keypoint-MoSeq
  Origin:      https://github.com/dattalab/keypoint-moseq
  Licensor:    President and Fellows of Harvard College, through the
               Harvard University Office of Technology Development
  License:     non-commercial research and academic use only
  Driven by:   the kpms feature, which starts the interpreter of an
               environment the user builds at
               src/mosaic/behavior/feature_library/external/ and exchanges
               newline-delimited JSON with it over its standard input and
               output. Mosaic does not import the package, and its extras,
               dependency groups and uv.lock do not name it.
  Obligation:

      "End User shall not use the Software for Commercial use and any such
      use of the Software is expressly prohibited."

               Harvard defines commercial use to include fee-for-service
               arrangements, use by core facilities or laboratories
               providing research services to or with for-profit third
               parties for a fee, and industry-sponsored or collaborative
               research projects granting the sponsor or collaborator
               commercial rights. This is not a copyleft license, so no
               paid exception cures it; a commercial license requires a
               separate agreement with Harvard (otd@harvard.edu). The
               license also asks that Harvard be acknowledged as the
               provider, that the relevant publications be cited, and that
               its notices be retained.

               The kpms feature will not start until the user sets
               MOSAIC_KPMS_LICENSE_ACCEPTED=1. The arhmm feature fits a
               comparable model in mosaic's own code, under no such
               restriction. It follows the autoregressive hidden Markov
               model of MoSeq (Wiltschko et al. 2015, below) and uses no
               MoSeq or keypoint-MoSeq code.
  Acknowledgement:
               keypoint-MoSeq is provided by the President and Fellows of
               Harvard College, through the Harvard University Office of
               Technology Development, as the license asks.
  Citation:    Weinreb, C., Pearl, J. E., Lin, S., Osman, M. A. M.,
               Zhang, L., Annapragada, S., Conlin, E., Hoffmann, R.,
               Makowska, S., Gillis, W. F., Jay, M., Ye, S., Mathis, A.,
               Mathis, M. W., Pereira, T., Linderman, S. W., Datta, S. R.
               (2024). Keypoint-MoSeq: parsing behavior by linking point
               tracking to pose dynamics. Nature Methods 21:1329-1339.
               https://doi.org/10.1038/s41592-024-02318-2

               Wiltschko, A. B., Johnson, M. J., Iurilli, G., Peterson,
               R. E., Katon, J. M., Pashkovski, S. L., Abraira, V. E.,
               Adams, R. P., Datta, S. R. (2015). Mapping sub-second
               structure in mouse behavior. Neuron 88:1121-1135.
               https://doi.org/10.1016/j.neuron.2015.11.031

VAME
  Origin:      https://github.com/EthoML/VAME, the maintained fork of
               the original LINCellularNeuroscience/VAME
  Authors:     Kevin Luxem and Pavol Bauer, original developers; now
               maintained by EthoML
  License:     GPL-3.0. The project ships the GPL v3 text and states
               "License: GPLv3", with no "or later" grant.
  Driven by:   the vame feature, which starts the interpreter of an
               environment the user builds at
               src/mosaic/behavior/feature_library/external/vame-env/ and
               exchanges newline-delimited JSON with it over its standard
               input and output. Mosaic does not import the package, and
               its extras, dependency groups and uv.lock do not name it.
  Obligation:  none on running it. The GPL does not restrict use.
               Mosaic's runner, licensed AGPL-3.0-or-later like the rest
               of mosaic, runs in VAME's process, a combination that
               section 13 of both licenses permits. Whoever conveys a
               built environment conveys VAME under GPL-3.0, with its
               source.
  Citation:    Luxem, K., Mocellin, P., Fuhrmann, F., Kuersch, J.,
               Miller, S. R., Palop, J. J., Remy, S., Bauer, P. (2022).
               Identifying behavioral structure from deep variational
               embeddings of animal motion. Communications Biology
               5:1267. https://doi.org/10.1038/s42003-022-04080-7

Ultralytics YOLO
  Origin:      https://github.com/ultralytics/ultralytics
  Copyright:   (C) Ultralytics
  License:     AGPL-3.0-or-later, or a paid Ultralytics Enterprise
               License. Two dependencies carry the same terms and are
               named in no pyproject.toml, arriving only through
               Ultralytics itself: ultralytics-thop, in both environments,
               and ultralytics-platform, in the upstream one.

POLO
  Origin:      https://github.com/mooch443/POLO
  License:     AGPL-3.0. The Ultralytics Enterprise License is offered by
               Ultralytics for its own distribution and does not extend to
               either fork.
  Authors:     three parties hold work in the build mosaic pins.
               Ultralytics YOLO is the base. The point-detection model,
               its training losses and its post-processing are POLO, by
               Giacomo May, Emanuele Dalsasso, Benjamin Kellenberger and
               Devis Tuia at EPFL, released at
               https://github.com/gigumay/POLO. The fork mosaic pins is
               maintained by Tristan Walter at the Max Planck Institute of
               Animal Behavior, who carries current upstream Ultralytics
               into it and has made his own changes to point training and
               validation.
  Citation:    May, G., Dalsasso, E., Kellenberger, B., Tuia, D. (2024).
               POLO -- Point-based, multi-class animal detection.
               CV4Ecology workshop, ECCV 2024. arXiv:2410.11741.
               https://arxiv.org/abs/2410.11741

  No mosaic install carries Ultralytics or POLO. `mosaic track ultralytics`
  and `mosaic run --kind` with infer-pose, infer-points, train-pose or
  train-points drive them as separate programs in environments the user
  builds: src/mosaic/tracking/external/ultralytics-env/ for the tracker,
  pose inference and pose training, and .../polo-env/ for point inference
  and point training. They are two environments because POLO ships under
  the distribution name `ultralytics` and cannot occupy one with upstream.
  The program that runs inside both is
  src/mosaic/tracking/external/runner/. What crosses between mosaic and it
  is a JSON request file, a JSON response file, progress lines on standard
  output, and -- for a cancelled training run -- a file mosaic writes that
  the program stats between epochs. Mosaic locates each environment through
  MOSAIC_ULTRALYTICS_CONDA_ENV / MOSAIC_ULTRALYTICS_BIN and
  MOSAIC_POLO_CONDA_ENV / MOSAIC_POLO_BIN.

  mosaic-media, Apache-2.0, is installed into both environments; the runner
  reads video through it. mosaic-behavior is declared in neither and is not
  importable from either.

  lap, the linear-assignment solver Ultralytics' tracker matching imports at
  module scope, is declared by both environments and by no mosaic extra --
  it appears in no Ultralytics extra either, so an undeclared one would be
  pip-installed mid-run. https://github.com/gatagat/lap, (c) 2012-2017 Tomas
  Kazmar and contributors, BSD-2-Clause. It reaches a user only by way of an
  environment they build, which is why it is recorded here rather than under
  OPTIONAL DISTRIBUTIONS.

  Obligation. AGPL v3 section 13 extends the duty to offer Corresponding
  Source to anyone who interacts with the program remotely over a network,
  so operating a pipeline that includes Ultralytics as a service reaches a
  commercial user without any copy being redistributed. That obligation
  attaches to the environment the user built and to their deployment of it.
  Mosaic installs nothing that carries it.

SLEAP
  Origin:      https://sleap.ai/
  License:     BSD-3-Clause-Clear
  Driven by:   src/mosaic/tracking/sleap/, in an environment the user
               builds. Mosaic's converter reads the analysis .h5 SLEAP
               writes, which creates no obligation.
  Citation:    Pereira, T. D., Tabris, N., Matsliah, A., Turner, D. M.,
               Li, J., Ravindranath, S., et al. (2022). SLEAP: A deep
               learning system for multi-animal pose tracking. Nature
               Methods 19:486-495.
               https://doi.org/10.1038/s41592-022-01426-1

Lightning Pose
  Origin:      https://github.com/paninski-lab/lightning-pose
  License:     MIT
  Driven by:   src/mosaic/tracking/litpose/, in an environment the user
               builds. One configuration file is also redistributed; see
               INCORPORATED SOURCE.
  Citation:    Biderman, D., Whiteway, M. R., Hurwitz, C., et al. (2024).
               Lightning Pose: improved animal pose estimation via
               semi-supervised learning, Bayesian ensembling and
               cloud-native open-source tools. Nature Methods 21:1316-1328.
               https://doi.org/10.1038/s41592-024-02319-1

FFmpeg
  Origin:      https://ffmpeg.org/
  License:     LGPL-2.1-or-later, or GPL if built with GPL-only components
  Driven by:   the system ffprobe binary for media indexing and probing,
               and the system ffmpeg binary for transcoding. These two
               programs are not distributed with mosaic; the user installs
               them. When the joined export re-encodes H.264 or HEVC clips,
               it asks the system ffmpeg for libx264 or libx265, which are
               GPL-only encoders from the user's own build.
  Loaded:      FFmpeg libraries also arrive in a default install, inside
               two third-party wheels, and are loaded in-process when they
               are imported: av (PyAV, through mosaic-media[io]) and
               opencv-python. PyAV's wheels bundle the x264 and x265
               encoder libraries on every platform, and those are
               GPL-2.0-or-later. opencv-python's wheel for macOS on Apple
               silicon bundles an FFmpeg configured as GPL-3.0-or-later.
               Neither wheel ships those license texts. mosaic does not
               redistribute either wheel, and its own in-process encoding,
               through mosaic-media, uses the AV1 encoder libsvtav1 (or
               av1_nvenc on NVIDIA hardware), never x264 or x265.
  Optional:    the movement extra installs imageio-ffmpeg, whose ffmpeg
               executables are GPL builds. The feral extra installs decord
               on Linux, whose FFmpeg is configured with non-free
               components and reports itself as "nonfree and
               unredistributable".
  Obligation:  a redistributor who bundles any of these builds must
               observe that build's terms, which depend on how it was
               configured. mosaic-media's Dockerfile builds an LGPL-only
               FFmpeg, with PyAV compiled against it, for that case.


ULTRALYTICS TRACKER DEFAULTS
============================

`mosaic track ultralytics` selects one of six tracker backends Ultralytics
ships. Their default settings are transcribed -- the setting names and
their values, in mosaic's own structure -- into
src/mosaic/tracking/ultralytics_track/tracker_defaults.py from
ultralytics/cfg/trackers/{botsort,bytetrack,ocsort,deepocsort,fasttrack,
tracktrack}.yaml as of Ultralytics 8.4.63. The YAML files themselves are
not copied and no AGPL-licensed source is vendored into src/.

The backends implement published methods. Results produced with one should
cite it:

  ByteTrack. Zhang, Y. et al. (2021). ByteTrack: Multi-Object Tracking by
  Associating Every Detection Box. arXiv:2110.06864.

  BoT-SORT. Aharon, N., Orfaig, R., Bobrovsky, B.-Z. (2022). BoT-SORT:
  Robust Associations Multi-Pedestrian Tracking. arXiv:2206.14651.

  OC-SORT. Cao, J. et al. (2022). Observation-Centric SORT: Rethinking
  SORT for Robust Multi-Object Tracking. arXiv:2203.14360.

  Deep OC-SORT. Maggiolino, G. et al. (2023). Deep OC-SORT:
  Multi-Pedestrian Tracking by Adaptive Re-Identification.
  arXiv:2302.11813.

  FastTracker. Hashempoor, H., Hwang, Y. D. (2025). FastTracker:
  Real-Time and Accurate Visual Tracking. arXiv:2508.14370.

  TrackTrack. Shim et al. (2025). Focusing on Tracks for Online
  Multi-Object Tracking. CVPR 2025.


FILE FORMATS MOSAIC READS
=========================

Mosaic imports, ships and starts none of these programs. It reads, and in
one case writes, files in a format the program defines. Reading or writing a
file format creates no license obligation. The citations are the ones each
project asks for from people who use it.

DeepLabCut
  Origin:      https://github.com/DeepLabCut/DeepLabCut
  License:     LGPL-3.0-or-later
  Read by:     src/mosaic/core/track_library/deeplabcut.py reads DeepLabCut
               HDF5 and CSV track exports.
               src/mosaic/tracking/litpose/labels.py writes the
               CollectedData.csv layout.
  Citation:    Mathis, A., Mamidanna, P., Cury, K. M., Abe, T., Murthy,
               V. N., Mathis, M. W., Bethge, M. (2018). DeepLabCut:
               markerless pose estimation of user-defined body parts with
               deep learning. Nature Neuroscience 21:1281-1289.
               https://doi.org/10.1038/s41593-018-0209-y

               Lauer, J., Zhou, M., Ye, S., Menegas, W., Schneider, S.,
               Nath, T., Rahman, M. M., Di Santo, V., Soberanes, D., Feng,
               G., Murthy, V. N., Lauder, G., Dulac, C., Mathis, M. W.,
               Mathis, A. (2022). Multi-animal pose estimation,
               identification and tracking with DeepLabCut. Nature Methods
               19:496-504. https://doi.org/10.1038/s41592-022-01443-0

BORIS
  Origin:      https://github.com/olivierfriard/BORIS
  License:     GPL-3.0
  Read by:     the label converters in
               src/mosaic/behavior/label_library/, boris_aggregated_csv.py
               and boris_pandas_pickle.py, which read BORIS event exports.
  Citation:    Friard, O. and Gamba, M. (2016). BORIS: a free, versatile
               open-source event-logging software for video/audio coding
               and live observations. Methods in Ecology and Evolution
               7:1325-1330. https://doi.org/10.1111/2041-210X.12584

CVAT
  Origin:      https://github.com/cvat-ai/cvat
  License:     MIT
  Read by:     src/mosaic/core/annotations/readers/cvat.py and the
               converters src/mosaic/tracking/pose_training/converters/
               cvat_localizer.py and cvat_points.py, which read CVAT
               annotation exports.
  Citation:    CVAT.ai Corporation. Computer Vision Annotation Tool (CVAT).
               Zenodo. https://doi.org/10.5281/zenodo.3497105
               That DOI always resolves to the latest release. To cite the
               release you used, take its version DOI from the same page.

imgstore
  Origin:      https://github.com/loopbio/imgstore
  Copyright:   (c) 2017 The imgstore developers
  License:     BSD-3-Clause
  Read by:     src/mosaic/core/media/imgstore_native.py, a native reader of
               the imgstore on-disk format. It never imports the imgstore
               package. The test suite installs the package to write
               stores; nothing under src/ imports it and it is not
               distributed with mosaic.

  Stores are also written by Motif, the proprietary recording system of
  loopbio gmbh (https://www.loopbio.com/recording/). Mosaic does not run it.


OPTIONAL DISTRIBUTIONS
======================

FERAL
  Origin:      https://github.com/Skovorp/feral
  Copyright:   (c) Peter Skovorodnikov. Authors Peter Skovorodnikov and
               Jacopo Razzauti (Rockefeller University), equal
               contribution.
  License:     MIT, published as free text rather than a PEP 639
               expression or a classifier, so the identifier is read from
               its LICENSE.
  Installed:   by the [feral] extra. Wrapped by
               src/mosaic/behavior/feature_library/feral_feature.py.
  Citation:    Skovorodnikov, P. and Razzauti, J. (2025). FERAL. bioRxiv
               preprint. https://doi.org/10.1101/2025.11.16.688666
               The repository asks that the preprint be cited and notes
               that the revised manuscript (v2) adds further benchmarks.

lightning-action
  Origin:      Paninski lab
  Copyright:   Matt Whiteway
  License:     MIT
  Installed:   by the [lightning-action] extra. Wrapped by
               src/mosaic/behavior/feature_library/lightning_action_feature.py.

movement
  Origin:      https://github.com/neuroinformatics-unit/movement
  Copyright:   Neuroinformatics Unit, Sainsbury Wellcome Centre, UCL
  License:     BSD-3-Clause
  Installed:   by the [movement] extra. Wrapped by
               src/mosaic/behavior/feature_library/movement/.

FETCHED MODEL WEIGHTS
=====================

Mosaic distributes no weights. The terms are the ones the hub entry states
at the moment of download.

FERAL backbones, built at first use.

  V-JEPA 2 and V-JEPA 2.1, from facebookresearch/vjepa2 and the
  facebook/vjepa2-* hub entries. The repository states that "The majority
  of V-JEPA 2 is licensed under MIT, however portions of the project are
  available under separate license terms"; three files are Apache-2.0.
  Each facebook/vjepa2-* card mosaic can reach declares MIT. The default,
  facebook/vjepa2-vitl-fpc32-256-diving48, declares MIT.

  VideoPrism, from the sposiboh/videoprism-*-pt hub entries. These are
  third-party PyTorch ports, not Google DeepMind's own release, and each
  port's card declares Apache-2.0. Upstream google-deepmind/videoprism
  licenses its code under Apache-2.0 and states that "All other materials
  are licensed under the Creative Commons Attribution 4.0 International
  License (CC-BY)", which covers the weights. The two declarations have
  not been reconciled by either party. A user who needs certainty should
  obtain the weights from DeepMind directly and observe CC-BY-4.0
  attribution.

Identity backbones, loaded through timm by global-identity-embedding.
The default, timm/swin_large_patch4_window12_384.ms_in22k_ft_in1k, is MIT.

  MegaDescriptor. https://huggingface.co/BVRA/MegaDescriptor-L-384

      Creative Commons Attribution-NonCommercial 4.0 International
      (CC-BY-NC-4.0). Non-commercial use only.

  BVRA/MegaDescriptor-L-384 and BVRA/MegaDescriptor-T-224 both declare
  CC-BY-NC-4.0. The restriction is on the trained parameters, not on
  mosaic's code and not on the architecture. Mosaic never selects
  MegaDescriptor; naming it is the user's act.

  Attribution. CC-BY-NC-4.0 also requires credit. Anyone who uses or
  redistributes the weights must give appropriate credit (the creator's
  name, a copyright notice, a license notice, a disclaimer notice and a
  link to the material), link to the license at
  https://creativecommons.org/licenses/by-nc/4.0/, and indicate whether
  they changed the material. The credit must not suggest that the licensor
  endorses them. The license also forbids adding terms that restrict what
  it permits. The model card asks that results obtained with the weights
  cite:

      Cermak, V., Picek, L., Adam, L., Papafitsoros, K. (2024).
      WildlifeDatasets: An open-source toolkit for animal
      re-identification. IEEE/CVF Winter Conference on Applications of
      Computer Vision (WACV), pp. 5941-5951.
      https://doi.org/10.1109/WACV57701.2024.00585

  DINOv2. Copyright (c) Meta Platforms, Inc. and affiliates.
  Apache-2.0. https://github.com/facebookresearch/dinov2
  Loaded through torch.hub by the DINOv2 identity backbone.


IMPLEMENTED FROM PUBLISHED DESCRIPTIONS
=======================================

MotionMapper
  Method:      the behavioral mapping of Berman et al.: a wavelet
               spectrogram of posture, embedded in two dimensions with
               t-SNE, then segmented into behavioral states. Mosaic uses
               no MotionMapper code; the steps are written from the
               published description.
  In:          src/mosaic/behavior/feature_library/, the feature chain
               pair-posedistance-pca -> pair-wavelet -> extract-templates
               -> global-scaler -> global-tsne -> global-kmeans |
               global-ward.
  Citation:    Berman, G. J., Choi, D. M., Bialek, W., Shaevitz, J. W.
               (2014). Mapping the stereotyped behaviour of freely moving
               fruit flies. Journal of the Royal Society Interface
               11:20140672. https://doi.org/10.1098/rsif.2014.0672


REQUIRED DEPENDENCIES
=====================

mosaic-media
  Origin:      https://github.com/EcodylicScience/mosaic-media
  Copyright:   (C) 2026 Max-Planck-Gesellschaft zur Foerderung der
               Wissenschaften e.V., for the Max Planck Institute of
               Animal Behavior
  License:     Apache-2.0
  A sibling package by the same authors and a required dependency. Also
  installed into both Ultralytics environments.

PyAV
  Origin:      https://github.com/PyAV-Org/PyAV
  License:     BSD-3-Clause for PyAV's own code. The av wheel also bundles
               FFmpeg libraries (LGPL-3.0-or-later as built) and the x264
               and x265 encoders (GPL-2.0-or-later); see FFmpeg above.
  Installed as the av wheel through mosaic-media[io], for in-process frame
  decoding.

openTSNE
  Origin:      https://github.com/pavlin-policar/openTSNE
  License:     BSD-3-Clause
  Installed as a core dependency. Imported by the global-tsne feature,
  src/mosaic/behavior/feature_library/global_tsne.py.
  Citation:    Policar, P. G., Strazar, M., Zupan, B. (2024). openTSNE: A
               Modular Python Library for t-SNE Dimensionality Reduction
               and Embedding. Journal of Statistical Software 109(3).
               https://doi.org/10.18637/jss.v109.i03
               Cite it if your methods section names the method.

PyWavelets
  Origin:      https://github.com/PyWavelets/pywt
  License:     MIT
  Installed as a core dependency. Imported by the pair-wavelet feature,
  src/mosaic/behavior/feature_library/pair_wavelet.py.
  Citation:    Lee, G. R., Gommers, R., Waselewski, F., Wohlfahrt, K.,
               O'Leary, A. (2019). PyWavelets: A Python package for wavelet
               analysis. Journal of Open Source Software 4(36):1237.
               https://doi.org/10.21105/joss.01237
               Cite it if your methods section names the method.

The remaining runtime and development dependencies are permissively
licensed (BSD, MIT, Apache-2.0, PSF), with the exceptions below that a
default install does reach.

certifi is MPL-2.0, and arrives unconditionally on every platform:
mosaic-behavior -> tables -> blosc2 -> httpx -> certifi. MPL-2.0 is
file-level copyleft. It reaches modifications to certifi's own files,
which mosaic does not make, and not the work that depends on it, so it
imposes nothing here beyond keeping the notice.

NVIDIA components reach a default install through xgboost. On Linux,
xgboost declares nvidia-nccl-cu12 for GPU support. The license file its
wheel ships is BSD-3-Clause, although the metadata of the newest releases
declares NVIDIA proprietary terms. xgboost's own wheels for Linux and
Windows also contain the NVIDIA CUDA runtime, statically linked, which is
proprietary and redistributable under the CUDA Toolkit End User License
Agreement (https://docs.nvidia.com/cuda/eula/). mosaic never runs xgboost
on the GPU.

The NVIDIA CUDA libraries that arrive with PyTorch on Linux, under the
deep-learning, feral and lightning-action extras, are proprietary under
the same EULA; cuDNN and cuSPARSELt fall under NVIDIA's SDK license
agreement instead, and NVTX is Apache-2.0. NVIDIA DALI and nvImageCodec,
under the lightning-action extra, also carry proprietary NVIDIA
components despite their Apache-2.0 labels. mosaic reaches CUDA only
through PyTorch and redistributes none of it.

The resolved set is recorded in uv.lock, and

    python scripts/gen_third_party_inventory.py

regenerates the full inventory from it: per extra and per dependency
group, the transitive closure with each distribution's license resolved
from PyPI metadata and flagged when it is not permissive. It reads license
metadata only, so it does not see libraries bundled inside a wheel -- the
FFmpeg builds in av and opencv-python, or the CUDA runtime in xgboost --
which are described above instead. By default it reads mosaic's lock,
the isolated keypoint-MoSeq lock and the isolated VAME lock. Pass --lock
for the Ultralytics and POLO environment locks, which list the
AGPL-licensed distributions and are not read by default.
