You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* updates
* fixed get acceleration
* several updates
* updates
* WIP
* replaced hardcoded identifier with identifier class
* lots of improvements
* fixed one more conflict
* some fixes to web app
* Fixed typos
* Added yaml dependency
* Added init in behavior analysis folder
* Added pycocotools into dependency
* reformatted test functions
* black and isort
* Added demo data test and added back video files
* added test demo test
* Added tables into dependency
* try adjusting the paths
* removed pycocotools dependency to see whether it helps
* see if pining numpy and table version in workflow helps
* edited the pytest.yml instead
* tables 3.8 in test
* Separated installation from readme
* Added some useful prints
* no need to print meta info again
* added self debug into code execution as default
* cleaned output
* Fixed a bug for keypoint_info being none
* Update README.md
* Update README.md
* Delete INSTALL.md
- this is redundant with information in main docs now
* Update README.md
* Update and rename amadesuGPT-cpu.yml to amadesuGPT.yml (#40)
* Update and rename amadesuGPT-cpu.yml to amadesuGPT.yml
* Delete conda/amadesuGPT-gpu.yml
* Delete conda/amadesuGPT-minimal.yml
* Update amadesuGPT.yml
- amadeusgpt should be a dependency
---------
Co-authored-by: Mackenzie Mathis <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+56-63Lines changed: 56 additions & 63 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,102 +22,88 @@
22
22
- We use large language models (LLMs) to bridge natural language and behavior analysis.
23
23
- This work is published at **NeurIPS2023!** Read the paper, [AmadeusGPT: a natural language interface for interactive animal behavioral analysis]([https://www.google.com/search?q=amadeusgpt+openreview&sca_esv=590699485&rlz=1C5CHFA_enCH1059CH1060&ei=K1N6ZaHdKvmrur8PosOOkAo&ved=0ahUKEwjhnta83I2DAxX5le4BHaKhA6IQ4dUDCBE&uact=5&oq=amadeusgpt+openreview&gs_lp=Egxnd3Mtd2l6LXNlcnAiFWFtYWRldXNncHQgb3BlbnJldmlldzIHECEYoAEYCjIHECEYoAEYCki2HVDfAliOHHACeACQAQGYAYMDoAHaGaoBCDEuMTEuMS40uAEDyAEA-AEBwgIFECEYqwLCAggQABiABBiiBMICCBAAGIkFGKIE4gMEGAEgQYgGAQ&sclient=gws-wiz-serp#:~:text=AmadeusGPT%3A%20a%20natural,net%20%E2%80%BA%20pdf](https://proceedings.neurips.cc/paper_files/paper/2023/file/1456560769bbc38e4f8c5055048ea712-Paper-Conference.pdf)) by [Shaokai Ye](https://github.com/yeshaokai), [Jessy Lauer](https://github.com/jeylau), [Mu Zhou](https://github.com/zhoumu53), [Alexander Mathis](https://github.com/AlexEMG) & [Mackenzie W. Mathis](https://github.com/MMathisLab).
24
24
- Like this project? Please consider giving us a star ⭐️!
25
-
26
-
## Install & Run AmadeusGPT🎻
27
-
28
-
### Install with `pypi`
29
25
30
-
- AmadeusGPT is a Python package hosted on `pypi`. You can create a virtual env (conda, etc, see below*) and run:
31
-
```python
32
-
pip install 'amadeusgpt[streamlit]'
33
-
```
34
-
Note that in order to access our demo video and keypoint files, we recommend to install from the source.
26
+
## What is AmadeusGPT?
35
27
36
-
### Install from the source
28
+
**Developed by part of the same team that brought you [DeepLabCut](https://www.mackenziemathislab.org/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.
29
+
In short, we provide a "code-free" interface for you to analysis video data of animals. If you are a [DeepLabCut](https://www.mackenziemathislab.org/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?".
30
+
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.
31
+
32
+
## Get started: install AmadeusGPT🎻
37
33
38
-
**Make sure you edit those installation scripts to point to your own conda path before you run them**
34
+
### [1] Set up a conda environment:
39
35
40
-
#### Minimal installation
41
-
**Recommended for:** Running AmadeusGPT without GPUs. This setup is lightweight and is limited to processing movie files and keypoint outputs (.h5) from DeepLabCut.
36
+
Conda is an easy-to-use Python interface that supports launching [Jupyter Notebooks](https://jupyter.org/). If you are completely new to this, we recommend checking out the [docs here for getting conda installed](https://deeplabcut.github.io/DeepLabCut/docs/beginner-guides/beginners-guide.html#beginner-user-guide). Otherwise, proceed to use one of [our supplied conda files](https://github.com/AdaptiveMotorControlLab/AmadeusGPT/tree/main/conda). As you will see we have minimal dependencies to get started, and [here is a simple step-by-step guide](https://deeplabcut.github.io/DeepLabCut/docs/installation.html#step-2-build-an-env-using-our-conda-file) you can reference for setting it up (or see [BONUS](README.md#bonus---customized-your-conda-env) below). Here is the quick start command:
42
37
43
38
```bash
44
-
# Install the minimal environment
45
-
bash install_minimal.sh
46
-
47
-
# Activate the conda environment
48
-
conda activate amadeusgpt-minimal
39
+
conda env create -f amadeusGPT.yml
49
40
```
41
+
To note, some modules AmadeusGPT can use benefit from GPU support, therefore we recommend also having an NVIDIA GPU available and installing CUDA.
50
42
51
-
#### GPU installation
52
-
**Recommended for:** Users on Linux with GPUs. Support for Windows and MacOS will be added in the future.
43
+
### [2] You will need an openAI key:
53
44
54
-
```bash
55
-
# Install the gpu environment
56
-
bash install_gpu.sh
45
+
**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](https://platform.openai.com/account/api-keys)[here](https://platform.openai.com/account/api-keys).
46
+
47
+
Then, you can add this into your environment by passing the following in the terminal after you launched your conda env:
57
48
58
-
# Activate the conda environment
59
-
conda activate amadeusgpt-gpu
49
+
```bash
50
+
export OPENAI_API_KEY='your API key'
60
51
```
61
52
62
-
#### CPU installation
63
-
**Recommended for:** MacOS / Linux users working with very small video files.
53
+
Or inside a python script or Jupyter Notebook, add this if you did not pass at the terminal stage:
64
54
65
-
```bash
66
-
# Install the cpu environment
67
-
bash install_cpu.sh
68
55
69
-
# Activate the conda environment
70
-
conda activate amadeusgpt-cpu
56
+
```python
57
+
import os
58
+
os.environ["OPENAI_API_KEY"] ='your api key'
71
59
```
72
60
61
+
### [3] 🪄 That's it! Now you have AmadeusGPT installed!
73
62
74
-
### Setup OpenAI API Key to use AmadeusGPT
75
-
76
-
**Why OpenAI API Key is needed** AmadeusGPT relies on API calls of OpenAI (we will add more options in the future) for language understanding and code writing.
63
+
See below on how to get started!
77
64
78
-
You can either add this into your environment by following:
79
65
80
-
```bash
81
-
export OPENAI_API_KEY='your API key'
82
-
```
66
+
## Get started: run AmadeusGPT🎻
83
67
84
-
Or inside your python script or jupyter notebook, add this line in the beginning of the file
68
+
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:
85
69
70
+
### Try AmadeusGPT with an example Jupyter Notebook
71
+
You can git clone (or download) this repo to grab a copy and go. We provide example notebooks [here](notebook)!
86
72
87
-
```python
88
-
import os
89
-
os.environ["OPENAI_API_KEY"] ='your api key'
90
-
```
73
+
### Here are a few demos that could fuel your own work, so please check them out!
91
74
92
-
- Please note that you need an [openAI API key](https://platform.openai.com/account/api-keys), which you can easily create [here](https://platform.openai.com/account/api-keys).
75
+
1)[Draw a region of interest (ROI) and ask, "when is the animal in the ROI?"](notebook/EPM_demo.ipynb)
76
+
2)[Use a DeepLabCut SuperAnimal pose model to do video inference](notebook/custom_mouse_demo.ipynb) - (make sure you use a GPU if you don't have corresponding DeepLabCut keypoint files already!
77
+
3)[Write you own integration modules and use them](notebook/Horse_demo.ipynb). Bonus: [source code](amadeusgpt/integration_modules). Make sure you delete the cached modules_embedding.pickle if you add new modules!
78
+
4)[Multi-Animal social interactions](notebook/MABe_demo.ipynb)
79
+
5)[Reuse the task program generated by LLM and run it on different videos](notebook/MABe_demo.ipynb)
80
+
7) You can ask one query across multiple videos. Put your keypoint files and video files (pairs) in the same folder and specify the `data_folder` as shown in this [Demo](notebook/custom_mouse_video.ipynb). Make sure your video file and keypoint file follows the normal DeepLabCut convention, i.e., `prefix.mp4``prefix*.h5`.
93
81
94
82
95
83
96
-
### Try AmadeusGPT with local web app
84
+
### Try AmadeusGPT with a local WebApp
85
+
- You will need to git clone this repo and have a copy locally. Then in your env run `pip install 'amadeusGPT[streamlit]'`
86
+
- Then you can open the terminal and within the directory run:
97
87
```python
98
88
make app
99
89
```
100
90
101
-
### Do I need to provide keypoint files?
102
-
- If you only provide the raw video file, we use SuperAnimal models [SuperAnimal models](https://www.nature.com/articles/s41467-024-48792-2) to predict your video. This is only supported with cpu or gpu installation. While we highly recommend gpu installation, we are working on faster, light-weight superanimal models to work on your CPU.
103
-
- If you already have keypoint file corresponding to the video file, look up how we set-up the config file in the notebooks. Right now we only support keypoint output from DeepLabCut. Other keypoint formats can be added upon feature requests.
104
-
105
91
106
-
### Try AmadeusGPT with our example notebooks
107
-
We provide example notebooks at [Notebooks](notebook)
108
-
109
-
### Notebook as use-case demo
110
-
111
-
1) Draw ROI and ask when is the animal in the ROI. [Demo](notebook/EPM_demo.ipynb)
112
-
2) Obtain the binary mask for retrieved masks (for further sampling such as neural data pairing) [Demo](notebook/EPM_demo.ipynb)
113
-
3) Use SuperAnimal video inference (make sure you use gpu or cpu installation) if you don't have corresponding DeepLabCut keypoint file [Demo](notebook/custom_mouse_demo.ipynb)
114
-
4) Write you own integration modules and use them [Demo](notebook/Horse_demo.ipynb)[Source code](amadeusgpt/integration_modules). Make sure you delete the cached modules_embedding.pickle if you add new modules
115
-
5) Multi-Animal social interaction. [Demo](notebook/MABe_demo.ipynb)
116
-
6) Reuse the task program generated by LLM and run it on different videos [Demo](notebook/MABe_demo.ipynb)
92
+
## [BONUS - customized your conda env]
93
+
If you want to set up your own env,
117
94
95
+
```bash
96
+
conda create -n amadesuGPT python=3.10
97
+
```
98
+
the key dependencies that need installed are:
99
+
```python
100
+
pip install notebook
101
+
conda install hdf5
102
+
pip install amadeusgpt
103
+
```
118
104
## Citation
119
105
120
-
If you use ideas or code from this project in your work, please cite us using the following BibTeX entry. 🙏
106
+
If you use ideas or code from this project in your work, please cite us using the following BibTeX entry. 🙏
121
107
122
108
```
123
109
@article{ye2023amadeusGPT,
@@ -133,10 +119,17 @@ We provide example notebooks at [Notebooks](notebook)
133
119
## License
134
120
135
121
AmadeusGPT is license under the Apache-2.0 license.
136
-
- 🚨 Please note several key dependencies have their own licensing. Please carefully check the license information for [DeepLabCut](https://github.com/DeepLabCut/DeepLabCut) (LGPL-3.0 license), [SAM](https://github.com/facebookresearch/segment-anything) (Apache-2.0 license), [CEBRA](https://github.com/AdaptiveMotorControlLab/CEBRA) (Non-Commercial), etc.
122
+
- 🚨 Please note several key dependencies have their own licensing. Please carefully check the license information for [DeepLabCut](https://github.com/DeepLabCut/DeepLabCut) (LGPL-3.0 license), [SAM](https://github.com/facebookresearch/segment-anything) (Apache-2.0 license), etc.
123
+
124
+
## FAQ:
137
125
126
+
### Do I need to provide keypoint files or is video-only enough to get starte?
127
+
- If you only provide a video file, we use SuperAnimal models [SuperAnimal models](https://www.nature.com/articles/s41467-024-48792-2) 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.
128
+
- 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.
138
129
139
130
## News
131
+
- July 2024 0.1.0 is released! This is a major code update ...
132
+
- June 2024 as part of the CZI EOSS, The Kavli Foundation now supports this work! ✨
140
133
- 🤩 Dec 2023, code released!
141
134
- 🔥 Our work was accepted to NeuRIPS2023
142
135
- 🧙♀️ Open-source code coming in the fall of 2023
0 commit comments