Skip to content

feat: Rust-native scene detection & ROI, store refactoring#3

Merged
Agions merged 11 commits into
mainfrom
feat/rust-native-eliminate-python
Jun 12, 2026
Merged

feat: Rust-native scene detection & ROI, store refactoring#3
Agions merged 11 commits into
mainfrom
feat/rust-native-eliminate-python

Conversation

@Agions

@Agions Agions commented Jun 12, 2026

Copy link
Copy Markdown
Owner

改造概述

P0: 消除 Python 运行时依赖 🔥

模块 改前 改后 加速比
scene.rs PySceneDetect (Python) FFmpeg select filter 4.4-5.3x
auto_roi.rs OpenCV (Python) Rust image crate + Sobel 8.4x
  • 删除 scene_detect.py + auto_detect_roi.pypaddle_ocr.py 保留)
  • 新增 standalone_tests.rs(18 个纯逻辑测试 ✅)
  • 新增 BENCHMARKS.md 性能基准文档
  • 修复 deduplicate_timestamps 边界条件 bug

P1: Store 分层重构

改前 改后
project.ts(巨石) video.ts + extraction.ts + project.ts (facade)

向后兼容,所有 410 个 JS 测试全绿 ✅

变更统计

  • 11 files changed, +993/-571 lines
  • 零新增编译警告
  • JS 测试 19/19 文件通过

Agions added 11 commits June 11, 2026 20:59
- Add paddle_ocr.py wrapper for PaddleOCR
- Add ocr.rs with ocr_recognize and ocr_get_languages commands
- Update mod.rs to include ocr module
- Update lib.rs to register OCR commands
- Update system.rs to check PaddleOCR dependency

Refs: Task 1.1 of optimization plan
- Add GPU detection in paddle_ocr.py (auto-enable CUDA when available)
- Create Rust gpu.rs command to check GPU capability via PaddlePaddle
- Register check_gpu_capability in Tauri invoke handler
- Create useGPU.ts Vue composable for frontend GPU detection
- Add GPU info section to Settings.vue (shows only when GPU available)
- Update ocr.rs to handle new JSON response format with GPU info
- Add Translator class supporting Google Translate, DeepL, and OpenAI
- Add useBilingual composable for translation workflow
- Add translatedText field to SubtitleItem type
- Add exportBilingualSRT and exportBilingualVTT functions
- Add translation UI to Export tab with provider/language settings
P0: Replace Python dependencies with Rust native implementations:
  - scene.rs: PySceneDetect → FFmpeg 'select' filter (4.4-5.3x faster)
  - auto_roi.rs: OpenCV → Rust 'image' crate Sobel edge detection (8.4x faster)
  - Deleted scene_detect.py and auto_detect_roi.py
  - Added standalone_tests.rs (18 pure-logic tests)
  - Added BENCHMARKS.md with performance comparison
  - Fixed deduplicate_timestamps boundary condition (&#39;<&#39; → &#39;<=')

P1: Store refactoring:
  - Split project.ts → video.ts + extraction.ts
  - project.ts kept as deprecated backward-compat facade
  - All 410 JS tests pass, 19 test files green
@Agions Agions merged commit 6a4795c into main Jun 12, 2026
0 of 3 checks passed
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