adiv07 commited on
Commit
91b6d49
·
verified ·
1 Parent(s): b143466

Update Gpt4oDemo.py

Browse files
Files changed (1) hide show
  1. Gpt4oDemo.py +19 -20
Gpt4oDemo.py CHANGED
@@ -139,31 +139,30 @@ def process_video(video_path, seconds_per_frame=2, target_width=320, target_heig
139
  clip.audio.write_audiofile(audio_path, bitrate="32k")
140
  clip.audio.close()
141
  clip.close()
142
- #transcribe_video(audio_path)
143
  print(f"Extracted {len(base64Frames)} frames")
144
  print(f"Extracted audio to {audio_path}")
145
  return base64Frames, audio_path
146
 
147
  chat_history = []
148
- # chat_history.append({
149
- # "role": "system",
150
- # "content": (
151
- # """
152
- # You are an assistant chatbot for a Speech Language Pathologist (SLP).
153
- # Your task is to help analyze a provided video of a therapy session and answer questions accurately.
154
- # Provide timestamps for specific events or behaviors mentioned. Conclude each response with possible follow-up questions.
155
-
156
- # Follow these steps:
157
-
158
- # 1. Suggest to the user to ask, “To get started, you can try asking me how many people there are in the video.”
159
- # 2. Detect how many people are in the video.
160
- # 2. Suggest to the user to tell you the names of the people in the video, starting from left to right.
161
- # 3. After receiving the names, respond with, “Ok thank you! Now you can ask me any questions about this video.”
162
- # 4. If the user asks about a behavior, respond with, “My understanding of this behavior is [xxx - AI generated output]. Is this a behavior that you want to track? If it is, please define this behavior and tell me more about it so I can analyze it more accurately according to your practice.”
163
- # 5. If you receive names, confirm that these are the names of the people from left to right.
164
- # """
165
- # )
166
- # })
167
 
168
  def transcribe_video(filename):
169
  global transcript
 
139
  clip.audio.write_audiofile(audio_path, bitrate="32k")
140
  clip.audio.close()
141
  clip.close()
142
+ transcribe_video(audio_path)
143
  print(f"Extracted {len(base64Frames)} frames")
144
  print(f"Extracted audio to {audio_path}")
145
  return base64Frames, audio_path
146
 
147
  chat_history = []
148
+ chat_history.append({
149
+ "role": "system",
150
+ "content": (
151
+ """
152
+ You are an assistant chatbot for a Speech Language Pathologist (SLP).
153
+ Your task is to help analyze a provided video of a therapy session and answer questions accurately.
154
+ Provide timestamps in MM:SS format as frames are given at 1 fps for specific events or behaviors mentioned.
155
+
156
+ Analyse the video for IRB based on information below: Initiating Behavioral Request (IBR): the child's skill in using behavior(s) to elicit aid in obtaining an object, or object related event
157
+
158
+ Instances of IBR:
159
+ -Language: Listen for intelligible single words or greater verbal expressions the child uses to request an object or assistance.
160
+ -React:Observe if the child extends their arm with an open palm towards the object or the adult. Do not consider grabbing as a --requesting gesture.
161
+ -Point: Look for the child pointing at the object or direction where the object is located.
162
+ -Give: Watch if the child hands a toy or object to the adult to request help.
163
+ """
164
+ )
165
+ })
 
166
 
167
  def transcribe_video(filename):
168
  global transcript