76 Commits
Author SHA1 Message Date
liuchenandClaude Sonnet 4.6 a1eb5bb28e Fix watermark detection + S3 upload + NVENC color + task download on S3 failure
Docker Build and Push / check-secrets (push) Successful in 11s
Docker Build and Push / build-and-push (cpu, latest) (push) Has been skipped
Docker Build and Push / build-and-push (cuda, 11.8) (push) Has been skipped
Docker Build and Push / build-and-push (cuda, 12.6) (push) Has been skipped
Docker Build and Push / build-and-push (cuda, 12.8) (push) Has been skipped
Docker Build and Push / build-and-push (directml, latest) (push) Has been skipped
Build Windows CPU / build (push) Has been cancelled
Build Windows CUDA 11.8 / build (push) Has been cancelled
Build Windows CUDA 12.6 / build (push) Has been cancelled
Build Windows CUDA 12.8 / build (push) Has been cancelled
Build Windows DirectML / build (push) Has been cancelled
- smart_detect.py: rewrite detect_static_regions using saturation-signature method
  (high-sat logo frames vs no-logo frames diff) to handle animated/periodic watermarks
  that break temporal-std approach; merge top-region boxes; add print debugging
- web_app.py: fix S3 upload (async chunked streaming, error visible in task log);
  s3_failed flag keeps task downloadable even when S3 upload fails; add s3_failed
  column to DB; download/stream endpoints allow s3_failed tasks
- web/index.html: show play/download buttons for s3_failed tasks; task sort by
  created_at desc; watermark mode label update; isLocalDone() helper
