Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -193,40 +193,30 @@ def get_analysis_prompt(step_number):
|
|
193 |
|
194 |
step_name = step_info["Name"]
|
195 |
standard_time = step_info["Standard Time"]
|
196 |
-
|
|
|
197 |
|
|
|
|
|
|
|
198 |
return f"""
|
199 |
-
You are an AI expert system
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
- If no person is visible in any of the frames, the reason probably might be due to their absence.
|
205 |
-
- 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.
|
206 |
-
- Compare observed evidence against the following possible delay reasons:
|
207 |
-
- {analysis}
|
208 |
-
Following are the subactivities needs to happen in this step.
|
209 |
|
210 |
-
|
|
|
211 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
212 |
|
213 |
-
Please provide your output in the following format:
|
214 |
-
Output_Examples = {
|
215 |
-
["Delay in Bead Insertion", "Lack of raw material"],
|
216 |
-
["Inner Liner Adjustment by Technician", "Person rebuilding defective Tire Sections"],
|
217 |
-
["Manual Adjustment in Ply1 Apply", "Technician repairing defective Tire Sections"],
|
218 |
-
["Delay in Bead Set", "Lack of raw material"],
|
219 |
-
["Delay in Turnup", "Lack of raw material"],
|
220 |
-
["Person Repairing Sidewall", "Person rebuilding defective Tire Sections"],
|
221 |
-
["Delay in Sidewall Stitching", "Lack of raw material"],
|
222 |
-
["No person available to load Carcass", "No person available to collect tire"]
|
223 |
-
}
|
224 |
-
1. **Selected Reason:** [State the most likely reason from the given options]
|
225 |
-
2. **Visual Evidence:** [Describe specific visual cues that support your selection]
|
226 |
-
3. **Reasoning:** [Explain why this reason best matches the observed evidence]
|
227 |
-
4. **Alternative Analysis:** [Brief explanation of why other possible reasons are less likely]
|
228 |
-
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.
|
229 |
-
"""
|
230 |
|
231 |
|
232 |
|
|
|
193 |
|
194 |
step_name = step_info["Name"]
|
195 |
standard_time = step_info["Standard Time"]
|
196 |
+
substeps = step_info["Video_substeps_expected"]
|
197 |
+
delay_reasons = DELAY_REASONS.get(f"Step {step_number}", ["No specific reasons provided."])
|
198 |
|
199 |
+
substeps_text = "\n".join([f"- {time}: {action}" for time, action in substeps.items()])
|
200 |
+
reasons_text = "\n".join([f"- {reason}" for reason in delay_reasons])
|
201 |
+
|
202 |
return f"""
|
203 |
+
You are an AI expert system analyzing manufacturing delays in tire production. Below are the details:
|
204 |
+
Step: {step_number} - {step_name}
|
205 |
+
Standard Time: {standard_time}
|
206 |
+
Substeps Expected in Video:
|
207 |
+
{substeps_text}
|
|
|
|
|
|
|
|
|
|
|
208 |
|
209 |
+
Potential Delay Reasons:
|
210 |
+
{reasons_text}
|
211 |
|
212 |
+
Task: Analyze the provided video to identify the delay reason. Use the following format:
|
213 |
+
1. **Selected Reason:** [Choose the most likely reason from the list above]
|
214 |
+
2. **Visual Evidence:** [Describe specific visual cues from the video]
|
215 |
+
3. **Reasoning:** [Explain why the selected reason fits the observed evidence]
|
216 |
+
4. **Alternative Reasons:** [Briefly explain why other reasons are less likely]
|
217 |
+
|
218 |
+
Important: Focus only on observable details in the video. If no delay is evident, state 'No delay observed.'"""
|
219 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
|
221 |
|
222 |
|