Skip to content

Commit 7750786

Browse files
committed
adjusted a few things
1 parent 1542f35 commit 7750786

File tree

5 files changed

+213
-70
lines changed

5 files changed

+213
-70
lines changed

amadeusgpt/managers/visual_manager.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ def write_video(self, out_folder, video_file_path, out_name, events):
549549
if total_duration < 0.0:
550550
return
551551

552-
fourcc = cv2.VideoWriter_fourcc(*"avc1") # Adjust the codec as needed
552+
fourcc = cv2.VideoWriter_fourcc(*"h264") # Adjust the codec as needed
553553

554554
out_videos = []
555555

@@ -667,8 +667,7 @@ def write_video(self, out_folder, video_file_path, out_name, events):
667667
)
668668
out.write(frame)
669669
offset += 1
670-
if current_frame == time_slice[1]:
671-
670+
if current_frame == time_slice[1]:
672671
out.release()
673672
break
674673

notebook/EPM_demo.ipynb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,21 @@
115115
"outputs": [],
116116
"source": [
117117
"from IPython.display import Markdown, display\n",
118+
"from IPython.display import Video\n",
118119
"def parse_result(amadeus, qa_message):\n",
119120
" display(Markdown(qa_message['chain_of_thought']))\n",
120121
" sandbox = amadeus.sandbox\n",
121122
" qa_message = sandbox.code_execution(qa_message)\n",
122123
" sandbox.render_qa_message(qa_message)\n",
123124
" print ('after executing the function')\n",
124125
" display(qa_message['meta_info'])\n",
125-
" print(qa_message['pose_video'])\n",
126+
" print (f'videos generated to {qa_message[\"out_videos\"]}')\n",
127+
" print ('Open it with media player if it does not properly display in the notebook')\n",
128+
" if qa_message['out_videos'] is not None:\n",
129+
" for video_path in qa_message['out_videos']:\n",
130+
"\n",
131+
" display(Video(video_path, embed=True))\n",
132+
"\n",
126133
" display(Markdown(str(qa_message['function_rets'])))"
127134
]
128135
},

notebook/Horse_demo.ipynb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,21 @@
115115
"outputs": [],
116116
"source": [
117117
"from IPython.display import Markdown, display\n",
118+
"from IPython.display import Video\n",
118119
"def parse_result(amadeus, qa_message):\n",
119120
" display(Markdown(qa_message['chain_of_thought']))\n",
120121
" sandbox = amadeus.sandbox\n",
121122
" qa_message = sandbox.code_execution(qa_message)\n",
122123
" sandbox.render_qa_message(qa_message)\n",
123124
" print ('after executing the function')\n",
124125
" display(qa_message['meta_info'])\n",
125-
" print(qa_message['pose_video'])\n",
126+
" print (f'videos generated to {qa_message[\"out_videos\"]}')\n",
127+
" print ('Open it with media player if it does not properly display in the notebook')\n",
128+
" if qa_message['out_videos'] is not None:\n",
129+
" for video_path in qa_message['out_videos']:\n",
130+
"\n",
131+
" display(Video(video_path, embed=True))\n",
132+
"\n",
126133
" display(Markdown(str(qa_message['function_rets'])))"
127134
]
128135
},

notebook/MABe_demo.ipynb

Lines changed: 187 additions & 64 deletions
Large diffs are not rendered by default.

notebook/MausHaus_demo.ipynb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,21 @@
119119
"outputs": [],
120120
"source": [
121121
"from IPython.display import Markdown, display\n",
122+
"from IPython.display import Video\n",
122123
"def parse_result(amadeus, qa_message):\n",
123124
" display(Markdown(qa_message['chain_of_thought']))\n",
124125
" sandbox = amadeus.sandbox\n",
125126
" qa_message = sandbox.code_execution(qa_message)\n",
126127
" sandbox.render_qa_message(qa_message)\n",
127128
" print ('after executing the function')\n",
128129
" display(qa_message['meta_info'])\n",
129-
" print(qa_message['pose_video'])\n",
130+
" print (f'videos generated to {qa_message[\"out_videos\"]}')\n",
131+
" print ('Open it with media player if it does not properly display in the notebook')\n",
132+
" if qa_message['out_videos'] is not None:\n",
133+
" for video_path in qa_message['out_videos']:\n",
134+
"\n",
135+
" display(Video(video_path, embed=True))\n",
136+
"\n",
130137
" display(Markdown(str(qa_message['function_rets'])))"
131138
]
132139
},

0 commit comments

Comments
 (0)