tracking_system_backend / api /dependencies.py
e1250's picture
feat: adding testing into docker and pre-commit
87aa1c0
raw
history blame contribute delete
499 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