Layout polishing (#731)
This commit is contained in:
parent
fa77589f67
commit
31e367b759
@ -1,3 +1,9 @@
|
||||
:root:root:root:root .gradio-container
|
||||
{
|
||||
max-width: 110em;
|
||||
overflow: unset;
|
||||
}
|
||||
|
||||
:root:root:root:root input[type="number"]
|
||||
{
|
||||
max-width: 6rem;
|
||||
@ -71,3 +77,10 @@
|
||||
margin: 0.5rem 0.75rem;
|
||||
padding: unset;
|
||||
}
|
||||
|
||||
:root:root:root:root .image-preview
|
||||
{
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 100;
|
||||
}
|
||||
|
@ -29,7 +29,8 @@ def render() -> None:
|
||||
|
||||
preview_image_options : ComponentOptions =\
|
||||
{
|
||||
'label': wording.get('uis.preview_image')
|
||||
'label': wording.get('uis.preview_image'),
|
||||
'elem_classes': [ 'image-preview' ]
|
||||
}
|
||||
preview_frame_slider_options : ComponentOptions =\
|
||||
{
|
||||
@ -174,7 +175,7 @@ def clear_and_update_preview_image(frame_number : int = 0) -> gradio.Image:
|
||||
def slide_preview_image(frame_number : int = 0) -> gradio.Image:
|
||||
if is_video(state_manager.get_item('target_path')):
|
||||
preview_vision_frame = normalize_frame_color(get_video_frame(state_manager.get_item('target_path'), frame_number))
|
||||
preview_vision_frame = resize_frame_resolution(preview_vision_frame, (640, 640))
|
||||
preview_vision_frame = resize_frame_resolution(preview_vision_frame, (1024, 1024))
|
||||
return gradio.Image(value = preview_vision_frame)
|
||||
return gradio.Image(value = None)
|
||||
|
||||
@ -220,7 +221,7 @@ def update_preview_frame_slider() -> gradio.Slider:
|
||||
|
||||
|
||||
def process_preview_frame(reference_faces : FaceSet, source_face : Face, source_audio_frame : AudioFrame, target_vision_frame : VisionFrame) -> VisionFrame:
|
||||
target_vision_frame = resize_frame_resolution(target_vision_frame, (640, 640))
|
||||
target_vision_frame = resize_frame_resolution(target_vision_frame, (1024, 1024))
|
||||
source_vision_frame = target_vision_frame.copy()
|
||||
if analyse_frame(target_vision_frame):
|
||||
return cv2.GaussianBlur(target_vision_frame, (99, 99), 0)
|
||||
|
@ -81,7 +81,7 @@ def register_ui_component(component_name : ComponentName, component: Component)
|
||||
|
||||
def launch() -> None:
|
||||
ui_layouts_total = len(state_manager.get_item('ui_layouts'))
|
||||
with gradio.Blocks(theme = get_theme(), css = get_css(), title = metadata.get('name') + ' ' + metadata.get('version')) as ui:
|
||||
with gradio.Blocks(theme = get_theme(), css = get_css(), title = metadata.get('name') + ' ' + metadata.get('version'), fill_width = True) as ui:
|
||||
for ui_layout in state_manager.get_item('ui_layouts'):
|
||||
ui_layout_module = load_ui_layout_module(ui_layout)
|
||||
if ui_layout_module.pre_render():
|
||||
|
@ -30,7 +30,7 @@ def pre_render() -> bool:
|
||||
def render() -> gradio.Blocks:
|
||||
with gradio.Blocks() as layout:
|
||||
with gradio.Row():
|
||||
with gradio.Column(scale = 2):
|
||||
with gradio.Column(scale = 4):
|
||||
with gradio.Blocks():
|
||||
about.render()
|
||||
with gradio.Blocks():
|
||||
@ -61,7 +61,7 @@ def render() -> gradio.Blocks:
|
||||
memory.render()
|
||||
with gradio.Blocks():
|
||||
benchmark_options.render()
|
||||
with gradio.Column(scale = 5):
|
||||
with gradio.Column(scale = 11):
|
||||
with gradio.Blocks():
|
||||
benchmark.render()
|
||||
return layout
|
||||
|
@ -15,7 +15,7 @@ def pre_render() -> bool:
|
||||
def render() -> gradio.Blocks:
|
||||
with gradio.Blocks() as layout:
|
||||
with gradio.Row():
|
||||
with gradio.Column(scale = 2):
|
||||
with gradio.Column(scale = 4):
|
||||
with gradio.Blocks():
|
||||
about.render()
|
||||
with gradio.Blocks():
|
||||
@ -48,7 +48,7 @@ def render() -> gradio.Blocks:
|
||||
temp_frame.render()
|
||||
with gradio.Blocks():
|
||||
output_options.render()
|
||||
with gradio.Column(scale = 2):
|
||||
with gradio.Column(scale = 4):
|
||||
with gradio.Blocks():
|
||||
source.render()
|
||||
with gradio.Blocks():
|
||||
@ -62,7 +62,7 @@ def render() -> gradio.Blocks:
|
||||
instant_runner.render()
|
||||
job_runner.render()
|
||||
job_manager.render()
|
||||
with gradio.Column(scale = 3):
|
||||
with gradio.Column(scale = 7):
|
||||
with gradio.Blocks():
|
||||
preview.render()
|
||||
with gradio.Blocks():
|
||||
|
@ -15,12 +15,12 @@ def pre_render() -> bool:
|
||||
def render() -> gradio.Blocks:
|
||||
with gradio.Blocks() as layout:
|
||||
with gradio.Row():
|
||||
with gradio.Column(scale = 2):
|
||||
with gradio.Column(scale = 4):
|
||||
with gradio.Blocks():
|
||||
about.render()
|
||||
with gradio.Blocks():
|
||||
job_list_options.render()
|
||||
with gradio.Column(scale = 5):
|
||||
with gradio.Column(scale = 11):
|
||||
with gradio.Blocks():
|
||||
job_list.render()
|
||||
return layout
|
||||
|
@ -15,7 +15,7 @@ def pre_render() -> bool:
|
||||
def render() -> gradio.Blocks:
|
||||
with gradio.Blocks() as layout:
|
||||
with gradio.Row():
|
||||
with gradio.Column(scale = 2):
|
||||
with gradio.Column(scale = 4):
|
||||
with gradio.Blocks():
|
||||
about.render()
|
||||
with gradio.Blocks():
|
||||
@ -41,7 +41,7 @@ def render() -> gradio.Blocks:
|
||||
webcam_options.render()
|
||||
with gradio.Blocks():
|
||||
source.render()
|
||||
with gradio.Column(scale = 5):
|
||||
with gradio.Column(scale = 11):
|
||||
with gradio.Blocks():
|
||||
webcam.render()
|
||||
return layout
|
||||
|
Loading…
Reference in New Issue
Block a user