wav2lipEx

package module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gfpgan

type Gfpgan interface {
	InferenceGfpgan(ctx context.Context, input, output string, ver gfpgan.Version, options ...[]string) error
}

type Option

type Option func(*Wav2lipEx)

func WithFfmpeg

func WithFfmpeg(ffmpeg *ffmpeg.Exec) Option

func WithGfpgan

func WithGfpgan(gfpgan Gfpgan) Option

func WithLogger

func WithLogger(logger *zap.Logger) Option

func WithWav2Lip

func WithWav2Lip(wav2Lip Wav2Lip) Option

type Paras

type Paras struct {
	// ModifyFace 更换脸部, 传入脸部照片/视频
	//ModifyFace string
	// UseEsrgan 默认使用gfpgan;你也可以将此参数设置TRUE,这将使用ESRGAN。gfpgan用于修复人脸,esrgan用于修复景色和动漫
	UseEsrgan bool
	// Nosmooth 防止在短时间窗口内平滑人脸检测
	Nosmooth bool
	// Pads 内边距(上、下、左、右)。 请调整至至少包括下巴
	Pads []uint
	// NoRepair 不修复照片
	NoRepair bool
}

type Wav2Lip

type Wav2Lip interface {
	Inference(ctx context.Context, checkPointPath wav2Lip.CheckPoint, face, audio, outFile string, options ...[]string) error
}

type Wav2lipEx

type Wav2lipEx struct {
	// contains filtered or unexported fields
}

func New

func New(options ...Option) (*Wav2lipEx, error)

func (*Wav2lipEx) GenerateVideo

func (w *Wav2lipEx) GenerateVideo(ctx context.Context, input, audio, output string, pars Paras) (err error)

GenerateVideo 生成视频,传入一段嘴巴闭合状态的视频/图像和一段音频,将输出视频唇形与音频同步的画面到指定文件下. 会在输出目录下创建一个用于存放高清修复后的照片, 创建文件夹名字随机起名, 如果推理成功, 那么会自动清理该自动创建的文件夹, 如果推理失败 则会保留高清修复输出的图片

Directories

Path Synopsis
services

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL