Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,7 +40,7 @@ CONFIG = {
|
|
| 40 |
|
| 41 |
# Setup logging
|
| 42 |
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")
|
| 43 |
-
logger = logging.getLogger(
|
| 44 |
|
| 45 |
# Ensure output directory exists
|
| 46 |
os.makedirs(CONFIG["OUTPUT_DIR"], exist_ok=True)
|
|
@@ -170,7 +170,7 @@ def push_report_to_salesforce(violations, score, pdf_path, pdf_file):
|
|
| 170 |
if pdf_file:
|
| 171 |
uploaded_url = upload_pdf_to_salesforce(sf, pdf_file, record_id)
|
| 172 |
if uploaded_url:
|
| 173 |
-
sf.
|
| 174 |
pdf_url = uploaded_url
|
| 175 |
|
| 176 |
return record_id, pdf_url
|
|
@@ -333,6 +333,6 @@ interface = gr.Interface(
|
|
| 333 |
description="Upload short site videos to detect safety violations (e.g., no helmet, no harness, unsafe posture)."
|
| 334 |
)
|
| 335 |
|
| 336 |
-
if
|
| 337 |
logger.info("Launching Safety Analyzer App...")
|
| 338 |
interface.launch()
|
|
|
|
| 40 |
|
| 41 |
# Setup logging
|
| 42 |
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")
|
| 43 |
+
logger = logging.getLogger(_name_)
|
| 44 |
|
| 45 |
# Ensure output directory exists
|
| 46 |
os.makedirs(CONFIG["OUTPUT_DIR"], exist_ok=True)
|
|
|
|
| 170 |
if pdf_file:
|
| 171 |
uploaded_url = upload_pdf_to_salesforce(sf, pdf_file, record_id)
|
| 172 |
if uploaded_url:
|
| 173 |
+
sf.Safety_Video_Report_c.update(record_id, {"PDF_Report_URL_c": uploaded_url})
|
| 174 |
pdf_url = uploaded_url
|
| 175 |
|
| 176 |
return record_id, pdf_url
|
|
|
|
| 333 |
description="Upload short site videos to detect safety violations (e.g., no helmet, no harness, unsafe posture)."
|
| 334 |
)
|
| 335 |
|
| 336 |
+
if _name_ == "_main_":
|
| 337 |
logger.info("Launching Safety Analyzer App...")
|
| 338 |
interface.launch()
|