Compare commits
6 Commits
3087f26709
...
41d60d529f
Author | SHA1 | Date |
---|---|---|
|
41d60d529f | |
|
40598daea9 | |
|
528c30e3ba | |
|
99ebec28b8 | |
|
01a822807c | |
|
31f437ff79 |
|
@ -0,0 +1,22 @@
|
|||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
||||
// README at: https://github.com/devcontainers/templates/tree/main/src/alpine
|
||||
{
|
||||
"name": "Alpine",
|
||||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
|
||||
"image": "mcr.microsoft.com/devcontainers/base:alpine-3.20"
|
||||
|
||||
// Features to add to the dev container. More info: https://containers.dev/features.
|
||||
// "features": {},
|
||||
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
// "forwardPorts": [],
|
||||
|
||||
// Use 'postCreateCommand' to run commands after the container is created.
|
||||
// "postCreateCommand": "uname -a",
|
||||
|
||||
// Configure tool-specific properties.
|
||||
// "customizations": {},
|
||||
|
||||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
||||
// "remoteUser": "root"
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
# To get started with Dependabot version updates, you'll need to specify which
|
||||
# package ecosystems to update and where the package manifests are located.
|
||||
# Please see the documentation for more information:
|
||||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||
# https://containers.dev/guide/dependabot
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "devcontainers"
|
||||
directory: "/"
|
||||
schedule:
|
||||
|
||||
|
||||
interval: weekly
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
import sys
|
||||
import importlib
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
|
|
|
@ -66,6 +66,9 @@ def create_root(start: Callable[[], None], destroy: Callable[[], None]) -> ctk.C
|
|||
select_face_button = ctk.CTkButton(root, text='Select a face', cursor='hand2', command=lambda: select_source_path())
|
||||
select_face_button.place(relx=0.1, rely=0.4, relwidth=0.3, relheight=0.1)
|
||||
|
||||
swap_faces_button = ctk.CTkButton(root, text='↔', cursor='hand2', command=lambda: swap_faces_paths())
|
||||
swap_faces_button.place(relx=0.45, rely=0.4, relwidth=0.1, relheight=0.1)
|
||||
|
||||
select_target_button = ctk.CTkButton(root, text='Select a target', cursor='hand2', command=lambda: select_target_path())
|
||||
select_target_button.place(relx=0.6, rely=0.4, relwidth=0.3, relheight=0.1)
|
||||
|
||||
|
@ -159,6 +162,30 @@ def select_source_path() -> None:
|
|||
source_label.configure(image=None)
|
||||
|
||||
|
||||
def swap_faces_paths() -> None:
|
||||
global RECENT_DIRECTORY_SOURCE, RECENT_DIRECTORY_TARGET
|
||||
|
||||
source_path = modules.globals.source_path
|
||||
target_path = modules.globals.target_path
|
||||
|
||||
if not is_image(source_path) or not is_image(target_path):
|
||||
return
|
||||
|
||||
modules.globals.source_path = target_path
|
||||
modules.globals.target_path = source_path
|
||||
|
||||
RECENT_DIRECTORY_SOURCE = os.path.dirname(modules.globals.source_path)
|
||||
RECENT_DIRECTORY_TARGET = os.path.dirname(modules.globals.target_path)
|
||||
|
||||
PREVIEW.withdraw()
|
||||
|
||||
source_image = render_image_preview(modules.globals.source_path, (200, 200))
|
||||
source_label.configure(image=source_image)
|
||||
|
||||
target_image = render_image_preview(modules.globals.target_path, (200, 200))
|
||||
target_label.configure(image=target_image)
|
||||
|
||||
|
||||
def select_target_path() -> None:
|
||||
global RECENT_DIRECTORY_TARGET, img_ft, vid_ft
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ tk==0.1.0
|
|||
customtkinter==5.2.2
|
||||
pillow==9.5.0
|
||||
torch==2.0.1+cu118; sys_platform != 'darwin'
|
||||
torch==2.0.1; sys_platform == 'darwin'
|
||||
torch==2.2.0; sys_platform == 'darwin'
|
||||
torchvision==0.15.2+cu118; sys_platform != 'darwin'
|
||||
torchvision==0.15.2; sys_platform == 'darwin'
|
||||
onnxruntime==1.18.0; sys_platform == 'darwin' and platform_machine != 'arm64'
|
||||
|
|
Loading…
Reference in New Issue