Refactor HVideoTool to support project-based workflow: introduced project management features, updated UI for project handling, and enhanced documentation in README and CLAUDE.md. The tool now organizes images and settings into projects, improving usability and detection caching.

This commit is contained in:
Leonid Pershin
2026-06-07 04:53:27 +03:00
parent 7f0121b7df
commit e27dfdf518
27 changed files with 2998 additions and 387 deletions
+20 -2
View File
@@ -9,11 +9,20 @@ DeepMosaics / LADA later) plug in behind the same interface.
from __future__ import annotations
from abc import ABC, abstractmethod
from collections.abc import Callable
import numpy as np
from ..detection.types import Detection
# Optional cooperative-cancel hook: returns True to abort. Engines that loop or
# drive a subprocess should poll it; instant engines may ignore it.
CancelCheck = Callable[[], bool]
class Cancelled(Exception):
"""Raised by a Restorer when ``should_cancel`` asked it to stop."""
class Restorer(ABC):
@property
@@ -21,6 +30,15 @@ class Restorer(ABC):
return type(self).__name__
@abstractmethod
def restore(self, image: np.ndarray, detections: list[Detection]) -> np.ndarray:
"""Return a copy of ``image`` with the detected regions reconstructed."""
def restore(
self,
image: np.ndarray,
detections: list[Detection],
should_cancel: CancelCheck | None = None,
) -> np.ndarray:
"""Return a copy of ``image`` with the detected regions reconstructed.
``should_cancel`` (if given) is polled periodically; when it returns
True the engine should abort and raise :class:`Cancelled`.
"""
raise NotImplementedError