capradeepgujaran
commited on
Commit
•
b6eb3bf
1
Parent(s):
1f0ad8d
Update app.py
Browse files
app.py
CHANGED
@@ -78,10 +78,9 @@ def analyze_construction_image(images=None, video=None):
|
|
78 |
results = []
|
79 |
|
80 |
instruction = ("You are an AI assistant specialized in analyzing images for safety issues. "
|
81 |
-
"Your task is to
|
82 |
-
"If it does, identify any safety issues or hazards, categorize them, provide a detailed description, "
|
83 |
-
"and suggest steps to resolve them. If it's not a construction site, simply state that
|
84 |
-
"briefly describe what you see in the image.")
|
85 |
|
86 |
if images:
|
87 |
for i, image_file in enumerate(images):
|
@@ -127,7 +126,7 @@ def analyze_construction_image(images=None, video=None):
|
|
127 |
"content": [
|
128 |
{
|
129 |
"type": "text",
|
130 |
-
"text": f"{instruction}\n\nAnalyze this frame from a video (Frame {i+1}/{len(frames)}). First, determine if it's a construction site. If it is, explain what you observe, focusing on safety aspects. If it's not, briefly describe what you see."
|
131 |
},
|
132 |
{
|
133 |
"type": "image_url",
|
|
|
78 |
results = []
|
79 |
|
80 |
instruction = ("You are an AI assistant specialized in analyzing images for safety issues. "
|
81 |
+
"Your task is first to explain what you see in the image and determine if the image shows a construction site. "
|
82 |
+
"If it does, identify any safety issues or hazards, categorize them, and provide a detailed description, "
|
83 |
+
"and suggest steps to resolve them. If it's not a construction site, simply state that")
|
|
|
84 |
|
85 |
if images:
|
86 |
for i, image_file in enumerate(images):
|
|
|
126 |
"content": [
|
127 |
{
|
128 |
"type": "text",
|
129 |
+
"text": f"{instruction}\n\nAnalyze this frame from a video (Frame {i+1}/{len(frames)}). First, explain the video and then determine if it's a construction site. If it is, explain what you observe, focusing on safety aspects. If it's not, briefly describe what you see."
|
130 |
},
|
131 |
{
|
132 |
"type": "image_url",
|