Spaces:
Running
Running
File size: 1,342 Bytes
02c4dcb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
from collections import namedtuple
from typing import Any, Literal, Callable, List, Tuple, Dict, TypedDict
import numpy
Bbox = numpy.ndarray[Any, Any]
Kps = numpy.ndarray[Any, Any]
Score = float
Embedding = numpy.ndarray[Any, Any]
Face = namedtuple('Face',
[
'bbox',
'kps',
'score',
'embedding',
'normed_embedding',
'gender',
'age'
])
Frame = numpy.ndarray[Any, Any]
Matrix = numpy.ndarray[Any, Any]
Padding = Tuple[int, int, int, int]
Update_Process = Callable[[], None]
Process_Frames = Callable[[str, List[str], Update_Process], None]
Template = Literal['arcface_v1', 'arcface_v2', 'ffhq']
ProcessMode = Literal['output', 'preview', 'stream']
FaceSelectorMode = Literal['reference', 'one', 'many']
FaceAnalyserOrder = Literal['left-right', 'right-left', 'top-bottom', 'bottom-top', 'small-large', 'large-small', 'best-worst', 'worst-best']
FaceAnalyserAge = Literal['child', 'teen', 'adult', 'senior']
FaceAnalyserGender = Literal['male', 'female']
FaceDetectorModel = Literal['retinaface', 'yunet']
FaceRecognizerModel = Literal['arcface_blendface', 'arcface_inswapper', 'arcface_simswap']
TempFrameFormat = Literal['jpg', 'png']
OutputVideoEncoder = Literal['libx264', 'libx265', 'libvpx-vp9', 'h264_nvenc', 'hevc_nvenc']
ModelValue = Dict[str, Any]
OptionsWithModel = TypedDict('OptionsWithModel',
{
'model' : ModelValue
})
|