Spaces:
Running
Running
imseldrith
commited on
Commit
•
6f58781
1
Parent(s):
a63ca96
Update DeepFakeAI/uis/components/preview.py
Browse files
DeepFakeAI/uis/components/preview.py
CHANGED
@@ -40,13 +40,13 @@ def render() -> None:
|
|
40 |
temp_frame = get_video_frame(DeepFakeAI.globals.target_path, DeepFakeAI.globals.reference_frame_number)
|
41 |
preview_frame = extract_preview_frame(temp_frame)
|
42 |
preview_image_args['value'] = ui.normalize_frame(preview_frame)
|
43 |
-
preview_image_args['visible'] =
|
44 |
preview_frame_slider_args['value'] = DeepFakeAI.globals.reference_frame_number
|
45 |
preview_frame_slider_args['maximum'] = get_video_frame_total(DeepFakeAI.globals.target_path)
|
46 |
-
preview_frame_slider_args['visible'] =
|
47 |
PREVIEW_IMAGE = gradio.Image(**preview_image_args)
|
48 |
PREVIEW_FRAME_SLIDER = gradio.Slider(**preview_frame_slider_args)
|
49 |
-
|
50 |
|
51 |
|
52 |
def listen() -> None:
|
@@ -87,7 +87,7 @@ def update(frame_number : int = 0) -> Tuple[Update, Update]:
|
|
87 |
video_frame_total = get_video_frame_total(DeepFakeAI.globals.target_path)
|
88 |
temp_frame = get_video_frame(DeepFakeAI.globals.target_path, DeepFakeAI.globals.reference_frame_number)
|
89 |
preview_frame = extract_preview_frame(temp_frame)
|
90 |
-
return gradio.update(value = ui.normalize_frame(preview_frame)), gradio.update(maximum = video_frame_total, visible =
|
91 |
return gradio.update(value = None), gradio.update(value = None, maximum = None, visible = False)
|
92 |
|
93 |
|
|
|
40 |
temp_frame = get_video_frame(DeepFakeAI.globals.target_path, DeepFakeAI.globals.reference_frame_number)
|
41 |
preview_frame = extract_preview_frame(temp_frame)
|
42 |
preview_image_args['value'] = ui.normalize_frame(preview_frame)
|
43 |
+
preview_image_args['visible'] = True
|
44 |
preview_frame_slider_args['value'] = DeepFakeAI.globals.reference_frame_number
|
45 |
preview_frame_slider_args['maximum'] = get_video_frame_total(DeepFakeAI.globals.target_path)
|
46 |
+
preview_frame_slider_args['visible'] = True
|
47 |
PREVIEW_IMAGE = gradio.Image(**preview_image_args)
|
48 |
PREVIEW_FRAME_SLIDER = gradio.Slider(**preview_frame_slider_args)
|
49 |
+
ui.register_component('preview_frame_slider', PREVIEW_FRAME_SLIDER)
|
50 |
|
51 |
|
52 |
def listen() -> None:
|
|
|
87 |
video_frame_total = get_video_frame_total(DeepFakeAI.globals.target_path)
|
88 |
temp_frame = get_video_frame(DeepFakeAI.globals.target_path, DeepFakeAI.globals.reference_frame_number)
|
89 |
preview_frame = extract_preview_frame(temp_frame)
|
90 |
+
return gradio.update(value = ui.normalize_frame(preview_frame)), gradio.update(maximum = video_frame_total, visible = True)
|
91 |
return gradio.update(value = None), gradio.update(value = None, maximum = None, visible = False)
|
92 |
|
93 |
|