config.yml 1.73 KB
# Design Image Search Service Configuration
# Design 图像搜索服务配置文件

# Server Settings
server:
  host: "0.0.0.0"
  port: 5088
  workers: 1

# 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:
    - "*"