File size: 1,344 Bytes
747a865
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import gradio

from DeepFakeAI.uis.components import about, processors, execution, benchmark
from DeepFakeAI.utilities import conditional_download


def pre_check() -> bool:
	conditional_download('.assets/examples',
	[
		'https://github.com/DeepFakeAI/DeepFakeAI-assets/releases/download/examples/source.jpg',
		'https://github.com/DeepFakeAI/DeepFakeAI-assets/releases/download/examples/target-240p.mp4',
		'https://github.com/DeepFakeAI/DeepFakeAI-assets/releases/download/examples/target-360p.mp4',
		'https://github.com/DeepFakeAI/DeepFakeAI-assets/releases/download/examples/target-540p.mp4',
		'https://github.com/DeepFakeAI/DeepFakeAI-assets/releases/download/examples/target-720p.mp4',
		'https://github.com/DeepFakeAI/DeepFakeAI-assets/releases/download/examples/target-1080p.mp4',
		'https://github.com/DeepFakeAI/DeepFakeAI-assets/releases/download/examples/target-1440p.mp4',
		'https://github.com/DeepFakeAI/DeepFakeAI-assets/releases/download/examples/target-2160p.mp4'
	])
	return True


def render() -> gradio.Blocks:
	with gradio.Blocks() as layout:
		with gradio.Row():
			with gradio.Column(scale = 2):
				about.render()
				processors.render()
				execution.render()
			with gradio.Column(scale= 5):
				benchmark.render()
	return layout


def listen() -> None:
	processors.listen()
	execution.listen()
	benchmark.listen()