Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from fastapi import FastAPI, File, UploadFile, HTTPException
|
| 2 |
from contextlib import asynccontextmanager
|
| 3 |
import torch
|
|
@@ -6,7 +11,6 @@ import cv2
|
|
| 6 |
import requests
|
| 7 |
import json
|
| 8 |
import time
|
| 9 |
-
import os
|
| 10 |
import numpy as np
|
| 11 |
from pathlib import Path
|
| 12 |
from datetime import datetime
|
|
@@ -17,8 +21,8 @@ import pandas as pd
|
|
| 17 |
logging.basicConfig(level=logging.INFO)
|
| 18 |
logger = logging.getLogger(__name__)
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
|
| 22 |
|
| 23 |
RTSP_URL = os.getenv("RTSP_URL", "rtsp://localhost:8554/stream")
|
| 24 |
SALESFORCE_URL = os.getenv("SALESFORCE_URL", "https://your_salesforce_instance_url")
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
|
| 3 |
+
# Set YOLO_CONFIG_DIR before any Ultralytics imports
|
| 4 |
+
os.environ["YOLO_CONFIG_DIR"] = "/tmp"
|
| 5 |
+
|
| 6 |
from fastapi import FastAPI, File, UploadFile, HTTPException
|
| 7 |
from contextlib import asynccontextmanager
|
| 8 |
import torch
|
|
|
|
| 11 |
import requests
|
| 12 |
import json
|
| 13 |
import time
|
|
|
|
| 14 |
import numpy as np
|
| 15 |
from pathlib import Path
|
| 16 |
from datetime import datetime
|
|
|
|
| 21 |
logging.basicConfig(level=logging.INFO)
|
| 22 |
logger = logging.getLogger(__name__)
|
| 23 |
|
| 24 |
+
# Log environment variable for debugging
|
| 25 |
+
logger.info(f"YOLO_CONFIG_DIR set to: {os.getenv('YOLO_CONFIG_DIR')}")
|
| 26 |
|
| 27 |
RTSP_URL = os.getenv("RTSP_URL", "rtsp://localhost:8554/stream")
|
| 28 |
SALESFORCE_URL = os.getenv("SALESFORCE_URL", "https://your_salesforce_instance_url")
|