diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md deleted file mode 100644 index 2f8a6fd..0000000 --- a/.github/ISSUE_TEMPLATE/bug.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -name: Bug -about: Report a bug -title: '[Bug]' -labels: 'bug' - ---- - -## Description - -A concise description of the bug and how to reproduce it. - -## Error - -Paste the error or exception from your console: - -``` - -``` - -## Details - -What operating system are you using? - -- [ ] Windows -- [ ] MacOS (Apple Silicon) -- [ ] MacOS (Apple Legacy) -- [ ] Linux -- [ ] Linux in WSL - -What execution provider are you using? - -- [ ] CPU -- [ ] CUDA -- [ ] CoreML -- [ ] DirectML -- [ ] OpenVINO -- [ ] Other - -What version of Roop are you using? - -- [ ] 1.0.0 -- [ ] 1.1.0 -- [ ] 1.2.0 -- [ ] next diff --git a/.github/ISSUE_TEMPLATE/installation.md b/.github/ISSUE_TEMPLATE/installation.md deleted file mode 100644 index 966417b..0000000 --- a/.github/ISSUE_TEMPLATE/installation.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -name: Installation -about: Platform and installation issues -title: '[Installation]' -labels: 'installation' - ---- - -Please **DO NOT OPEN** platform and installation issues! - -- Check the [troubleshooting](https://github.com/s0md3v/roop/wiki/4.-Troubleshooting) that covers many issues. -- Join our helpful community on [Discord](https://discord.gg/Y9p4ZQ2sB9) for instant help. diff --git a/.github/examples/snapshot.mp4 b/.github/examples/snapshot.mp4 deleted file mode 100644 index d2557ac..0000000 Binary files a/.github/examples/snapshot.mp4 and /dev/null differ diff --git a/.github/examples/source.jpg b/.github/examples/source.jpg deleted file mode 100644 index bdaa5e4..0000000 Binary files a/.github/examples/source.jpg and /dev/null differ diff --git a/.github/examples/target.mp4 b/.github/examples/target.mp4 deleted file mode 100644 index a8f3f6f..0000000 Binary files a/.github/examples/target.mp4 and /dev/null differ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 420a32d..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: ci - -on: [ push, pull_request ] - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Set up Python 3.9 - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - run: pip install flake8 - - run: pip install mypy - - run: flake8 run.py roop - - run: mypy run.py roop - test: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Set up ffmpeg - uses: FedericoCarboni/setup-ffmpeg@v2 - - name: Set up Python 3.9 - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - run: pip install -r requirements-ci.txt - - run: python run.py -s=.github/examples/source.jpg -t=.github/examples/target.mp4 -o=.github/examples/output.mp4 - - run: ffmpeg -i .github/examples/snapshot.mp4 -i .github/examples/output.mp4 -filter_complex psnr -f null - - diff --git a/roop/ui.py b/roop/ui.py index 67ec32a..c4ad8c2 100644 --- a/roop/ui.py +++ b/roop/ui.py @@ -11,7 +11,11 @@ import roop.globals import roop.metadata from roop.face_analyser import get_one_face from roop.capturer import get_video_frame, get_video_frame_total -from roop.face_reference import get_face_reference, set_face_reference, clear_face_reference +from roop.face_reference import ( + get_face_reference, + set_face_reference, + clear_face_reference, +) from roop.predictor import predict_frame, clear_predictor from roop.processors.frame.core import get_frame_processors_modules from roop.utilities import is_image, is_video, resolve_relative_path @@ -55,67 +59,132 @@ def create_root(start: Callable[[], None], destroy: Callable[[], None]) -> ctk.C global source_label, target_label, status_label ctk.deactivate_automatic_dpi_awareness() - ctk.set_appearance_mode('system') - ctk.set_default_color_theme(resolve_relative_path('ui.json')) + ctk.set_appearance_mode("system") + ctk.set_default_color_theme(resolve_relative_path("ui.json")) root = CTk() root.minsize(ROOT_WIDTH, ROOT_HEIGHT) - root.title(f'{roop.metadata.name} {roop.metadata.version}') + root.title(f"{roop.metadata.name} {roop.metadata.version}") root.configure() - root.protocol('WM_DELETE_WINDOW', lambda: destroy()) + root.protocol("WM_DELETE_WINDOW", lambda: destroy()) - source_label = ctk.CTkLabel(root, text=None, fg_color=ctk.ThemeManager.theme.get('RoopDropArea').get('fg_color')) + source_label = ctk.CTkLabel( + root, + text=None, + fg_color=ctk.ThemeManager.theme.get("RoopDropArea").get("fg_color"), + ) source_label.place(relx=0.1, rely=0.1, relwidth=0.3, relheight=0.25) source_label.drop_target_register(DND_ALL) - source_label.dnd_bind('<>', lambda event: select_source_path(event.data)) + source_label.dnd_bind("<>", lambda event: select_source_path(event.data)) if roop.globals.source_path: select_source_path(roop.globals.source_path) - target_label = ctk.CTkLabel(root, text=None, fg_color=ctk.ThemeManager.theme.get('RoopDropArea').get('fg_color')) + target_label = ctk.CTkLabel( + root, + text=None, + fg_color=ctk.ThemeManager.theme.get("RoopDropArea").get("fg_color"), + ) target_label.place(relx=0.6, rely=0.1, relwidth=0.3, relheight=0.25) target_label.drop_target_register(DND_ALL) - target_label.dnd_bind('<>', lambda event: select_target_path(event.data)) + target_label.dnd_bind("<>", lambda event: select_target_path(event.data)) if roop.globals.target_path: select_target_path(roop.globals.target_path) - source_button = ctk.CTkButton(root, text='Select a face', cursor='hand2', command=lambda: select_source_path()) + source_button = ctk.CTkButton( + root, text="Select a face", cursor="hand2", command=lambda: select_source_path() + ) source_button.place(relx=0.1, rely=0.4, relwidth=0.3, relheight=0.1) - target_button = ctk.CTkButton(root, text='Select a target', cursor='hand2', command=lambda: select_target_path()) + target_button = ctk.CTkButton( + root, + text="Select a target", + cursor="hand2", + command=lambda: select_target_path(), + ) target_button.place(relx=0.6, rely=0.4, relwidth=0.3, relheight=0.1) keep_fps_value = ctk.BooleanVar(value=roop.globals.keep_fps) - keep_fps_checkbox = ctk.CTkSwitch(root, text='Keep target fps', variable=keep_fps_value, cursor='hand2', command=lambda: setattr(roop.globals, 'keep_fps', not roop.globals.keep_fps)) + keep_fps_checkbox = ctk.CTkSwitch( + root, + text="Keep target fps", + variable=keep_fps_value, + cursor="hand2", + command=lambda: setattr(roop.globals, "keep_fps", not roop.globals.keep_fps), + ) keep_fps_checkbox.place(relx=0.1, rely=0.6) keep_frames_value = ctk.BooleanVar(value=roop.globals.keep_frames) - keep_frames_switch = ctk.CTkSwitch(root, text='Keep temporary frames', variable=keep_frames_value, cursor='hand2', command=lambda: setattr(roop.globals, 'keep_frames', keep_frames_value.get())) + keep_frames_switch = ctk.CTkSwitch( + root, + text="Keep temporary frames", + variable=keep_frames_value, + cursor="hand2", + command=lambda: setattr(roop.globals, "keep_frames", keep_frames_value.get()), + ) keep_frames_switch.place(relx=0.1, rely=0.65) skip_audio_value = ctk.BooleanVar(value=roop.globals.skip_audio) - skip_audio_switch = ctk.CTkSwitch(root, text='Skip target audio', variable=skip_audio_value, cursor='hand2', command=lambda: setattr(roop.globals, 'skip_audio', skip_audio_value.get())) + skip_audio_switch = ctk.CTkSwitch( + root, + text="Skip target audio", + variable=skip_audio_value, + cursor="hand2", + command=lambda: setattr(roop.globals, "skip_audio", skip_audio_value.get()), + ) skip_audio_switch.place(relx=0.6, rely=0.6) many_faces_value = ctk.BooleanVar(value=roop.globals.many_faces) - many_faces_switch = ctk.CTkSwitch(root, text='Many faces', variable=many_faces_value, cursor='hand2', command=lambda: setattr(roop.globals, 'many_faces', many_faces_value.get())) + many_faces_switch = ctk.CTkSwitch( + root, + text="Many faces", + variable=many_faces_value, + cursor="hand2", + command=lambda: setattr(roop.globals, "many_faces", many_faces_value.get()), + ) many_faces_switch.place(relx=0.6, rely=0.65) - start_button = ctk.CTkButton(root, text='Start', cursor='hand2', command=lambda: select_output_path(start)) + # Add a slider for video quality + video_quality_label = ctk.CTkLabel(root, text="Quality", justify="center") + video_quality_label.place(relx=0.1, rely=0.5, relwidth=0.3, relheight=0.1) + + video_quality_value = ctk.IntVar(value=25) # Set a default value for video quality + video_quality_slider = ctk.CTkSlider( + root, + from_=0, + to=51, + variable=video_quality_value, + cursor="hand2", + ) + video_quality_slider.place(relx=0.4, rely=0.5, relwidth=0.9, relheight=0.01) + + start_button = ctk.CTkButton( + root, text="Start", cursor="hand2", command=lambda: select_output_path(start) + ) start_button.place(relx=0.15, rely=0.75, relwidth=0.2, relheight=0.05) - stop_button = ctk.CTkButton(root, text='Destroy', cursor='hand2', command=lambda: destroy()) + stop_button = ctk.CTkButton( + root, text="Destroy", cursor="hand2", command=lambda: destroy() + ) stop_button.place(relx=0.4, rely=0.75, relwidth=0.2, relheight=0.05) - preview_button = ctk.CTkButton(root, text='Preview', cursor='hand2', command=lambda: toggle_preview()) + preview_button = ctk.CTkButton( + root, text="Preview", cursor="hand2", command=lambda: toggle_preview() + ) preview_button.place(relx=0.65, rely=0.75, relwidth=0.2, relheight=0.05) - status_label = ctk.CTkLabel(root, text=None, justify='center') + status_label = ctk.CTkLabel(root, text=None, justify="center") status_label.place(relx=0.1, rely=0.9, relwidth=0.8) - donate_label = ctk.CTkLabel(root, text='^_^ Donate to project ^_^', justify='center', cursor='hand2') + donate_label = ctk.CTkLabel( + root, text="^_^ Donate to project ^_^", justify="center", cursor="hand2" + ) donate_label.place(relx=0.1, rely=0.95, relwidth=0.8) - donate_label.configure(text_color=ctk.ThemeManager.theme.get('RoopDonate').get('text_color')) - donate_label.bind('