Syzygianinfern0 commited on
Commit
f53a21b
·
1 Parent(s): ef0c954
Files changed (1) hide show
  1. evaluate_demo.py +12 -10
evaluate_demo.py CHANGED
@@ -75,7 +75,7 @@ def generate_from_puls(prompt, mode_choice):
75
  "Object-Action Alignment": Mode.OBJECT_ACTION_ALIGNMENT,
76
  "Overall Consistency (default)": Mode.OVERALL_CONSISTENCY,
77
  "Object Existence": Mode.OBJECT_EXISTENCE,
78
- "Spatial Relationships": Mode.SPATIAL_RELATIONSHIP,
79
  }
80
 
81
  selected_mode = mode_map[mode_choice]
@@ -117,16 +117,13 @@ example_prompt = (
117
 
118
  with gr.Blocks(title="Video Evaluation with Temporal Logic") as demo:
119
  gr.Markdown("# Video Evaluation with Temporal Logic")
120
- # gr.Markdown(
121
- # "Upload a video and provide a natural language description. You can either manually enter propositions and temporal logic or generate them using PULS."
122
- # )
123
 
124
  with gr.Row():
125
  with gr.Column():
126
  video_input = gr.Video(label="Upload Video")
127
  prompt_input = gr.Textbox(
128
  label="Text-to-Video Prompt",
129
- # value=example_prompt,
130
  placeholder="Describe the video content in natural language...",
131
  )
132
  gr.Markdown(
@@ -139,10 +136,9 @@ with gr.Blocks(title="Video Evaluation with Temporal Logic") as demo:
139
  choices=[
140
  "Overall Consistency (default)",
141
  "Object Existence",
142
- "Spatial Relationships",
143
  "Object-Action Alignment",
144
  ],
145
- # value="Overall Consistency (default)",
146
  label="PULS Mode",
147
  visible=False,
148
  )
@@ -153,10 +149,16 @@ with gr.Blocks(title="Video Evaluation with Temporal Logic") as demo:
153
  label="Temporal Logic Specification", placeholder="(A & B) U C - means A and B hold until C occurs"
154
  )
155
 
156
- process_btn = gr.Button("Process Video")
157
 
158
  with gr.Column():
159
  output_score = gr.Textbox(label="NeuS-V Score")
 
 
 
 
 
 
160
 
161
  # Show/hide PULS controls based on checkbox
162
  use_puls_checkbox.change(
@@ -176,8 +178,8 @@ with gr.Blocks(title="Video Evaluation with Temporal Logic") as demo:
176
  # Examples
177
  gr.Examples(
178
  examples=[
179
- [example_video_path_1, example_prompt, "Overall Consistency", example_propositions, example_tl],
180
- [example_video_path_2, example_prompt, "Overall Consistency", example_propositions, example_tl],
181
  ],
182
  inputs=[video_input, prompt_input, mode_choice, propositions_input, tl_input],
183
  )
 
75
  "Object-Action Alignment": Mode.OBJECT_ACTION_ALIGNMENT,
76
  "Overall Consistency (default)": Mode.OVERALL_CONSISTENCY,
77
  "Object Existence": Mode.OBJECT_EXISTENCE,
78
+ "Spatial Relationship": Mode.SPATIAL_RELATIONSHIP,
79
  }
80
 
81
  selected_mode = mode_map[mode_choice]
 
117
 
118
  with gr.Blocks(title="Video Evaluation with Temporal Logic") as demo:
119
  gr.Markdown("# Video Evaluation with Temporal Logic")
120
+ gr.Markdown("Upload a video and provide a description to evaluate its content using temporal logic.")
 
 
121
 
122
  with gr.Row():
123
  with gr.Column():
124
  video_input = gr.Video(label="Upload Video")
125
  prompt_input = gr.Textbox(
126
  label="Text-to-Video Prompt",
 
127
  placeholder="Describe the video content in natural language...",
128
  )
129
  gr.Markdown(
 
136
  choices=[
137
  "Overall Consistency (default)",
138
  "Object Existence",
139
+ "Spatial Relationship",
140
  "Object-Action Alignment",
141
  ],
 
142
  label="PULS Mode",
143
  visible=False,
144
  )
 
149
  label="Temporal Logic Specification", placeholder="(A & B) U C - means A and B hold until C occurs"
150
  )
151
 
152
+ process_btn = gr.Button("Process Video", variant="primary")
153
 
154
  with gr.Column():
155
  output_score = gr.Textbox(label="NeuS-V Score")
156
+ gr.Markdown(
157
+ """
158
+ #### About the Score
159
+ The NeuS-V score (0-1) measures how well your video matches the specified temporal logic conditions. A higher score indicates better alignment with the expected sequence of events.
160
+ """
161
+ )
162
 
163
  # Show/hide PULS controls based on checkbox
164
  use_puls_checkbox.change(
 
178
  # Examples
179
  gr.Examples(
180
  examples=[
181
+ [example_video_path_1, example_prompt, "Overall Consistency (default)", example_propositions, example_tl],
182
+ [example_video_path_2, example_prompt, "Overall Consistency (default)", example_propositions, example_tl],
183
  ],
184
  inputs=[video_input, prompt_input, mode_choice, propositions_input, tl_input],
185
  )