tomerk commited on
Commit
3fb14d4
·
verified ·
1 Parent(s): 16586be

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -106,7 +106,7 @@ def check_condition(prompt, base64Frames):
106
  messages = [
107
  {"role": "system", "content": """You are analyzing video frames to check if the user's condition is met.
108
  Please respond with a JSON object in the following format:
109
- {"condition_met": true/false, "details": "optional details or summary"}"""},
110
  {"role": "user", "content": [prompt, *map(lambda x: {"type": "image_url", "image_url": {"url": f'data:image/jpg;base64,{x}', "detail": "low"}}, base64Frames)]}
111
  ]
112
  response = client.chat.completions.create(
@@ -172,7 +172,7 @@ def process_clip_from_file(prompt, frames, chatbot, fps, video_path, id):
172
  # video_clip_path = encode_to_video_fast(frames, fps)
173
  video_clip_path = clip_video_segment(video_path, id*LENGTH, LENGTH)
174
  chatbot.append(((video_clip_path,), None))
175
- chatbot.append((f"Time: {start_time}\nDetails: {api_response.get('details', '')}", None))
176
 
177
  return chatbot
178
 
 
106
  messages = [
107
  {"role": "system", "content": """You are analyzing video frames to check if the user's condition is met.
108
  Please respond with a JSON object in the following format:
109
+ {"condition_met": true/false, "details": "optional details or summary. in the summary make sure to not use the words frames or images"}"""},
110
  {"role": "user", "content": [prompt, *map(lambda x: {"type": "image_url", "image_url": {"url": f'data:image/jpg;base64,{x}', "detail": "low"}}, base64Frames)]}
111
  ]
112
  response = client.chat.completions.create(
 
172
  # video_clip_path = encode_to_video_fast(frames, fps)
173
  video_clip_path = clip_video_segment(video_path, id*LENGTH, LENGTH)
174
  chatbot.append(((video_clip_path,), None))
175
+ chatbot.append((f"Event ID: {id+1}\nDetails: {api_response.get('details', '')}", None))
176
 
177
  return chatbot
178