Enhance HVideoTool's detection and restoration features: added support for tracking the model used in detections, improved temporal coherence by allowing the use of already-restored frames in the restoration process, and updated the UI to reflect these changes with new indicators and configuration options. Documentation in CLAUDE.md has been updated accordingly.
This commit is contained in:
@@ -149,7 +149,9 @@ hvideotool/
|
||||
paths and, if nothing is selected, default-ticks every discovered model. `build_detector`
|
||||
builds one `YoloDetector` per selected model (tagged `label=category`) wrapped in a
|
||||
`MultiYoloDetector` that concatenates their detections (no cross-model dedup). Each
|
||||
`Detection` carries `label` (category); overlay colour + table group by `Detection.display`
|
||||
`Detection` carries `label` (category) **and `model`** (the producing `.pt` stem, tagged in
|
||||
`YoloDetector` — shown as its own "Модель" column in the detail table since a category folder
|
||||
may hold several models); overlay colour + table group by `Detection.display`
|
||||
(label, else the CensorType) via `OverlayConfig.colors` + a stable `palette` fallback.
|
||||
- **Background jobs (`ui/workers.py`).** Detection and restoration are CPU-heavy and
|
||||
would freeze the GUI, so they run on a `QThreadPool` thread via `Job` (a `QRunnable`
|
||||
@@ -248,6 +250,12 @@ hvideotool/
|
||||
`restore_sequence(count, get_frame, get_dets, emit, should_cancel)` (the batch run uses
|
||||
it; single-frame `restore` degrades to a window of the same frame). Needs the **video**
|
||||
weights `clean_youknow_video.pth` (+ `mosaic_position.pth` beside). `INPUT_SIZE=256`.
|
||||
**`feed_restored`** (config `dm_feed_restored`, default on, checkbox in `RestoreDialog`):
|
||||
when set, the **past** neighbours in the window (`j<i`) are taken from the engine's own
|
||||
already-restored outputs (a small rolling cache, `reach=N*S` deep) instead of the original
|
||||
mosaic frames — stronger temporal coherence. The **centre** (the frame being cleaned) and
|
||||
**future** neighbours (`j>i`, not yet restored) stay original. Slightly out-of-distribution
|
||||
for the BVDNet (trained on mosaic windows), so it's a toggle; off = faithful DeepMosaics.
|
||||
|
||||
`restore_sequence` is on the `Restorer` ABC (default = independent per-frame loop);
|
||||
`_restore_all` dispatches on `restorer.temporal` (temporal → `restore_sequence` over the
|
||||
@@ -266,10 +274,15 @@ hvideotool/
|
||||
`_step_hit` scans `_results` for the next non-empty frame). The slider and file list
|
||||
are kept in sync via `_update_nav` guarded by `_nav_sync` (avoids signal loops); all
|
||||
navigation ultimately drives `file_list.setCurrentRow`. The scrubber is a custom
|
||||
`MarkerSlider` (`ui/marker_slider.py`) that paints cyan ticks at frames with
|
||||
detections (`_refresh_marks` projects `_results` onto row indices; per-pixel deduped
|
||||
so big folders stay cheap). File-list rows are tinted too (`_tag_file`): red =
|
||||
censorship found, green = checked & clean. Both reset on `_invalidate_results`.
|
||||
`MarkerSlider` (`ui/marker_slider.py`) that paints **two mark layers**: cyan ticks
|
||||
(upper half) at frames with detections (`_refresh_marks` projects `_results`) and
|
||||
**green ticks (lower half) at restored frames** (`_refresh_restored_marks` scans
|
||||
`restored/` + in-memory `_restored`; called on load and after each restore op, not
|
||||
per-frame); per-pixel deduped so big folders stay cheap. Under the scrubber a
|
||||
**progress summary** `stats_label` reads "Кадров: N · детектировано: D/N (с цензурой:
|
||||
H) · расцензурено: R/N" (`_update_counts_label`, cheap counts; `_restored_count`
|
||||
cached by `_refresh_restored_marks`). File-list rows are tinted too (`_tag_file`):
|
||||
red = censorship found, green = checked & clean. Both reset on `_invalidate_results`.
|
||||
- **Cancellation (cooperative).** A single "■ Стоп" toolbar action (Esc) cancels the
|
||||
running op. `_begin_busy(total)` / `_end_busy()` toggle `self._busy` + the Stop button +
|
||||
the progress bar (`total=None` → indeterminate). For **background jobs** (detection,
|
||||
|
||||
Reference in New Issue
Block a user