Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -142,21 +142,33 @@ def predict(prompt, video_data, temperature, model, tokenizer):
|
|
142 |
|
143 |
def get_analysis_prompt(step_number):
|
144 |
"""Constructs the prompt for analyzing delay reasons based on the selected step."""
|
145 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
Task Context:
|
147 |
-
You are analyzing video footage from Step {step_number} of a tire manufacturing process where a delay has been detected.
|
148 |
Required Analysis:
|
149 |
-
|
150 |
-
If no person is visible in any of the frames, the reason probably might be due to
|
151 |
-
If a person is visible in the video and is observed touching and modifying the layers of the tire, it
|
152 |
-
Compare observed evidence against
|
153 |
-
|
|
|
154 |
Please provide your analysis in the following format:
|
155 |
1. Selected Reason: [State the most likely reason from the given options]
|
156 |
2. Visual Evidence: [Describe specific visual cues that support your selection]
|
157 |
3. Reasoning: [Explain why this reason best matches the observed evidence]
|
158 |
4. Alternative Analysis: [Brief explanation of why other possible reasons are less likely]
|
159 |
-
Important: Base your analysis solely on visual evidence from the video. Focus on concrete, observable details rather than assumptions. Clearly state if no person or specific activity is observed.
|
|
|
160 |
|
161 |
model, tokenizer = load_model()
|
162 |
|
|
|
142 |
|
143 |
def get_analysis_prompt(step_number):
|
144 |
"""Constructs the prompt for analyzing delay reasons based on the selected step."""
|
145 |
+
step_info = get_step_info(step_number)
|
146 |
+
|
147 |
+
if "Error" in step_info:
|
148 |
+
return step_info["Error"]
|
149 |
+
|
150 |
+
step_name = step_info["Name"]
|
151 |
+
standard_time = step_info["Standard Time"]
|
152 |
+
analysis = step_info["Analysis"]
|
153 |
+
|
154 |
+
return f"""
|
155 |
+
You are an AI expert system specialized in analyzing manufacturing processes and identifying production delays in tire manufacturing. Your role is to accurately classify delay reasons based on visual evidence from production line footage.
|
156 |
Task Context:
|
157 |
+
You are analyzing video footage from Step {step_number} of a tire manufacturing process where a delay has been detected. The step is called {step_name}, and its standard time is {standard_time}.
|
158 |
Required Analysis:
|
159 |
+
Carefully observe the video for visual cues indicating production interruption.
|
160 |
+
- If no person is visible in any of the frames, the reason probably might be due to their absence.
|
161 |
+
- If a person is visible in the video and is observed touching and modifying the layers of the tire, it indicates an issue with tire patching, and the person might be repairing it.
|
162 |
+
- Compare observed evidence against the following possible delay reason:
|
163 |
+
- {analysis}
|
164 |
+
|
165 |
Please provide your analysis in the following format:
|
166 |
1. Selected Reason: [State the most likely reason from the given options]
|
167 |
2. Visual Evidence: [Describe specific visual cues that support your selection]
|
168 |
3. Reasoning: [Explain why this reason best matches the observed evidence]
|
169 |
4. Alternative Analysis: [Brief explanation of why other possible reasons are less likely]
|
170 |
+
Important: Base your analysis solely on visual evidence from the video. Focus on concrete, observable details rather than assumptions. Clearly state if no person or specific activity is observed.
|
171 |
+
"""
|
172 |
|
173 |
model, tokenizer = load_model()
|
174 |
|