- video_io.py: add -vf format=yuv420p before h264_nvenc to fix green video

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-06-28 00:20:44 +08:00
liuchenandClaude Opus 4.8 c65ec20119 Rework watermark detection + remove STTN modes
Docker Build and Push / check-secrets (push) Successful in 5s
Docker Build and Push / build-and-push (directml, latest) (push) Has been skipped
Docker Build and Push / build-and-push (cuda, 12.8) (push) Has been skipped
Docker Build and Push / build-and-push (cpu, latest) (push) Has been skipped
Docker Build and Push / build-and-push (cuda, 11.8) (push) Has been skipped
Docker Build and Push / build-and-push (cuda, 12.6) (push) Has been skipped
Build Windows CUDA 12.8 / build (push) Has been cancelled
Build Windows DirectML / build (push) Has been cancelled
Build Windows CUDA 11.8 / build (push) Has been cancelled
Build Windows CPU / build (push) Has been cancelled
Build Windows CUDA 12.6 / build (push) Has been cancelled
Detection (smart_detect.py) — two complementary paths, both feed per-frame masks:
1. Faint/semi-transparent & scrolling text (e.g. "sjhs.pw"):
   - per-frame white top-hat extracts thin bright strokes (OCR can't see these)
   - connected-component count (>=3) keeps text, rejects solid bright objects
   - track-linking across frames keeps stable-width persistent tracks,
     drops erratic body/skin highlights
2. Colorful opaque logos (e.g. "黑料网 heiliao.com"):
   - high-saturation (>150) AND low temporal-variance → static logo,
     rejects moving skin and muted background art
   - corner-snapping extends box to frame edge for full logo coverage

Key fixes:
- per-frame dict uses 1-based frame numbers to match the inpaint pipeline
  (was 0-based → masks never applied → nothing removed)
- persistent watermarks require LaMa spatial inpaint; STTN temporal inpaint
  has the watermark in its own reference frames so it can't remove them

Remove STTN modes entirely:
- INPAINT_MODE_MAP drops sttn-auto/sttn-det; unknown modes fall back to LaMa
- frontend algorithm selector: LaMa (default) / ProPainter / OpenCV
- platform-task & TaskCreate default inpaint_mode = lama

Validated: both "sjhs.pw" (scrolling text) and "黑料网" (color logo)
fully removed on preview with LaMa, no content damage.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-27 17:59:41 +08:00
liuchenandClaude Haiku 4.5 fabde9cf83 Fix S3 streaming upload + detect white/gray watermarks
Docker Build and Push / build-and-push (cuda, 11.8) (push) Has been skipped
Docker Build and Push / build-and-push (cuda, 12.6) (push) Has been skipped
Docker Build and Push / build-and-push (cuda, 12.8) (push) Has been skipped
Docker Build and Push / check-secrets (push) Successful in 4s
Docker Build and Push / build-and-push (cpu, latest) (push) Has been skipped
Docker Build and Push / build-and-push (directml, latest) (push) Has been skipped
Build Windows CUDA 11.8 / build (push) Has been cancelled
Build Windows CUDA 12.6 / build (push) Has been cancelled
Build Windows CUDA 12.8 / build (push) Has been cancelled
Build Windows DirectML / build (push) Has been cancelled
Build Windows CPU / build (push) Has been cancelled
S3 upload:
- Replace read_bytes() (loads entire file into memory) with streaming SHA256
  computation (8MB chunks) + httpx streaming PUT with Content-Length header
- Add detailed logging for each upload step to diagnose future failures

Watermark detection (smart_detect.py):
- Add Path B: brightness-diff detection for low-saturation watermarks like
  white/gray text (e.g. 'sjhs.pw'). Compares mean brightness in first 10s
  vs the rest of the video. Regions that are brighter in early frames AND
  located in frame corners (top-left, top-right, etc.) are flagged.
- Merge Path A (saturation-based) + Path B (brightness-diff) results
- Fall back to global std method only if both paths find nothing

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-27 17:06:18 +08:00
liuchenandClaude Haiku 4.5 8b583a4b0e Fix smart_detect: correct pos index, remove O(n²) loop, clean up
Docker Build and Push / build-and-push (cpu, latest) (push) Has been skipped
Docker Build and Push / build-and-push (cuda, 11.8) (push) Has been skipped
Docker Build and Push / check-secrets (push) Successful in 5s
Docker Build and Push / build-and-push (cuda, 12.6) (push) Has been skipped
Docker Build and Push / build-and-push (cuda, 12.8) (push) Has been skipped
Docker Build and Push / build-and-push (directml, latest) (push) Has been skipped
Build Windows CPU / build (push) Has been cancelled
Build Windows CUDA 11.8 / build (push) Has been cancelled
Build Windows CUDA 12.6 / build (push) Has been cancelled
Build Windows CUDA 12.8 / build (push) Has been cancelled
Build Windows DirectML / build (push) Has been cancelled
- actual_pos_s[] tracks real timestamps per frame (was using positions[i]
  which breaks when frames fail to read)
- Replace O(n²) np.array_equal logo frame matching with simple bool list
- Remove unused pos_set variable
- Fix docstring still mentioning '8s tail' after removing it
- All variables consistent: logo_gray_frames replaces logo_frames_gray

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-27 16:16:48 +08:00
liuchenandClaude Haiku 4.5 5cdc727207 SAM2: sample every second for the entire video, no exceptions
Docker Build and Push / check-secrets (push) Successful in 9s
Docker Build and Push / build-and-push (cpu, latest) (push) Has been skipped
Docker Build and Push / build-and-push (cuda, 12.8) (push) Has been skipped
Docker Build and Push / build-and-push (directml, latest) (push) Has been skipped
Docker Build and Push / build-and-push (cuda, 11.8) (push) Has been skipped
Docker Build and Push / build-and-push (cuda, 12.6) (push) Has been skipped
Build Windows CPU / build (push) Has been cancelled
Build Windows CUDA 11.8 / build (push) Has been cancelled
Build Windows CUDA 12.6 / build (push) Has been cancelled
Build Windows CUDA 12.8 / build (push) Has been cancelled
Build Windows DirectML / build (push) Has been cancelled
User requirement: correctness first, slow is acceptable.
- Remove the 120s dense + 8s tail split
- Full video sampled at 1 frame/second uniformly
- Analysis still uses 1/4 resolution for speed
- Coordinate scale restored to original resolution at the end

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-27 16:14:53 +08:00
liuchenandClaude Haiku 4.5 9094b3c888 Fix SAM2 missing early watermarks: always sample first 15 seconds
Docker Build and Push / build-and-push (cuda, 12.6) (push) Has been skipped
Docker Build and Push / check-secrets (push) Failing after 3s
Docker Build and Push / build-and-push (cpu, latest) (push) Has been skipped
Docker Build and Push / build-and-push (cuda, 11.8) (push) Has been skipped
Docker Build and Push / build-and-push (cuda, 12.8) (push) Has been skipped
Docker Build and Push / build-and-push (directml, latest) (push) Has been skipped
Build Windows CPU / build (push) Has been cancelled
Build Windows CUDA 11.8 / build (push) Has been cancelled
Build Windows CUDA 12.6 / build (push) Has been cancelled
Build Windows CUDA 12.8 / build (push) Has been cancelled
Build Windows DirectML / build (push) Has been cancelled
For long videos (e.g. 1100s), uniform sampling started at ~23s, completely
missing watermarks that appear at 1s, 2s, 4s. Fix: always include dense
samples at 0.5, 1, 1.5, 2, 3, 4, 5, 7, 10, 15 seconds before the uniform
distribution, then deduplicate. Watermarks in the first 15s are now caught.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-27 16:11:29 +08:00
liuchenandClaude Haiku 4.5 693d394f55 Add GPU support and multi-threaded subtitle detection
Docker Build and Push / check-secrets (push) Successful in 30s
Docker Build and Push / build-and-push (cuda, 12.6) (push) Has been skipped
Docker Build and Push / build-and-push (cuda, 12.8) (push) Has been skipped
Docker Build and Push / build-and-push (directml, latest) (push) Has been skipped
Docker Build and Push / build-and-push (cpu, latest) (push) Has been skipped
Docker Build and Push / build-and-push (cuda, 11.8) (push) Has been skipped
Build Windows CPU / build (push) Has been cancelled
Build Windows CUDA 11.8 / build (push) Has been cancelled
Build Windows CUDA 12.6 / build (push) Has been cancelled
Build Windows CUDA 12.8 / build (push) Has been cancelled
Build Windows DirectML / build (push) Has been cancelled
- Add gpu_id parameter to SubtitleDetect for GPU acceleration
- Implement multi-threaded frame scanning with thread-safe CUDA context
- Add smart_detect module and web application components
- Update .gitignore to exclude web cache

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-27 13:27:26 +08:00
flavioyandClaude Opus 4.6 0bae013097 优化字幕检测算法、添加多语言翻译支持
- 自适应采样间隔:根据视频帧率调整(60fps+→4, 30fps+→3, 低帧率→2)
- filter_and_merge_intervals 复杂度从 O(n²) 优化为 O(n log n)
- detect_subtitle 区域过滤:单区域快速路径,多区域匹配即停
- 插值逻辑改用 zip 预计算 max_gap,更高效
- SubtitleDetectMode 枚举值改为英文key,通过翻译系统显示本地化名称
- 7种语言文件添加 SubtitleDetectMode 翻译(中/繁/英/日/韩/越/西)
- 旧配置值自动迁移兼容

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 00:17:01 +08:00
flavioyandClaude Opus 4.6 93d822d067 修复LAMA模式100%卡死:帧区间扩展超出视频总帧数导致FramePrefetcher死锁
- 限制字幕区间end不超过frame_count,防止内循环消费哨兵后外层永久阻塞
- LAMA批量推理改为mini-batch(4帧),避免GPU OOM
- 各inpaint模型空inpaint_area时返回原始帧
- FFmpeg子进程添加600s超时保护

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-08 23:34:53 +08:00
flavioyandClaude Opus 4.6 e801d58e80 GPU加速和批处理优化、更新README
- STTN Auto/Det: 统一 torch.no_grad 包裹,减少重复上下文切换开销
- STTN Auto: 添加 FramePrefetcher 帧预读取,根据 GPU 显存动态调整 batch size
- Lama Inpaint: 新增 _inpaint_batch 批量推理,多帧合并一次 GPU 推理
- ProPainter: copy.deepcopy 替换为浅拷贝,每个区域处理后 gc.collect
- HardwareAccelerator: 新增 get_available_vram_mb 显存查询方法
- README: 添加应用 Logo,同步英文版 README_en.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-08 00:17:50 +08:00
flavioyandClaude Opus 4.6 1ab2eb96cf 美化控制台输出:时间戳、颜色标签、线程安全优化
- PlainTextEdit 替换为 TextEdit 支持 HTML 富文本
- 每条日志添加 [HH:MM:SS] 时间戳
- 根据消息类型自动着色(错误红/成功绿/警告橙/信息蓝)
- 修复字幕检测模型无 ONNX providers 时输出空括号的问题
- HTML 特殊字符转义防止注入
- 清理 gui.py closeEvent 中多余的注释代码

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 23:29:16 +08:00
flavioyandClaude Opus 4.6 6c61ddc6b0 性能优化:帧采样、FFmpeg编码、帧预读取、消除冗余拷贝
- 字幕检测:每3帧采样一次OCR,中间帧插值填充,检测速度提升约3倍
- 视频编码:cv2.VideoWriter(mp4v) 替换为 FFmpeg libx264 管道编码,画质更好、体积更小
- 帧预读取:后台线程预解码视频帧,I/O 与模型推理重叠
- 消除 deepcopy:numpy 数组改用 .copy() 替代 copy.deepcopy,降低内存开销
- 清理冗余颜色空间转换中的 np.array() 包装

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 22:58:52 +08:00
flavioyandClaude Opus 4.6 70e669e9d4 升级 PaddleOCR 至 3.4.0,移除 PP-OCRv4 模型
- PaddleOCR 2.10.0 升级至 3.4.0,使用新的 TextDetection API 替代旧版 TextDetector
- V5 模型替换为 PaddleX 格式(inference.pdiparams + inference.yml)
- 移除 PP-OCRv4 模型(backend/models/V4),仅保留 PP-OCRv5
- 字幕检测选项重命名为"快速"和"精准"
- 清理 requirements.txt,移除 11 个未使用的依赖,补充缺失的依赖
- 更新设计素材

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 22:34:36 +08:00
Jason 7025d3234b 升级版本号至1.4.0 2025-05-22 19:52:37 +08:00
Jason 21b0c31638 CPU版本硬件加速给予友好提示 2025-05-22 19:52:37 +08:00
Jason 50c89c1217 同时支持PP-OCRv4 PP-OCRv5模型 2025-05-22 19:52:36 +08:00
Jason afcc93b9cc 支持设置视频保存路径 2025-05-22 19:50:24 +08:00
Jason 70488eb290 选区部分全部采用浮点值, 以便更好的适配不同尺寸不同分辨率 2025-05-22 16:33:56 +08:00
Jason 9edeb437fb 支持不同任务使用不同选区 2025-05-22 15:09:59 +08:00
Jason 65888f4274 强制命令行使用英语 2025-05-22 15:09:59 +08:00
Jason 40ff7664e0 升级版本号至1.3.0 2025-05-22 15:09:59 +08:00
Jason e26e23ad6a 支持设置时间选区
支持方向键快进快退(ctrl + -> or shirft + -> or ->)
2025-05-22 15:09:59 +08:00
Jason 7cf4e882cd 初步支持 macOS (Apple Silicon)
升级至PP-OCRv5
Tested with Python 3.13
感谢用户 "期望" 提供的macOS设备用于开发测试
2025-05-22 13:02:28 +08:00
Jason c673b5ccd1 支持多字幕区域 2025-05-22 08:42:00 +08:00
Jason f78e985e1c 使用PySide6-Fluent-Widgets重构整套UI
添加任务列表组件并优化视频加载逻辑
支持可视化显示字幕区域
整理所有模型, 分别为STTN智能擦除, STTN字幕检测, LAMA, ProPainter, OpenCV
提高处理性能
新增CPU运行模式并优化多语言支持
修复Propainter模式部分视频报错

本次提交新增了CPU运行模式,适用于无GPU加速的场景。同时,优化了多语言支持,新增了日语、韩语、越南语等语言配置文件,并更新了README文档以反映新的运行模式和多语言支持。此外,修复了部分代码逻辑,提升了系统的稳定性和兼容性。
2025-05-22 08:41:59 +08:00
Jason 7304905a84 支持CI自动发布 2025-04-25 13:01:51 +08:00
Jason 746db4bced DirectML版本支持运行STTN模型(Windows) 2025-04-25 13:01:31 +08:00
Jason 30e7913981 修复结束时inpaint_area报错 2025-04-25 13:01:26 +08:00
Jason 6fc6d35584 主界面显示版本号, 方便定位问题 2025-04-25 13:01:09 +08:00
Jason 87d8d9d3d7 适配torch 2.8.0 nightly build 2025-04-25 13:00:58 +08:00
Jason 3770ccdcfd 改用PaddleOCR, 跟随主线更新 2025-04-25 13:00:30 +08:00
天涯古巷 53baf28326 Revert "由于PySimpleGUI作者故意移除免费的旧版本,改用PySimpleGUI-4-foss" 2025-04-25 11:03:16 +08:00
Jason acdb150aa2 支持CI自动发布 2025-04-24 16:22:01 +08:00
Jason 97b4159d38 DirectML版本支持运行STTN模型(Windows) 2025-04-24 15:56:13 +08:00
Jason bb80445cf4 修复结束时inpaint_area报错 2025-04-24 15:53:28 +08:00
Jason 7e8d0b818b 主界面显示版本号, 方便定位问题 2025-04-24 15:51:21 +08:00
Jason 77758d258b 适配torch 2.8.0 nightly build 2025-04-24 15:47:23 +08:00
Jason c60234f4ec 改用PaddleOCR, 跟随主线更新 2025-04-24 15:46:38 +08:00
天涯古巷 3dc8f3bfe0 Update main.py 2024-10-23 16:41:01 +08:00
YaoFANGUK a3dd7b797d 添加注释 2024-01-09 11:05:07 +08:00
YaoFANGUK 6b353455a0 添加文献 2024-01-09 09:24:19 +08:00
YaoFANGUK d6736d9206 添加sttn训练代码 2024-01-08 17:48:21 +08:00
YaoFANGUK 2d1eb11fd6 增大视野,保证去除效果 2024-01-05 16:57:40 +08:00
YaoFANGUK 9a65c17a50 修改备注 2024-01-05 14:39:05 +08:00
YaoFANGUK f9dd30fddf 兼容安卓手机不能分享生成视频的问题 2024-01-04 14:33:33 +08:00
YaoFANGUK dad37eba7d 更新readme 2023-12-29 15:52:55 +08:00
YaoFANGUK a7e62db98a 屏蔽windows删除文件报错 2023-12-29 09:33:07 +08:00
YaoFANGUK 945aeb9bc8 新增文件类型判断 2023-12-29 09:23:42 +08:00
YaoFANGUK 6ea7482344 minor 2023-12-29 08:46:36 +08:00
YaoFANGUK ba396d9569 未传入字幕区域时,进行全屏处理 2023-12-29 08:45:20 +08:00