
xslandClaude Opus 4.8
ce95a508c1
feat(接口3): B端生发-马克笔发际线检测+生发(替换Mock)
医生在额头用马克笔画规划发际线 → 检测该线 → 生发。检测算法源自 /home/xsl/headmark。
- hairline/marker_detect.py: 黑帽响应图(MORPH_BLACKHAT)+鬓角锚点(MediaPipe 21/251吸附)
+skimage route_through_array 最小路径检测画线;路径平均响应阈值拒识无画线
(headmark 调研:全局灰度阈值不可用,黑帽+Dijkstra 实测误差≤0.5px)
- hairline/mask.py: 抽出 mask_from_curve(曲线+ROI闭合),接口2/3共用
- hairline/service.py: generate_grow_b——检测→遮罩→原图重画干净线→ComfyUI生发
- app.py: /hair/grow-b 真实实现,marked+original各三选一+校验;输出
best_hairline_image_base64(=原图)/hair_growth_image_base64/hairline_type="custom";
无人脸或未检测到画线→1001;重活进线程池
- requirements: scikit-image==0.24.0 (⚠️锁0.24,0.25+强依赖numpy>=2会顶掉mediapipe的numpy<2)
- 文档: docs/接口3-B端生发-技术实现方案.md
- 测试: test_marker.py(检测/拒识/辅助) + test_api grow-b(mock ComfyUI),42全绿
实测(5090): grow-b ~6.4s,生发图把额头发际线补到医生画线、清除划线、人物保持。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 00:08:05 +08:00
..
2026-06-14 16:59:39 +08:00
2026-06-14 16:59:39 +08:00
2026-06-14 16:59:39 +08:00
2026-06-14 16:59:39 +08:00
2026-06-14 16:59:39 +08:00
2026-06-14 16:59:39 +08:00
2026-06-14 23:42:30 +08:00
2026-06-14 20:31:41 +08:00
2026-06-14 16:59:39 +08:00
2026-06-14 20:31:41 +08:00
2026-06-14 16:59:39 +08:00
2026-06-14 16:59:39 +08:00
2026-06-14 16:59:39 +08:00
2026-06-15 00:08:05 +08:00
2026-06-15 00:08:05 +08:00
2026-06-14 16:59:39 +08:00
2026-06-14 23:42:30 +08:00
2026-06-15 00:08:05 +08:00