tracking_system_backend / api /dependencies.py
e1250's picture
feat: Add redis to backend
22a85f1
Raw
History Blame
494 Bytes
# Here exists function to use instead of using app.state directly in the main.py
from fastapi.requests import HTTPConnection
def get_detection_model(request: HTTPConnection):
return request.app.state.detection_model
def get_depth_model(request: HTTPConnection):
return request.app.state.depth_model
def get_safety_detection_model(request: HTTPConnection):
return request.app.state.safety_detection_model
def get_redis(request: HTTPConnection):
return request.app.state.redis