File size: 499 Bytes
22a85f1
 
 
efc36ce
22a85f1
 
 
efc36ce
22a85f1
 
 
efc36ce
22a85f1
 
 
efc36ce
22a85f1
87aa1c0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 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