Shellbrady/LivePortrait112w
0
1# coding: utf-82 3"""4config for user5"""6 7import os.path as osp8from dataclasses import dataclass9import tyro10from typing_extensions import Annotated11from typing import Optional12from .base_config import PrintableConfig, make_abs_path13 14 15@dataclass(repr=False) # use repr from PrintableConfig16class ArgumentConfig(PrintableConfig):17 ########## input arguments ##########18 source_image: Annotated[str, tyro.conf.arg(aliases=["-s"])] = make_abs_path('../../assets/examples/source/s6.jpg') # path to the source portrait19 driving_info: Annotated[str, tyro.conf.arg(aliases=["-d"])] = make_abs_path('../../assets/examples/driving/d0.mp4') # path to driving video or template (.pkl format)20 output_dir: Annotated[str, tyro.conf.arg(aliases=["-o"])] = 'animations/' # directory to save output video21 #####################################22 23 ########## inference arguments ##########24 device_id: int = 025 flag_lip_zero : bool = True # whether let the lip to close state before animation, only take effect when flag_eye_retargeting and flag_lip_retargeting is False26 flag_eye_retargeting: bool = False27 flag_lip_retargeting: bool = False28 flag_stitching: bool = True # we recommend setting it to True!29 flag_relative: bool = True # whether to use relative motion30 flag_pasteback: bool = True # whether to paste-back/stitch the animated face cropping from the face-cropping space to the original image space31 flag_do_crop: bool = True # whether to crop the source portrait to the face-cropping space32 flag_do_rot: bool = True # whether to conduct the rotation when flag_do_crop is True33 #########################################34 35 ########## crop arguments ##########36 dsize: int = 51237 scale: float = 2.338 vx_ratio: float = 0 # vx ratio39 vy_ratio: float = -0.125 # vy ratio +up, -down40 ####################################41 42 ########## gradio arguments ##########43 server_port: Annotated[int, tyro.conf.arg(aliases=["-p"])] = 786044 share: bool = False45 server_name: Optional[str] = None # one can set "0.0.0.0" on local46 