config.yml 1.94 KB
# 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:
    - "*"