Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -111,44 +111,37 @@ def get_analysis_prompt(step_number, possible_reasons):
|
|
| 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
|
| 115 |
"""
|
| 116 |
return f"""
|
| 117 |
-
You are an advanced AI expert system specialized in analyzing manufacturing processes to diagnose production delays. Your task is to analyze video footage from Step {step_number} of a tire manufacturing process, where a delay has been identified. Based on
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
2. Visual Evidence: [Describe specific visual cues that support your selection]
|
| 140 |
-
3. Reasoning: [Explain why this reason best matches the observed evidence]
|
| 141 |
-
4. Alternative Analysis: [Brief explanation of why other possible reasons are less likely]
|
| 142 |
-
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.
|
| 143 |
-
|
| 144 |
-
Important:
|
| 145 |
-
- Base your analysis exclusively on observable evidence from the video.
|
| 146 |
-
- Avoid assumptions not supported by visual details.
|
| 147 |
- Clearly state if no conclusive evidence is found and recommend further investigation.
|
| 148 |
"""
|
| 149 |
|
| 150 |
|
| 151 |
|
|
|
|
| 152 |
# Load model globally
|
| 153 |
model, tokenizer = load_model()
|
| 154 |
|
|
|
|
| 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 robust analysis prompt tailored to the given step and reasons.
|
| 115 |
"""
|
| 116 |
return f"""
|
| 117 |
+
You are an advanced AI expert system specialized in analyzing manufacturing processes to diagnose production delays. Your task is to analyze video footage from Step {step_number} of a tire manufacturing process, where a delay has been identified. Based on visual evidence in the footage, determine the most accurate reason for the delay.
|
| 118 |
+
|
| 119 |
+
### Required Analysis:
|
| 120 |
+
1. Carefully observe the video for any signs of production interruptions or anomalies.
|
| 121 |
+
2. Compare observed evidence against the following potential delay reasons:
|
| 122 |
+
- If no technician or worker is visible in any frame, consider absence as a probable cause.
|
| 123 |
+
- If a technician is visible and interacting with materials, determine if:
|
| 124 |
+
- They are repairing an inner liner or sidewall, suggesting material damage or alignment issues.
|
| 125 |
+
- They are manually adjusting or repatching tire layers, indicating a procedural or equipment issue.
|
| 126 |
+
- Check for machine pauses, material misalignment, or missing components that could indicate equipment or process failures.
|
| 127 |
+
- Observe whether a technician is collecting or loading the carcass, as delays in this activity may signal inefficiencies or staffing issues.
|
| 128 |
+
|
| 129 |
+
### Output Requirements:
|
| 130 |
+
Provide your analysis in the following structured format:
|
| 131 |
+
1. **Selected Reason**: [State the most likely reason from the given options]
|
| 132 |
+
2. **Visual Evidence**: [Describe key observations from the video that support the selected reason]
|
| 133 |
+
3. **Reasoning**: [Explain why this reason aligns best with the observed evidence]
|
| 134 |
+
4. **Alternative Analysis**: [Briefly outline why other possible reasons are less likely]
|
| 135 |
+
|
| 136 |
+
### Important:
|
| 137 |
+
- Base your conclusions solely on observable evidence from the video.
|
| 138 |
+
- Focus on specific visual details rather than assumptions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
- Clearly state if no conclusive evidence is found and recommend further investigation.
|
| 140 |
"""
|
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
+
|
| 145 |
# Load model globally
|
| 146 |
model, tokenizer = load_model()
|
| 147 |
|