capradeepgujaran
commited on
Commit
•
b2dfc0b
1
Parent(s):
46f4ca8
Update app.py
Browse files
app.py
CHANGED
@@ -58,43 +58,40 @@ def create_monitor_interface():
|
|
58 |
completion = self.client.chat.completions.create(
|
59 |
model=self.model_name,
|
60 |
messages=[
|
61 |
-
{
|
62 |
-
"role": "system",
|
63 |
-
"content": """You are a comprehensive safety analysis system. Analyze images for ALL types of safety concerns including but not limited to:
|
64 |
-
- Personal Protective Equipment (PPE)
|
65 |
-
- Ergonomic issues
|
66 |
-
- Fire and electrical hazards
|
67 |
-
- Chemical and environmental hazards
|
68 |
-
- Machine and equipment safety
|
69 |
-
- Fall protection and working at heights
|
70 |
-
- Material handling and storage
|
71 |
-
- Emergency access and exits
|
72 |
-
- Housekeeping and organization
|
73 |
-
- Lighting and visibility
|
74 |
-
- Ventilation and air quality
|
75 |
-
- Tool safety and maintenance"""
|
76 |
-
},
|
77 |
{
|
78 |
"role": "user",
|
79 |
"content": [
|
80 |
{
|
81 |
"type": "text",
|
82 |
-
"text": """
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
|
|
88 |
|
89 |
-
Format each observation as:
|
90 |
-
- <location>position:safety issue description</location>
|
91 |
|
92 |
-
Example
|
93 |
- <location>top-right:Exposed electrical wiring creating shock hazard</location>
|
94 |
-
- <location>bottom-left:Improperly stored chemicals without
|
95 |
-
- <location>center:Missing machine guarding on rotating equipment</location>
|
96 |
|
97 |
-
|
98 |
},
|
99 |
{
|
100 |
"type": "image_url",
|
@@ -105,7 +102,7 @@ def create_monitor_interface():
|
|
105 |
]
|
106 |
}
|
107 |
],
|
108 |
-
temperature=0.7,
|
109 |
max_tokens=500,
|
110 |
stream=False
|
111 |
)
|
|
|
58 |
completion = self.client.chat.completions.create(
|
59 |
model=self.model_name,
|
60 |
messages=[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
{
|
62 |
"role": "user",
|
63 |
"content": [
|
64 |
{
|
65 |
"type": "text",
|
66 |
+
"text": """As a comprehensive safety expert, analyze this image for ALL potential safety concerns and hazards, including:
|
67 |
+
|
68 |
+
- Personal Protective Equipment (PPE)
|
69 |
+
- Ergonomic issues and posture
|
70 |
+
- Fire and electrical hazards
|
71 |
+
- Chemical and environmental hazards
|
72 |
+
- Machine and equipment safety
|
73 |
+
- Fall protection and heights
|
74 |
+
- Material handling and storage
|
75 |
+
- Emergency access and exits
|
76 |
+
- Housekeeping and organization
|
77 |
+
- Lighting and visibility
|
78 |
+
- Ventilation and air quality
|
79 |
+
- Tool safety and maintenance
|
80 |
|
81 |
+
For each safety issue identified, provide:
|
82 |
+
1. Exact location in the image (be specific: top-left, center-right, bottom, etc.)
|
83 |
+
2. Type of safety concern
|
84 |
+
3. Potential risk or hazard
|
85 |
+
4. Relevant safety violation
|
86 |
|
87 |
+
Format each observation exactly as:
|
88 |
+
- <location>position:detailed safety issue description</location>
|
89 |
|
90 |
+
Example:
|
91 |
- <location>top-right:Exposed electrical wiring creating shock hazard</location>
|
92 |
+
- <location>bottom-left:Improperly stored chemicals without labeling</location>
|
|
|
93 |
|
94 |
+
Identify ALL safety issues, not just the obvious ones."""
|
95 |
},
|
96 |
{
|
97 |
"type": "image_url",
|
|
|
102 |
]
|
103 |
}
|
104 |
],
|
105 |
+
temperature=0.7,
|
106 |
max_tokens=500,
|
107 |
stream=False
|
108 |
)
|