MediaMend:本機 AI 媒體清理助理
MediaMend
MediaMend 是一款本機 AI 助理,掃描資料夾並標記模糊相片、黑畫面、無聲錄音、空檔案及重複檔案,讓用戶檢視後移至暫存區,而非直接刪除。它以 OpenCV、FFmpeg 和 SHA-256 執行可量度的檢查,並使用本機開放權重視覺語言模型評估被標記的相片;檔案可還原,永久刪除則須另行確認。所有處理均在電腦上進行,個人相片和錄音不會上載。
Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady 🦥
T*This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady
What I Built
MediaMend is a local AI assistant for people who record far more media than they will ever review: blurry photos, black video frames, silent recordings, empty files, duplicates.
The lazy way to clean that up is "delete everything below a threshold", and that is also the way to lose the one blurry, unrepeatable shot that mattered. MediaMend takes a safer lazy path:
- Scan a folder. Everything runs on your computer. Nothing is uploaded.
- Review a short queue of flagged files, each with a reason and a confidence level.
- Move to Bin. Approved files leave your folders but are not deleted.
- Restore, Archive or Delete permanently from the Bin. Permanent deletion needs a separate confirmation.
You never inspect the whole folder. You only judge the cases the tool is unsure about.
Code
https://github.com/noorulhuda07/mediamend
How I Built It
- Deterministic checks for measurable problems: OpenCV Laplacian variance for blur, resolution checks, sampled video frames for blank-frame share, FFmpeg decoding for silence measured relative to each recording's own level, SHA-256 for exact duplicates.
- A local open-weight vision-language model for judgment: [model name and tag, e.g. via Ollama] looks at flagged photos and answers one narrow question: could this imperfect image still be worth keeping? It returns structured JSON that I validate. If the model is unavailable or answers badly, the app says so instead of faking a result.
- A safety layer: every move records the original path, size and SHA-256 in a manifest and verifies the checksum afterwards. Restore never overwrites an existing file, and nothing outside the scanned folder can be touched.
- Stack: Python, Streamlit, OpenCV, FFmpeg, [Ollama + model].
Technical measurements and AI opinions are stored separately, so a model's guess never overwrites measured evidence.
Results
I tested on [N] labelled files ([N] photos, [N] videos, [N] audio, [N] other). Ground truth was labelled before scanning.
| Metric | Result |
|---|---|
| Blur precision / recall | [x/y], [x/y] |
| False positives on must-keep files (rules only) | [n] |
| False positives on must-keep files (rules + AI) | [n] |
| Bin/restore checksum success | [x/y] |
| Scan time ([N] files) | [seconds] |
| AI time per photo | [seconds] on [hardware] |
Where it failed: [real examples, e.g. a dark but valid photo flagged as blurry because low contrast lowers the sharpness score; the model's wrong call on ...]. The thresholds are starting points I tuned on this set, not universal values.
Why Open Innovation Matters
- Privacy: personal photos and voice recordings never leave the machine.
- Control: I can swap or compare models ([model A] vs [model B]) and inspect the exact prompt and outputs.
- Cost: no per-image API fees for scanning thousands of files.
- Transparency and reproducibility: the code, prompt, thresholds and test set are public, so anyone can rerun the benchmark and see the failures.
The honest trade-off: [hardware needs, model speed on your laptop, accuracy limits].
Limitations
AI cannot judge creative value perfectly. Deleting from the Bin may not securely erase every copy on SSDs, backups or synced folders. [Anything else you observed.]
devchallenge #hf26challengehis is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady*
What I Built
Demo
Code
How I Built It
Why Does Open Innovation Matter?
My Agent Session
The Lazy Payoff
Prize Categories
來源:DEV Community · dev.to