Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions backend/routers/detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,11 +406,8 @@ async def detect_graffiti_endpoint(image: UploadFile = File(...)):

@router.post("/api/detect-traffic-sign")
async def detect_traffic_sign_endpoint(request: Request, image: UploadFile = File(...)):
try:
image_bytes = await image.read()
except Exception as e:
logger.error(f"Invalid image file: {e}", exc_info=True)
raise HTTPException(status_code=400, detail="Invalid image file")
# Optimized Image Processing: Validation + Optimization
_, image_bytes = await process_uploaded_image(image)

try:
client = get_http_client(request)
Expand All @@ -423,11 +420,8 @@ async def detect_traffic_sign_endpoint(request: Request, image: UploadFile = Fil

@router.post("/api/detect-abandoned-vehicle")
async def detect_abandoned_vehicle_endpoint(request: Request, image: UploadFile = File(...)):
try:
image_bytes = await image.read()
except Exception as e:
logger.error(f"Invalid image file: {e}", exc_info=True)
raise HTTPException(status_code=400, detail="Invalid image file")
# Optimized Image Processing: Validation + Optimization
_, image_bytes = await process_uploaded_image(image)

try:
client = get_http_client(request)
Expand Down
4 changes: 2 additions & 2 deletions render.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:
- type: web
name: vishwaguru-backend
runtime: python
buildCommand: "pip install -r backend/requirements-render.txt"
buildCommand: "./render-build.sh"
startCommand: "python start-backend.py"
envVars:
- key: PYTHON_VERSION
Expand All @@ -14,7 +14,7 @@ services:
name: vishwaguru-backend
property: port
- key: PYTHONPATH
value: backend
value: .
# Required API Keys (must be set in Render dashboard)
- key: GEMINI_API_KEY
sync: false
Expand Down