VishalD1234 commited on
Commit
18d2d1a
·
verified ·
1 Parent(s): 72b5ab6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +36 -29
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
- analysis = step_info["Analysis"]
232
-
 
 
 
 
 
 
 
233
  return f"""
234
- 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.
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
- {get_step_info(step_number)}
 
 
 
246
 
247
- Please provide your output in the following format:
248
- Output_Examples = {
249
- ["Delay in Bead Insertion", "Lack of raw material"],
250
- ["Inner Liner Adjustment by Technician", "Person rebuilding defective Tire Sections"],
251
- ["Manual Adjustment in Ply1 Apply", "Technician repairing defective Tire Sections"],
252
- ["Delay in Bead Set", "Lack of raw material"],
253
- ["Delay in Turnup", "Lack of raw material"],
254
- ["Person Repairing Sidewall", "Person rebuilding defective Tire Sections"],
255
- ["Delay in Sidewall Stitching", "Lack of raw material"],
256
- ["No person available to load Carcass", "No person available to collect tire"]
257
- }
258
- 1. **Selected Reason:** [State the most likely reason from the given options]
259
- 2. **Visual Evidence:** [Describe specific visual cues that support your selection]
260
- 3. **Reasoning:** [Explain why this reason best matches the observed evidence]
261
- 4. **Alternative Analysis:** [Brief explanation of why other possible reasons are less likely]
262
- 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.
 
 
 
 
 
 
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