Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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
|
| 110 |
Args:
|
| 111 |
-
step_number (int): The manufacturing step
|
| 112 |
possible_reasons (list): A list of possible delay reasons for this step.
|
| 113 |
Returns:
|
| 114 |
-
str: A
|
| 115 |
"""
|
| 116 |
return f"""
|
| 117 |
-
You are
|
| 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
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 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 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 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 |
|