Skip to content

Commit 03cf632

Browse files
rohan-pandeyyrahulharpal1603
authored andcommitted
feat(frontend): refine onboarding step & update model exports path
1 parent 24dc55e commit 03cf632

8 files changed

Lines changed: 654 additions & 54 deletions

File tree

backend/app/config/settings.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
from platformdirs import user_data_dir
21
import os
2+
import sys
3+
4+
from platformdirs import user_data_dir
35

4-
# Model Exports Path
5-
MODEL_EXPORTS_PATH = "app/models/ONNX_Exports"
6+
if getattr(sys, "frozen", False):
7+
MODEL_EXPORTS_PATH = os.path.join(user_data_dir("PictoPy"), "models")
8+
else:
9+
MODEL_EXPORTS_PATH = os.path.normpath(
10+
os.path.join(os.path.dirname(__file__), "..", "models", "ONNX_Exports")
11+
)
612

713
# Microservice URLs
814
SYNC_MICROSERVICE_URL = "http://localhost:52124"

backend/app/routes/folders.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
image_util_process_folder_images,
4343
image_util_process_untagged_images,
4444
)
45+
from app.utils.model_bootstrap import ensure_ai_tagging_models
4546
from app.utils.face_clusters import cluster_util_face_clusters_sync
4647
from app.utils.API import API_util_restart_sync_microservice_watcher
4748

@@ -88,6 +89,7 @@ def post_AI_tagging_enabled_sequence():
8889
It processes untagged images in the database.
8990
"""
9091
try:
92+
ensure_ai_tagging_models()
9193
image_util_process_untagged_images()
9294
cluster_util_face_clusters_sync()
9395
except Exception as e:

0 commit comments

Comments
 (0)