Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -228,38 +228,45 @@ def get_analysis_prompt(step_number):
|
|
228 |
|
229 |
step_name = step_info["Name"]
|
230 |
standard_time = step_info["Standard Time"]
|
231 |
-
|
232 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
233 |
return f"""
|
234 |
-
You are an AI expert system specialized in analyzing manufacturing processes and identifying production delays in tire manufacturing. Your
|
235 |
-
Task Context:
|
236 |
-
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}.
|
237 |
-
Required Analysis:
|
238 |
-
Carefully observe the video for visual cues indicating production interruption.
|
239 |
-
- If no person is visible in any of the frames, the reason probably might be due to their absence.
|
240 |
-
- 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.
|
241 |
-
- Compare observed evidence against the following possible delay reasons:
|
242 |
-
- {analysis}
|
243 |
-
Following are the subactivities needs to happen in this step.
|
244 |
|
245 |
-
|
|
|
|
|
|
|
246 |
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
263 |
"""
|
264 |
|
265 |
|
|
|
228 |
|
229 |
step_name = step_info["Name"]
|
230 |
standard_time = step_info["Standard Time"]
|
231 |
+
video_substeps = step_info["Video_substeps_expected"]
|
232 |
+
potential_delay_reasons = step_info["Potential_Delay_Reasons"]
|
233 |
+
|
234 |
+
# Format substeps for the prompt
|
235 |
+
substeps_text = "\n".join([f" {time}: {description}" for time, description in video_substeps.items()])
|
236 |
+
|
237 |
+
# Format potential delay reasons
|
238 |
+
potential_reasons_text = "\n - ".join(potential_delay_reasons)
|
239 |
+
|
240 |
return f"""
|
241 |
+
You are an AI expert system specialized in analyzing manufacturing processes and identifying production delays in tire manufacturing. Your task is to accurately determine the specific delay reason based on video analysis.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
242 |
|
243 |
+
### Step Information:
|
244 |
+
- **Step Number**: {step_number}
|
245 |
+
- **Step Name**: {step_name}
|
246 |
+
- **Standard Time**: {standard_time}
|
247 |
|
248 |
+
### Expected Video Substeps:
|
249 |
+
{substeps_text}
|
250 |
+
|
251 |
+
### Potential Delay Reasons:
|
252 |
+
- {potential_reasons_text}
|
253 |
+
|
254 |
+
### Task:
|
255 |
+
Carefully analyze the video footage for visual cues indicating production interruptions. Follow these guidelines:
|
256 |
+
1. If no person is visible in the frames, the delay might be due to their absence.
|
257 |
+
2. If a person is visible modifying or adjusting materials, consider related delay reasons.
|
258 |
+
3. Base your decision on observable evidence and match it to the listed potential delay reasons.
|
259 |
+
|
260 |
+
### Required Output Format:
|
261 |
+
Please respond with the most likely delay reason based on the analysis in the following format:
|
262 |
+
|
263 |
+
**Output**:
|
264 |
+
- **Selected Delay Reason**: [State the most probable delay reason]
|
265 |
+
- **Visual Evidence**: [Describe specific observations from the video that support your decision]
|
266 |
+
- **Reasoning**: [Explain why this delay reason best matches the observed evidence]
|
267 |
+
- **Alternative Analysis**: [Briefly explain why other reasons are less likely]
|
268 |
+
|
269 |
+
Important: Ensure your analysis is grounded in visual observations, avoiding assumptions. Provide a clear explanation if no relevant evidence is observed.
|
270 |
"""
|
271 |
|
272 |
|