config.yml
1.94 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
# Design Image Search Service Configuration
# Design 图像搜索服务配置文件
# Server Settings
server:
host: "127.0.0.1"
port: 5088
workers: 1
# Database Settings
database:
sqlite:
path: "./data/design_images.db"
mysql:
host: "${MYSQL_HOST:localhost}"
port: 3306
database: "${MYSQL_DB:saas_design}"
username: "${MYSQL_USER:root}"
password: "${MYSQL_PASSWORD}"
charset: "utf8mb4"
# FAISS Settings
faiss:
index_path: "./data/faiss_cnn.index"
mapping_path: "./data/faiss_id_mapping.pkl"
tombstone_path: "./data/faiss_tombstones.pkl"
vector_dim: 576 # MobileNetV3-Small output dimension
metric: "cosine" # cosine or L2
hnsw:
M: 32 # HNSW connections
efConstruction: 200 # Build-time search depth
efSearch: 400 # Search-time depth (dynamic)
# Feature Extraction
feature_extractor:
orb:
max_features: 1200 # ORB keypoints
cnn:
model: "mobilenet_v3_small"
input_size: [224, 224]
# Search Engine
search:
cnn_top_k: 5000 # CNN coarse recall
ransac_top_k: 100 # 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:
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:
- "*"