feat(vision): #2200 V2图片分析快速路径 OCR+lite JSON VLM并行 目标单图<3s/8图<15s #2200
Merged
xiaoxia
merged 1 commits from 2026-10-05 17:08:53 +08:00
feat/vision-v2-fast-path into develop
1 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
ed20fbad49 |
feat(vision): V2 快速图片分析路径 — OCR+lite JSON VLM并行,单图<3s目标
CI/CD Pipeline / Check push changed paths (pull_request) Has been skipped
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 1s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 1s
CI/CD Pipeline / Frontend Lint (pull_request) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / PR Build Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 58s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 1m19s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m41s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Waiting to run
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 43s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 2m59s
CI/CD Pipeline / Unit Tests (pull_request) Failing after 4m43s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Successful in 5m49s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 5m50s
CI/CD Pipeline / Validate - Style (pull_request) Failing after 6m5s
AI Code Review / AI Code Review (pull_request) Successful in 6m59s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 1m3s
CI/CD Pipeline / Validate - Security (pull_request) Successful in 12m21s
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / CI Gate (pull_request) Failing after 6s
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Canary Release to Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
灵应直接指令(10-05):图片分析专用API组合方案直接干,不要等方案确认。
API现实说明:
- 火山引擎云端真实可用的视觉专用HTTP API:OCR(MediaKit tools-sync/ocr,Bearer鉴权)
- 人体属性/商品检测/图像标签:火山云端无公开HTTP API,仅有移动端SDK(智能美化特效,年费6-60万)
- 务实方案:OCR专用API + doubao-seed-2.1-lite强约束JSON-only prompt(替代3类缺失的专用API),
pro VLM保留为终极兜底
架构:
- 新模块 apps/worker/worker_app/tasks/vision/:
- vlm_fast_json.py:lite VLM极简JSON schema prompt,max_tokens=350,temp=0.1,timeout=8s
- ocr_volc.py:MediaKit同步OCR封装,返回文本列表
- assembler.py:字段映射+portrait_prompt模板拼接,输出格式与旧_normalize完全一致
- fast_path.py:analyze_image_v2/analyze_images_v2,单图2路并行(OCR+lite JSON),
外层8图全并发,置信度低/失败自动降级旧lite/pro竞速VLM
- _step_image_analysis增加VISION_V2_ENABLED环境变量开关:
- true→走V2快速路径
- false(默认)→走V1 #2198/#2199 lite/pro竞速路径(过渡期兜底)
- 下游信任链/t2i零改动:输出dict字段(name/brand/category/appearance/key_features/
scene/mood/portrait_prompt/summary/_source)与旧格式完全兼容
性能目标:
- 单图fast路径目标<3s(OCR+lite JSON并行取最慢)
- 8图全并发<15s(较当前V1的~115s/3图提升10倍+)
- 兜底路径仍复用现有V1竞速,最坏情况不劣化
|