Metadata-Version: 2.4
Name: diplomat-track
Version: 0.3.16
Summary: Deep learning-based Identity Preserving Labeled-Object Multi-Animal Tracking.
Home-page: https://diplomattrack.org
Author: Isaac Robinson
Author-email: isaac.k.robinson2000@gmail.com
Project-URL: Homepage, https://diplomattrack.org
Project-URL: Documentation, https://diplomat.readthedocs.io
Project-URL: Source, https://github.com/TravisWheelerLab/DIPLOMAT
Platform: any
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Typing :: Typed
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: AUTHORS
Requires-Dist: opencv-python-headless
Requires-Dist: matplotlib
Requires-Dist: typing_extensions>=3.8
Requires-Dist: tqdm
Requires-Dist: PyYAML
Requires-Dist: pandas
Requires-Dist: numpy
Requires-Dist: numba
Provides-Extra: gui
Requires-Dist: wxpython; extra == "gui"
Provides-Extra: sleap
Requires-Dist: h5py; extra == "sleap"
Requires-Dist: tables; extra == "sleap"
Requires-Dist: tensorflow; extra == "sleap"
Requires-Dist: tf2onnx>=1.16.1; extra == "sleap"
Requires-Dist: onnx; extra == "sleap"
Requires-Dist: onnxruntime>=1.19; extra == "sleap"
Provides-Extra: sleap-nvidia
Requires-Dist: h5py; extra == "sleap-nvidia"
Requires-Dist: tables; extra == "sleap-nvidia"
Requires-Dist: tensorflow; extra == "sleap-nvidia"
Requires-Dist: tf2onnx>=1.16.1; extra == "sleap-nvidia"
Requires-Dist: onnx; extra == "sleap-nvidia"
Requires-Dist: onnxruntime-gpu>=1.19; extra == "sleap-nvidia"
Requires-Dist: nvidia-cuda-nvrtc-cu12~=12.0; extra == "sleap-nvidia"
Requires-Dist: nvidia-cuda-runtime-cu12~=12.0; extra == "sleap-nvidia"
Requires-Dist: nvidia-cufft-cu12~=11.0; extra == "sleap-nvidia"
Requires-Dist: nvidia-curand-cu12~=10.0; extra == "sleap-nvidia"
Requires-Dist: nvidia-cudnn-cu12~=9.0; extra == "sleap-nvidia"
Provides-Extra: dlc
Requires-Dist: h5py; extra == "dlc"
Requires-Dist: tables; extra == "dlc"
Requires-Dist: tensorflow; extra == "dlc"
Requires-Dist: tf2onnx>=1.16.1; extra == "dlc"
Requires-Dist: onnx; extra == "dlc"
Requires-Dist: onnxruntime>=1.19; extra == "dlc"
Provides-Extra: dlc-nvidia
Requires-Dist: h5py; extra == "dlc-nvidia"
Requires-Dist: tables; extra == "dlc-nvidia"
Requires-Dist: tensorflow; extra == "dlc-nvidia"
Requires-Dist: tf2onnx>=1.16.1; extra == "dlc-nvidia"
Requires-Dist: onnx; extra == "dlc-nvidia"
Requires-Dist: onnxruntime-gpu>=1.19; extra == "dlc-nvidia"
Requires-Dist: nvidia-cuda-nvrtc-cu12~=12.0; extra == "dlc-nvidia"
Requires-Dist: nvidia-cuda-runtime-cu12~=12.0; extra == "dlc-nvidia"
Requires-Dist: nvidia-cufft-cu12~=11.0; extra == "dlc-nvidia"
Requires-Dist: nvidia-curand-cu12~=10.0; extra == "dlc-nvidia"
Requires-Dist: nvidia-cudnn-cu12~=9.0; extra == "dlc-nvidia"
Provides-Extra: all
Requires-Dist: wxpython; extra == "all"
Requires-Dist: h5py; extra == "all"
Requires-Dist: tables; extra == "all"
Requires-Dist: tensorflow; extra == "all"
Requires-Dist: tf2onnx>=1.16.1; extra == "all"
Requires-Dist: onnx; extra == "all"
Requires-Dist: onnxruntime>=1.19; extra == "all"
Provides-Extra: all-nvidia
Requires-Dist: wxpython; extra == "all-nvidia"
Requires-Dist: h5py; extra == "all-nvidia"
Requires-Dist: tables; extra == "all-nvidia"
Requires-Dist: tensorflow; extra == "all-nvidia"
Requires-Dist: tf2onnx>=1.16.1; extra == "all-nvidia"
Requires-Dist: onnx; extra == "all-nvidia"
Requires-Dist: onnxruntime-gpu>=1.19; extra == "all-nvidia"
Requires-Dist: nvidia-cuda-nvrtc-cu12~=12.0; extra == "all-nvidia"
Requires-Dist: nvidia-cuda-runtime-cu12~=12.0; extra == "all-nvidia"
Requires-Dist: nvidia-cufft-cu12~=11.0; extra == "all-nvidia"
Requires-Dist: nvidia-curand-cu12~=10.0; extra == "all-nvidia"
Requires-Dist: nvidia-cudnn-cu12~=9.0; extra == "all-nvidia"
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: scipy; extra == "test"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: platform
Dynamic: project-url
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# DIPLOMAT

Deep learning-based Identity Preserving Labeled-Object Multi-Animal Tracking.

**NOTE:** DIPLOMAT is currently early beta software, there may be minor bugs and usability issues.

If you are a user (not a developer contributing code), you may want to visit:
- the software website: [https://wheelerlab.org/DIPLOMAT](https://wheelerlab.org/DIPLOMAT/)
- in-depth documentation: [https://diplomat.readthedocs.io](https://diplomat.readthedocs.io/en/latest)

## About

DIPLOMAT provides a multi-animal tracking/pose-estimation interface that (1) reduces identity swaps and body part losses, and (2) simplifies correction of automated tracking errors. After pre-processing a video with a pose estimation tool (currently supporting SLEAP and DeepLabCut packages), DIPLOMAT computes a multi-animal maximum-probability trace to _**Track**_ multiple animals (and their body parts); it then provides an intuitive and memory/time efficient _**Interact**_ interface to edit and re-track as needed. DIPLOMAT differs from other multi-animal tracking packages by working directly off of confidence maps instead of running peak detection, allowing for more accurate tracking results.



![UI Demo Showing user correcting tracking in a video](interact_retrack_gif.gif)

**Correcting and re-tracing on the Interact Interface**

| Example of tracking 2 Degus in a Box | Example of tracking 3 Rats |
|:------------------------------------:|:--------------------------:|
| ![Example of tracking 2 Degus](https://raw.githubusercontent.com/TravisWheelerLab/DIPLOMAT/main/docs/source/_static/imgs/example1.png) | ![Example of tracking 3 Rats](https://raw.githubusercontent.com/TravisWheelerLab/DIPLOMAT/main/docs/source/_static/imgs/example2.png) |
## Installation

For detailed installation instructions, please refer to the [documentation](https://diplomat.readthedocs.io/en/latest/installation.html)!

## Usage

#### Running DIPLOMAT

To run DIPLOMAT on a video once it is installed, simply use DIPLOMAT's `track` and `track_and_interact` commands to track a video:
```bash
# Run DIPLOMAT with no UI...
diplomat track -c path/to/config -v path/to/video
# Run DIPLOMAT with UI...
diplomat track_and_interact -c path/to/config -v path/to/video
```

Multiple videos can be tracked by passing them as a list:
```bash
diplomat track -c path/to/config -v [path/to/video1, path/to/video2, "path/to/video3"]
```

Once tracking is done, DIPLOMAT can create labeled videos via it's `annotate` subcommand:
```bash
diplomat annotate -v path/to/video -c path/to/csv
```

If you need to reopen the UI to make further major modifications, you can do so using the `interact` subcommand:
```bash
diplomat interact -s path/to/ui_state.dipui
```
This displays the full UI again for making further edits. Results are saved back to the same files.

If you need to make minor modifications after tracking a video, you can do so using the tweak subcommand:
```bash
diplomat tweak -v path/to/video -c path/to/csv
```
This will display a stripped down version of the interactive editing UI, allowing for minor tweaks to be made to the 
tracks, and then saved back to the same file.

For a list of additional ways DIPLOMAT can be used, see the [documentation](https://diplomat.readthedocs.io/en/latest/basic_usage.html).

#### Additional Help

All DIPLOMAT commands are documented via help strings. To get more information about a diplomat subcommand or command, simply run it with the `-h` or `--help` flag.

```bash
# Help for all of diplomat (lists sub commands of diplomat):
diplomat --help 
# Help for the track subcommand:
diplomat track --help
# Help for the predictors subcommand space:
diplomat predictors --help
```

Some commands support passing frontend-specific arguments. To get frontend specific help, you can use the `--help_extra` flag.
```bash
diplomat track -c /path/to/config --help_extra
diplomat track_and_interact -c /path/to/config --help_extra
diplomat track_with -c /path/to/config -p Predictor --help_extra
```

## Documentation

DIPLOMAT has documentation on ReadTheDocs at [https://diplomat.readthedocs.io/en/latest](https://diplomat.readthedocs.io/en/latest).

## Development

DIPLOMAT is written entirely in python. To set up an environment for developing DIPLOMAT, you can simply pull down this repository and install its
requirements using pip. For a further description of how to set up DIPLOMAT for development, see the 
[Development Usage](https://diplomat.readthedocs.io/en/latest/advanced_usage.html#development-usage) section in the documentation.

## Contributing

We welcome external contributions, although it is a good idea to contact the
maintainers before embarking on any significant development work to make sure
the proposed changes are a good fit.

Contributors agree to license their code under the license in use by this
project (see `LICENSE`).

To contribute:

  1. Fork the repo
  2. Make changes on a branch
  3. Create a pull request

## License

See `LICENSE` for details.

## Authors

If you have any questions, feel free to reach out to George Glidden, at [help@diplomattrack.org](mailto:help@diplomattrack.org)

See `AUTHORS` for the full list of authors.

