VishalD1234 commited on
Commit
59276a1
·
verified ·
1 Parent(s): f325eee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -42
app.py CHANGED
@@ -106,57 +106,33 @@ def predict(prompt, video_data, temperature, model, tokenizer):
106
 
107
  def get_analysis_prompt(step_number, possible_reasons):
108
  """
109
- Constructs the prompt for analyzing delay reasons based on the selected step.
110
  Args:
111
- step_number (int): The manufacturing step number being analyzed.
112
  possible_reasons (list): A list of possible delay reasons for this step.
113
  Returns:
114
- str: A detailed analysis prompt tailored to the given step and reasons.
115
  """
116
  return f"""
117
- You are a highly advanced AI expert system specialized in analyzing manufacturing processes to diagnose production delays. Your task is to review video footage from Step {step_number} of a tire manufacturing process, where a delay has been identified. Based on visual evidence, your objective is to determine the most accurate reason for the delay from the provided options.
118
-
119
- ### Task Context:
120
- - Manufacturing Step: {step_number}
121
- - Delay Detected: Yes
122
- - Possible Reasons for Delay: {', '.join(possible_reasons)}
123
 
124
  ### Required Analysis:
125
- Carefully observe the video footage frame by frame, focusing on the following key areas to determine the cause of the delay:
126
-
127
- 1. **Technician Presence and Activity:**
128
- - Verify whether a technician or worker is visible in the footage.
129
- - If no technician is observed, the delay may be due to their absence.
130
- - If a technician is visible, analyze their actions:
131
- - If they are collecting or loading a carcass, ensure the process is efficient and within standard time limits.
132
- - If they are observed repairing the inner liner or sidewall, this indicates material or application issues as the cause of the delay.
133
-
134
- 2. **Material or Process Anomalies:**
135
- - Look for visible defects, such as misaligned layers, improperly applied materials, or damaged components.
136
- - Check for any signs of manual intervention, such as a technician adjusting or repatching layers.
137
- - Identify issues with the machine operation, such as pauses, misfeeds, or alignment problems.
138
-
139
- 3. **Equipment Functionality:**
140
- - Detect if machinery is operating below standard speed, stopping unexpectedly, or failing to perform its task (e.g., applying materials, stitching).
141
-
142
- 4. **Process-Specific Observations:**
143
- - Determine if the technician is waiting for materials, which may indicate supply chain interruptions.
144
- - Check for excessive manual handling, which could signal inadequate automation or equipment failure.
145
 
146
  ### Output Requirements:
147
- Provide your analysis in the following structured format:
148
- 1. **Selected Reason**: [Clearly state the most likely reason for the delay from the given options.]
149
- 2. **Visual Evidence**: [Detail specific observations that support your conclusion, such as technician actions, material issues, or machine behavior.]
150
- 3. **Reasoning**: [Explain why this reason is most consistent with the evidence. Include links between specific observations and the identified delay reason.]
151
- 4. **Alternative Analysis**: [Summarize why other possible reasons are less likely, referencing specific observations or lack of evidence.]
152
- 5. **Recommendations**: [Provide actionable suggestions to resolve the delay cause, such as adjustments to machinery, improved training, or material quality checks.]
153
-
154
- ### Important Considerations:
155
- - Base your analysis strictly on observable evidence from the video.
156
- - Do not make assumptions not supported by visual data.
157
- - If the evidence is inconclusive, state this explicitly and suggest further investigative actions.
158
-
159
- Note: Pay particular attention to technician interactions with the inner liner repairing, sidewall repairing, and carcass handling, as these are critical indicators of delay causes.
160
  """
161
 
162
 
 
106
 
107
  def get_analysis_prompt(step_number, possible_reasons):
108
  """
109
+ Constructs a concise and robust prompt for analyzing delay reasons based on the selected manufacturing step.
110
  Args:
111
+ step_number (int): The manufacturing step being analyzed.
112
  possible_reasons (list): A list of possible delay reasons for this step.
113
  Returns:
114
+ str: A tailored analysis prompt.
115
  """
116
  return f"""
117
+ You are an advanced AI system specializing in analyzing manufacturing processes. Your task is to review video footage from Step {step_number} of a tire manufacturing process and determine the cause of an observed delay.
 
 
 
 
 
118
 
119
  ### Required Analysis:
120
+ 1. Carefully observe the video to identify any visual cues indicating a delay.
121
+ 2. If no technician is visible, absence might be the cause.
122
+ 3. If a technician is present, analyze their actions:
123
+ - Are they handling or loading carcasses efficiently?
124
+ - Are they repairing the inner liner or sidewall?
125
+ - Are they adjusting components or fixing alignment issues?
126
+ 4. Look for signs of material misalignment, damage, or excessive manual handling.
127
+ 5. Identify any machine pauses, malfunctions, or inconsistencies in operation.
 
 
 
 
 
 
 
 
 
 
 
 
128
 
129
  ### Output Requirements:
130
+ - **Selected Reason**: State the most likely delay cause.
131
+ - **Visual Evidence**: Describe specific observations supporting your conclusion.
132
+ - **Reasoning**: Explain why this reason aligns with the evidence.
133
+ - **Alternative Analysis**: Briefly note why other reasons are less likely.
134
+
135
+ Focus on visual evidence and avoid assumptions not supported by the footage.
 
 
 
 
 
 
 
136
  """
137
 
138