Skip to content

Commit bf819b8

Browse files
authored
Merge pull request #830 from luxonis/fix/focused-vision/offline
fix: focused-vision app to be able to run offline after app is built
2 parents 26e78fc + 843c596 commit bf819b8

4 files changed

Lines changed: 17 additions & 4 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
model: luxonis/scrfd-person-detection:25g-640x640
2+
platform: RVC4
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
model: luxonis/yunet:320x240
2+
platform: RVC4

apps/focused-vision/backend/src/main.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
from arguments import initialize_argparser
88
from depthai_nodes.node.extended_neural_network import ExtendedNeuralNetwork
99
from depthai_nodes.node.stage_2_neural_network import Stage2NeuralNetwork
10-
10+
import os
11+
from pathlib import Path
1112

1213
logger = logging.getLogger(__name__)
1314

@@ -17,8 +18,14 @@
1718
frame_type = dai.ImgFrame.Type.BGR888i
1819
HIGH_RES_WIDTH, HIGH_RES_HEIGHT = 2000, 2000
1920
LOW_RES_WIDTH, LOW_RES_HEIGHT = 640, 640
20-
PEOPLE_DETECTION_MODEL = "luxonis/scrfd-person-detection:25g-640x640"
21-
FACE_DETECTION_MODEL = "luxonis/yunet:320x240"
21+
SCRIPT_DIR = Path(os.path.dirname(os.path.abspath(__file__)))
22+
DEPTHAI_MODELS_DIR = SCRIPT_DIR / "depthai_models"
23+
PEOPLE_DETECTION_MODEL = dai.NNModelDescription.fromYamlFile(
24+
DEPTHAI_MODELS_DIR / "scrfd-person-detection.yaml"
25+
)
26+
FACE_DETECTION_MODEL = dai.NNModelDescription.fromYamlFile(
27+
DEPTHAI_MODELS_DIR / "yunet.yaml"
28+
)
2229
if not args.fps_limit:
2330
args.fps_limit = 13
2431

apps/focused-vision/oakapp.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ build_steps = [
1414
"chmod +x /etc/service/backend/run",
1515
]
1616

17+
depthai_models = { yaml_path = "./backend/src/depthai_models" }
18+
1719
[static_frontend]
1820
dist_path = "./frontend/dist"
1921

@@ -28,4 +30,4 @@ oauth_url = "https://auth.docker.io/token"
2830
auth_type = "repository"
2931
auth_name = "luxonis/oakapp-base"
3032
image_name = "luxonis/oakapp-base"
31-
image_tag = "1.2.6"
33+
image_tag = "1.2.6"

0 commit comments

Comments
 (0)