Refactor HVideoTool's configuration and project management: updated project handling in core/project.py, streamlined restoration settings in config.py, and improved documentation in CLAUDE.md. Removed unused parameters and enhanced type hints for better clarity.

This commit is contained in:
Leonid Pershin
2026-06-07 06:33:00 +03:00
parent 9c471ca701
commit ac02ca27a8
16 changed files with 81 additions and 105 deletions
+3 -3
View File
@@ -3,10 +3,10 @@
from __future__ import annotations
from dataclasses import dataclass, field
from enum import Enum
from enum import StrEnum
class CensorType(str, Enum):
class CensorType(StrEnum):
"""Kind of already-applied censorship a detection represents."""
MOSAIC = "mosaic"
@@ -33,7 +33,7 @@ class Detection:
}
@classmethod
def from_dict(cls, data: dict) -> "Detection":
def from_dict(cls, data: dict) -> Detection:
return cls(
type=CensorType(data["type"]),
score=float(data["score"]),
+1 -3
View File
@@ -16,8 +16,6 @@ from __future__ import annotations
import os
import numpy as np
from ...config import DetectionConfig
from ..video.frame import Frame
from .base import Detector
@@ -61,7 +59,7 @@ class YoloDetector(Detector):
import torch
cuda_ok = torch.cuda.is_available()
except Exception: # noqa: BLE001
except Exception:
cuda_ok = False
device = self.cfg.yolo_device
if device is None: