Добавлено описание и документация для HVideoTool, включая функционал, требования, установку и запуск приложения для обнаружения цензуры на изображениях.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
"""Detector interface. Implement this to plug in a new model (e.g. YOLO)."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
from ..video.frame import Frame
|
||||
from .types import Detection
|
||||
|
||||
|
||||
class Detector(ABC):
|
||||
"""Abstract censorship detector.
|
||||
|
||||
Implementations must be safe to call repeatedly on consecutive frames. They
|
||||
receive a :class:`Frame` and return detections in *source-frame* pixel
|
||||
coordinates (the same resolution as ``frame.image``).
|
||||
"""
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
return type(self).__name__
|
||||
|
||||
@abstractmethod
|
||||
def detect(self, frame: Frame) -> list[Detection]:
|
||||
"""Return detected censored regions for ``frame`` (possibly empty)."""
|
||||
raise NotImplementedError
|
||||
Reference in New Issue
Block a user