https://github.com/adaptivemotorcontrollab/amadeusgpt

We turn natural language descriptions of behaviors into machine-executable code

https://github.com/adaptivemotorcontrollab/amadeusgpt

Science Score: 46.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org, nature.com
  • Committers with academic emails
    2 of 5 committers (40.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.3%) to scientific vocabulary

Keywords

amadeusgpt cebra chatgpt deeplabcut llms segment-anything
Last synced: 6 months ago · JSON representation

Repository

We turn natural language descriptions of behaviors into machine-executable code

Basic Info
Statistics
  • Stars: 222
  • Watchers: 3
  • Forks: 14
  • Open Issues: 4
  • Releases: 6
Topics
amadeusgpt cebra chatgpt deeplabcut llms segment-anything
Created over 2 years ago · Last pushed 8 months ago
Metadata Files
Readme License Code of conduct

README.md

[![Downloads](https://pepy.tech/badge/amadeusgpt)](https://pepy.tech/project/amadeusgpt) [![Downloads](https://pepy.tech/badge/amadeusgpt/month)](https://pepy.tech/project/amadeusgpt) [![PyPI version](https://badge.fury.io/py/amadeusgpt.svg)](https://badge.fury.io/py/amadeusgpt) [![GitHub stars](https://img.shields.io/github/stars/AdaptiveMotorControlLab/AmadeusGPT.svg?style=social&label=Star)](https://github.com/AdaptiveMotorControlLab/AmadeusGPT) ## 🪄 We turn natural language descriptions of behaviors into machine-executable code. [🛠️ Installation](https://github.com/AdaptiveMotorControlLab/AmadeusGPT?tab=readme-ov-file#install--run-amadeusgpt) | [🌎 Home Page](http://www.mackenziemathislab.org/amadeusgpt) | [🚀 Demos & Docs](https://adaptivemotorcontrollab.github.io/AmadeusGPT/README.html) [🚨 News](https://github.com/AdaptiveMotorControlLab/AmadeusGPT?tab=readme-ov-file#news) | [🪲 Reporting Issues](https://github.com/AdaptiveMotorControlLab/AmadeusGPT/issues) | [💬 Discussions!](https://github.com/AdaptiveMotorControlLab/AmadeusGPT/discussions)

What is AmadeusGPT?

Developed by part of the same team that brought you DeepLabCut, AmadeusGPT is a natural language interface that turns natural language descriptions of behaviors into machine-executable code. The process of quantifying and analyzing animal behavior involves translating the naturally occurring descriptive language of their actions into machine-readable code. Yet, codifying behavior analysis is often challenging without deep understanding of animal behavior and technical machine learning knowledge, so we wanted to ease this jump. In short, we provide a "code-free" interface for you to analysis video data of animals. If you are a DeepLabCut user, this means you could upload your videos and .h5 keypoint files and then ask questions, such as "How much time does the mouse spend in the middle of the open field?". In our original work (NeurIPS 2023) we used GPT3.5 and GPT4 as part of our agent. We continue to support the latest OpenAI models, and are continuing to actively develop this project.

Get started: install AmadeusGPT🎻

[1] You will need an openAI key:

Why OpenAI API Key is needed AmadeusGPT relies on API calls of OpenAI (we will add more LLM options in the future) for language understanding and code writing. Sign up for a openAI API key here.

Then, you can add this into your environment by passing the following in the terminal after you launched your conda env:

bash export OPENAI_API_KEY='your API key'

Or inside a python script or Jupyter Notebook, add this if you did not pass at the terminal stage:

python import os os.environ["OPENAI_API_KEY"] = 'your api key'

[2] Set up a conda environment:

Conda is an easy-to-use Python interface that supports launching Jupyter Notebooks. If you are completely new to this, we recommend checking out the docs here for getting conda installed. Otherwise, proceed to use one of our supplied conda files. As you will see we have minimal dependencies to get started, and here is a simple step-by-step guide you can reference for setting it up (or see BONUS below). Here is the quick start command:

bash conda env create -f amadeusGPT.yml To note, some modules AmadeusGPT can use benefit from GPU support, therefore we recommend also having an NVIDIA GPU available and installing CUDA.

[3] 🪄 That's it! Now you have AmadeusGPT installed!

See below on how to get started!

Get started: run AmadeusGPT🎻

We provide a StreamLit App, or you can use AmadeusGPT in any python interface, such as Jupyter notebooks. For this we suggest getting started from our demos:

Try AmadeusGPT with an example Jupyter Notebook

You can git clone (or download) this repo to grab a copy and go. We provide example notebooks here!

Here are a few demos that could fuel your own work, so please check them out!

1) Draw a region of interest (ROI) and ask, "when is the animal in the ROI?" 2) Use your own data - (make sure you use a GPU to run SuperAnimal if you don't have corresponding DeepLabCut keypoint files already!) 3) Write you own integration modules and use them. Bonus: source code. Make sure you delete the cached modulesembedding.pickle if you add new modules! 4) Multi-Animal social interactions 5) Reuse the task program generated by LLM and run it on different videos 7) You can ask one query across multiple videos. Put your keypoint files and video files (pairs) in the same folder and specify the `datafolderas shown in this [Demo](https://github.com/AdaptiveMotorControlLab/AmadeusGPT/tree/main/notebooks/YourData.ipynb). Make sure your video file and keypoint file follows the normal DeepLabCut convention, i.e.,prefix.mp4prefix*.h5`.

Minimal example

```python import os from amadeusgpt import createproject from amadeusgpt import AMADEUS from amadeusgpt.utils import parseresult

if 'OPENAIAPIKEY' not in os.environ:
os.environ['OPENAIAPIKEY'] = 'your key'

data folder contains video files and optionally keypoint files

please pay attention to the naming convention as described above

datafolder = "tempdata_folder"

where the results are saved

resultfolder = "tempresult_folder"

Create a project

config = createproject(datafolder, resultfolder, videosuffix = ".mp4")

Create an AMADEUS instance

amadeus = AMADEUS(config)

query = "Plot the trajectory of the animal using the animal center and color it by time" qa_message = amadeus.step(query)

we made it easier to parse the result

parseresult(amadeus, qamessage) ```

Try AmadeusGPT with a local WebApp

  • You will need to git clone this repo and have a copy locally. Then in your env run pip install 'amadeusGPT[streamlit]'
  • Then you can open the terminal and within the directory run: python make app

[BONUS - installation via a customized conda env]

If you want to set up your own env,

bash conda create -n amadeusGPT python=3.10 the key dependencies that need installed are: python pip install notebook conda install hdf5 conda install pytables==3.8 pip install -U --pre deeplabcut pip install amadeusgpt

Citation

If you use ideas or code from this project in your work, please cite us using the following BibTeX entry. 🙏

@article{ye2023amadeusGPT, title={AmadeusGPT: a natural language interface for interactive animal behavioral analysis}, author={Shaokai Ye and Jessy Lauer and Mu Zhou and Alexander Mathis and Mackenzie Weygandt Mathis}, journal={Thirty-seventh Conference on Neural Information Processing Systems}, year={2023}, url={https://openreview.net/forum?id=9AcG3Tsyoq}, - arXiv preprint version AmadeusGPT: a natural language interface for interactive animal behavioral analysis by Shaokai Ye, Jessy Lauer, Mu Zhou, Alexander Mathis & Mackenzie W. Mathis.

License

AmadeusGPT is license under the Apache-2.0 license. - 🚨 Please note several key dependencies have their own licensing. Please carefully check the license information for DeepLabCut (LGPL-3.0 license), SAM (Apache-2.0 license), etc.

FAQ:

Do I need to provide keypoint files or is video-only enough to get starte?

  • If you only provide a video file, we use SuperAnimal models SuperAnimal models to predict which animal is in your video. While we highly recommend GPU installation, we are working on faster, light-weight SuperAnimal models to work on your CPU.
  • If you already have keypoint file corresponding to the video file, look how we set-up the config file in the Notebooks. Right now we only support keypoint output from DeepLabCut.

News

  • June 2025 v0.1.3 is out, and we introduce new demo docs!
  • July 2024 v0.1.1 is released! This is a major code update ...
  • June 2024 as part of the CZI EOSS, The Kavli Foundation now supports this work! ✨
  • 🤩 Dec 2023, code released!
  • 🔥 Our work was accepted to NeuRIPS2023
  • 🧙‍♀️ Open-source code coming in the fall of 2023
  • 🔮 arXiv paper and demo released July 2023
  • 🪄Contact us

Owner

  • Name: Mathis Lab | Adaptive Motor Control
  • Login: AdaptiveMotorControlLab
  • Kind: organization
  • Email: mackenzie@post.harvard.edu
  • Location: Swiss Federal Institute of Technology

Mechanisms underlying adaptive behavior in intelligent systems

GitHub Events

Total
  • Issues event: 2
  • Watch event: 19
  • Delete event: 3
  • Issue comment event: 2
  • Push event: 14
  • Pull request review comment event: 1
  • Pull request review event: 7
  • Pull request event: 9
  • Fork event: 4
  • Create event: 3
Last Year
  • Issues event: 2
  • Watch event: 19
  • Delete event: 3
  • Issue comment event: 2
  • Push event: 14
  • Pull request review comment event: 1
  • Pull request review event: 7
  • Pull request event: 9
  • Fork event: 4
  • Create event: 3

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 245
  • Total Committers: 5
  • Avg Commits per committer: 49.0
  • Development Distribution Score (DDS): 0.282
Past Year
  • Commits: 178
  • Committers: 3
  • Avg Commits per committer: 59.333
  • Development Distribution Score (DDS): 0.112
Top Committers
Name Email Commits
shaokaiye s****h@g****m 176
Mackenzie Mathis m****s@r****u 60
MacKenzie Mathis m****e@1****u 7
Yaroslav Halchenko d****n@o****m 1
Alexander Mathis m****l@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 7
  • Total pull requests: 79
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 8 days
  • Total issue authors: 6
  • Total pull request authors: 7
  • Average comments per issue: 0.71
  • Average comments per pull request: 0.3
  • Merged pull requests: 60
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 2
  • Pull requests: 10
  • Average time to close issues: N/A
  • Average time to close pull requests: 27 minutes
  • Issue authors: 2
  • Pull request authors: 4
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.4
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • Specom (2)
  • SpencerBowles (1)
  • yarikoptic (1)
  • ralphpeterson (1)
  • DenisKochetov (1)
  • MSchellenberger (1)
Pull Request Authors
  • MMathisLab (38)
  • yeshaokai (31)
  • akshaypardhanani (3)
  • xiu-cs (2)
  • Timokleia (2)
  • AlexEMG (2)
  • yarikoptic (1)
Top Labels
Issue Labels
question (1)
Pull Request Labels
release (5) enhancement (3) documentation (2)

Packages

  • Total packages: 3
  • Total downloads:
    • pypi 80 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 0
    (may contain duplicates)
  • Total versions: 18
  • Total maintainers: 1
proxy.golang.org: github.com/adaptivemotorcontrollab/amadeusgpt
  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 6.5%
Average: 6.7%
Dependent repos count: 7.0%
Last synced: 6 months ago
proxy.golang.org: github.com/AdaptiveMotorControlLab/AmadeusGPT
  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 6.5%
Average: 6.7%
Dependent repos count: 7.0%
Last synced: 6 months ago
pypi.org: amadeusgpt

AmadeusGPT🎻: We turn natural language descriptions of behaviors into machine-executable code

  • Versions: 8
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 80 Last month
Rankings
Dependent packages count: 7.2%
Stargazers count: 25.4%
Average: 26.1%
Forks count: 30.3%
Dependent repos count: 41.3%
Maintainers (1)
Last synced: 6 months ago