config.yml
2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# Design Image Search Service Configuration
# Design 图像搜索服务配置文件
# Server Settings
server:
host: "0.0.0.0"
port: 5088
workers: 1
source:
type: "${IMAGE_SEARCH_SOURCE:mysql_design}"
filesystem:
sqlite_path: "./data/filesystem_images.db"
roots:
/data/etsy: Etsy
/data/video: 摄影新人测试目录
# Set the actual UNC server and share prefixes before enabling the file source.
unc_prefixes:
/data/etsy: '${NAS_ETSY_UNC}'
/data/video: '${NAS_VIDEO_UNC}'
interval_seconds: 14400
# night_window: [22, 6] # Optional overnight scheduling in container local time.
batch_size: 32
index_min_capacity: 1024
thumbnail_top_n: 20
jwt:
prod_secret: '${NAS_IMAGE_SEARCH_PROD_SECRET}'
daily_secret: '${NAS_IMAGE_SEARCH_DAILY_SECRET}'
subject: nas-image-search
search:
max_candidates: 2000
ransac_top_k: 500
ransac:
min_inliers: 8
reproj_threshold: 6.0
confidence: 0.95
video:
enabled: false
frame_cap: 8
# Database Settings
database:
sqlite:
path: "./data/design_images_v2.db"
mysql:
host: "${MYSQL_HOST:localhost}"
port: "${MYSQL_PORT:3306}"
database: "${MYSQL_DB:saas_design}"
username: "${MYSQL_USER:root}"
password: "${MYSQL_PASSWORD}"
charset: "utf8mb4"
# Feature Extraction
feature_extractor:
orb:
max_features: 1200 # ORB keypoints
cnn:
model: "mobilenet_v3_small"
input_size: [224, 224]
vector_dim: 1152
# Search Engine
search:
max_candidates: 200
max_concurrent: 2
ransac_top_k: 200 # RANSAC fine ranking
fusion_weights:
cnn: 0.2 # 20%
ransac: 0.8 # 80%
ransac:
min_inliers: 15
reproj_threshold: 4.0
confidence: 0.995
threads: 4
# Data Sync
sync:
eps_ids: [2]
overlap_seconds: 120
reconcile_hour: 18 # Container clock is UTC: 18:00 UTC = 02:00 Beijing time next day.
interval_seconds: 60 # Sync every minute
batch_size: 500 # Process 500 records per batch
image_download_timeout: 30 # seconds
image_cache_dir: "./data/design_images"
# JWT Settings
jwt:
secret: "${JWT_SECRET}"
algorithm: "HS256"
subject: "saas-item-service"
expires_hours: 1
# File Upload
upload:
max_file_size: 10485760 # 10MB in bytes
allowed_formats: ["jpg", "jpeg", "png"]
temp_dir: "./data/uploads"
# Logging
logging:
level: "INFO"
format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
file: "./logs/app.log"
max_bytes: 10485760 # 10MB
backup_count: 5
# CORS (if needed)
cors:
enabled: true
origins:
- "*" # Configure for production
methods:
- "POST"
- "GET"
headers:
- "*"