VishalD1234 commited on
Commit
30f5c94
·
verified ·
1 Parent(s): 38f0768

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -10
app.py CHANGED
@@ -140,16 +140,24 @@ def predict(prompt, video_data, temperature, model, tokenizer):
140
 
141
  return response
142
 
143
- def get_analysis_prompt(step_number):
144
- """Constructs the prompt for analyzing manufacturing delays based on the selected step."""
145
- return f"""You are an AI expert system specializing in manufacturing processes.
146
- Your task is to analyze video footage from Step {step_number} of a tire manufacturing process and identify any issues based on the observed footage.
147
- - Focus on identifying signs of delay or disruption.
148
- - If no person is visible, it may indicate a staffing issue.
149
- - If a person is seen modifying the tire, they may be repairing defects or handling material issues.
150
- - Carefully examine for mechanical failures, material problems, or human involvement.
151
-
152
- Provide an analysis of the video by determining the most likely cause of delay in this step, and explain why this conclusion was reached based on the visual evidence."""
 
 
 
 
 
 
 
 
153
 
154
  model, tokenizer = load_model()
155
 
 
140
 
141
  return response
142
 
143
+ def get_analysis_prompt(step_number, possible_reasons):
144
+ """Constructs the prompt for analyzing delay reasons based on the selected step."""
145
+ 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.
146
+ Task Context:
147
+ 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:
148
+ {', '.join(possible_reasons)}
149
+ Required Analysis:
150
+ Carefully observe the video for visual cues indicating production interruption.
151
+ If no person is visible in any of the frames, the reason probably might be due to his absence.
152
+ 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.
153
+ Compare observed evidence against each possible delay reason.
154
+ Select the most likely reason based on visual evidence.
155
+ Please provide your analysis in the following format:
156
+ 1. Selected Reason: [State the most likely reason from the given options]
157
+ 2. Visual Evidence: [Describe specific visual cues that support your selection]
158
+ 3. Reasoning: [Explain why this reason best matches the observed evidence]
159
+ 4. Alternative Analysis: [Brief explanation of why other possible reasons are less likely]
160
+ 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."""
161
 
162
  model, tokenizer = load_model()
163