Skip to content

Commit 1591278

Browse files
committed
updated readme
1 parent 6bf31db commit 1591278

File tree

2 files changed

+34
-3
lines changed

2 files changed

+34
-3
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,32 @@ You can git clone (or download) this repo to grab a copy and go. We provide exam
7979
5) [Reuse the task program generated by LLM and run it on different videos](notebook/MABe_demo.ipynb)
8080
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`.
8181

82+
### Minimal example
8283

84+
```python
85+
import os
86+
from amadeusgpt import create_project
87+
from amadeusgpt import AMADEUS
88+
from amadeusgpt.utils import parse_result
89+
90+
if 'OPENAI_API_KEY' not in os.environ:
91+
os.environ['OPENAI_API_KEY'] = 'your key'
92+
93+
# data folder contains video file and optionally keypoint files
94+
data_folder = "temp_data_folder"
95+
# where the results are saved
96+
result_folder = "temp_result_folder"
97+
# Create a project
98+
config = create_project(data_folder, result_folder, video_suffix = ".mp4")
99+
100+
# Create an AMADEUS instance
101+
amadeus = AMADEUS(config)
102+
103+
query = "Plot the trajectory of the animal using the animal center and color it by time"
104+
qa_message = amadeus.step(query)
105+
# we made it easier to parse the result
106+
parse_result(amadeus, qa_message)
107+
```
83108

84109
### Try AmadeusGPT with a local WebApp
85110
- You will need to git clone this repo and have a copy locally. Then in your env run `pip install 'amadeusGPT[streamlit]'`

tests/test_project_creation.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import os
2+
from amadeusgpt import create_project
3+
from amadeusgpt import AMADEUS
4+
from amadeusgpt.utils import parse_result
5+
26
if 'OPENAI_API_KEY' not in os.environ:
37
os.environ['OPENAI_API_KEY'] = 'your key'
48

5-
from amadeusgpt import create_project
6-
from amadeusgpt import AMADEUS
79
# Create a project
810

911
data_folder = "temp_data_folder"
@@ -12,4 +14,8 @@
1214
config = create_project(data_folder, result_folder)
1315

1416
# Create an AMADEUS instance
15-
amadeus = AMADEUS(config)
17+
amadeus = AMADEUS(config)
18+
19+
# query = "Plot the trajectory of the animal using the animal center and color it by time"
20+
# qa_message = amadeus.step(query)
21+
# parse_result(amadeus, qa_message)

0 commit comments

Comments
 (0)