Skip to content

feat: adapt to neroued_vectorizer v0.2.0 with V1/V2 pipeline selection#44

Open
Neroued wants to merge 1 commit into
masterfrom
feat/vectorizer-v2-pipeline
Open

feat: adapt to neroued_vectorizer v0.2.0 with V1/V2 pipeline selection#44
Neroued wants to merge 1 commit into
masterfrom
feat/vectorizer-v2-pipeline

Conversation

@Neroued
Copy link
Copy Markdown
Owner

@Neroued Neroued commented Mar 26, 2026

Summary

  • Adapt to neroued_vectorizer v0.2.0 which introduces a V2 vectorization pipeline (stacking model + depth ordering) alongside the existing V1 (boundary-graph + cutout).
  • Add pipeline_mode parameter throughout the stack (API, frontend types, normalization, UI) with V2 as the new default.
  • Frontend dynamically hides V1-only parameters when V2 is selected, showing a cleaner interface with only shared parameters.
  • Expose previously missing V1 parameters (slic_compactness, enable_subpixel_refine, subpixel_max_displacement) in the advanced settings panel.

Changes

Backend (server_facade.cpp)

  • VectorizeDefaults(): returns pipeline_mode: "v2" and newly exposed fields
  • BuildVectorizeConfig(): parses pipeline_mode string to enum, parses new fields, adds range validation
  • Debug logging includes pipeline_mode

Frontend

  • types.ts: PipelineMode type alias, 4 new fields on VectorizeParams
  • normalizeVectorizeParams.ts: defaults to pipeline_mode: 'v2', normalization for new fields
  • VectorizePanel.vue: radio group for V1/V2 selection, v-if="isV1" on V1-only sections (smoothness, segmentation panel, thin line radius, detail level)
  • zh-CN.ts / en.ts: i18n keys for pipeline mode and new parameters

Docs

  • docs/development.md: vectorize parameter table restructured with "Applicable" column (V1/V2/V1+V2)

Test plan

  • Verify GET /api/v1/vectorize/defaults returns pipeline_mode: "v2" and all new fields
  • Submit vectorize task with pipeline_mode: "v1" — confirm V1 pipeline is used
  • Submit vectorize task with pipeline_mode: "v2" (or omit) — confirm V2 pipeline is used
  • Frontend: select V2 — verify V1-only params (smoothness, segmentation section, thin line, detail level) are hidden
  • Frontend: select V1 — verify all params including new ones (slic_compactness, subpixel refine) are visible
  • Frontend: reset params button works correctly for both modes
  • Verify i18n works for both zh-CN and en locales

Made with Cursor

Copy link
Copy Markdown
Owner Author

@Neroued Neroued left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review — PR #44: feat: adapt to neroued_vectorizer v0.2.0 with V1/V2 pipeline selection

web/frontend/src/domain/vectorize/normalizeVectorizeParams.ts

  • Warning: L9, L20 — 本地 fallback 默认值仍然是旧版本的 min_region_area=10max_merge_color_dist=150,而这次 PR 把 v0.2.0 / V2 的默认值切到了 50 和 200。结合 VectorizePanel.vue 里提交时仍以 defaultVectorizeParams 作为 normalize fallback(L91-L92),一旦 /api/v1/vectorize/defaults 请求失败,就会把过期默认值发给后端,导致“默认 V2 参数”和文档描述不一致。建议把本地默认值同步到新后端默认值,或提交时改用 mergedDefaults 作为 fallback,避免服务端 defaults 不可用时退回旧参数。

Reviewed at: 97c2dbb | Files: 8 | Findings: 0 critical, 1 warning, 0 info

Add pipeline_mode parameter to vectorize API, allowing users to choose
between V1 (boundary-graph + cutout) and V2 (stacking model + depth
ordering) algorithms. V2 is the new default.

Backend:
- VectorizeDefaults() returns pipeline_mode and newly exposed fields
- BuildVectorizeConfig() parses pipeline_mode, slic_compactness,
  enable_subpixel_refine, subpixel_max_displacement, enable_depth_validation
- Range validation and debug logging for all new parameters

Frontend:
- Pipeline mode radio selector at top of vectorize settings panel
- V1-only parameters (smoothness, segmentation section, thin line radius,
  detail level) hidden when V2 is selected via v-if
- New V1 advanced params: slic_compactness, enable_subpixel_refine,
  subpixel_max_displacement
- i18n keys for zh-CN and en locales

Docs:
- development.md vectorize parameter table updated with pipeline_mode
  column and all new parameters

Made-with: Cursor
@Neroued Neroued force-pushed the feat/vectorizer-v2-pipeline branch from 97c2dbb to 2479ebc Compare April 6, 2026 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant