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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -31
app.py CHANGED
@@ -105,37 +105,23 @@ def predict(prompt, video_data, temperature, model, tokenizer):
105
  return response
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
-
139
 
140
 
141
  # Load model globally
 
105
  return response
106
 
107
  def get_analysis_prompt(step_number, possible_reasons):
108
+ """Constructs the prompt for analyzing delay reasons based on the selected step."""
109
+ return f"""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.
110
+ Task Context:
111
+ You are analyzing video footage from Step {step_number} of a tire manufacturing process where a delay has been detected. Your task is to determine the most likely cause of the delay from the following possible reasons:
112
+ {', '.join(possible_reasons)}
113
+ Required Analysis:
114
+ Carefully observe the video for visual cues indicating production interruption.
115
+ If no person is visible in any of the frames, the reason probably might be due to his absence.
116
+ If a person is visible in the video and is observed touching and modifying the layers of the tire, it means there is a issue with tyre being patched hence he is repairing it.
117
+ Compare observed evidence against each possible delay reason.
118
+ Select the most likely reason based on visual evidence.
119
+ Please provide your analysis in the following format:
120
+ 1. Selected Reason: [State the most likely reason from the given options]
121
+ 2. Visual Evidence: [Describe specific visual cues that support your selection]
122
+ 3. Reasoning: [Explain why this reason best matches the observed evidence]
123
+ 4. Alternative Analysis: [Brief explanation of why other possible reasons are less likely]
124
+ 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."""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
 
126
 
127
  # Load model globally