Compare commits

...

6 Commits

Author SHA1 Message Date
thongao1302 90c494dee9
Merge 99ebec28b8 into a4216bf9ec 2024-10-14 17:12:41 -07:00
Kenneth Estanislao a4216bf9ec
Update README.md
added tips and links
2024-10-14 19:54:21 +08:00
KRSHH ab26413ce8 on/off enhancer during inference and improve FPS counter 2024-10-13 13:16:21 +05:30
thongao1302 99ebec28b8 Merge branch 'main' into dependabot/pip/torch-2.2.0 2024-08-05 17:28:26 +07:00
thongao1302 01a822807c Merge branch 'main' into dependabot/pip/torch-2.2.0 2024-08-01 20:04:15 +07:00
dependabot[bot] 31f437ff79
Bump torch from 2.0.1 to 2.2.0
Bumps [torch](https://github.com/pytorch/pytorch) from 2.0.1 to 2.2.0.
- [Release notes](https://github.com/pytorch/pytorch/releases)
- [Changelog](https://github.com/pytorch/pytorch/blob/main/RELEASE.md)
- [Commits](https://github.com/pytorch/pytorch/compare/v2.0.1...v2.2.0)

---
updated-dependencies:
- dependency-name: torch
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-31 03:29:47 +00:00
6 changed files with 67 additions and 7 deletions

View File

@ -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"
}

14
.github/dependabot.yml vendored 100644
View File

@ -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

View File

@ -379,6 +379,10 @@ For the latest experimental builds and features, see the [experimental branch](h
This is an open-source project developed in our free time. Updates may be delayed.
**Tips and Links:**
- [How to make the most of Deep-Live-Cam](https://hacksider.gumroad.com/p/how-to-make-the-most-on-deep-live-cam)
- Face enhancer is good, but still very slow for any live streaming purpose.
## Credits

View File

@ -1,3 +1,4 @@
import sys
import importlib
from concurrent.futures import ThreadPoolExecutor

View File

@ -229,7 +229,7 @@ def create_root(start: Callable[[], None], destroy: Callable[[], None]) -> ctk.C
color_correction_value = ctk.BooleanVar(value=modules.globals.color_correction)
color_correction_switch = ctk.CTkSwitch(
root,
text="Fix Blueish Cam\n(force cv2 to use RGB instead of BGR)",
text="Fix Blueish Cam",
variable=color_correction_value,
cursor="hand2",
command=lambda: (
@ -514,6 +514,12 @@ def update_pop_live_status(text: str) -> None:
def update_tumbler(var: str, value: bool) -> None:
modules.globals.fp_ui[var] = value
save_switch_states()
# If we're currently in a live preview, update the frame processors
if PREVIEW.state() == "normal":
global frame_processors
frame_processors = get_frame_processors_modules(
modules.globals.frame_processors
)
def select_source_path() -> None:
@ -753,6 +759,8 @@ def create_webcam_preview(camera_index: int):
source_image = None
prev_time = time.time()
fps_update_interval = 0.5 # Update FPS every 0.5 seconds
frame_count = 0
fps = 0
while camera:
@ -775,22 +783,33 @@ def create_webcam_preview(camera_index: int):
source_image = get_one_face(cv2.imread(modules.globals.source_path))
for frame_processor in frame_processors:
if frame_processor.NAME == "DLC.FACE-ENHANCER":
if modules.globals.fp_ui["face_enhancer"]:
temp_frame = frame_processor.process_frame(None, temp_frame)
else:
temp_frame = frame_processor.process_frame(source_image, temp_frame)
else:
modules.globals.target_path = None
for frame_processor in frame_processors:
if frame_processor.NAME == "DLC.FACE-ENHANCER":
if modules.globals.fp_ui["face_enhancer"]:
temp_frame = frame_processor.process_frame_v2(temp_frame)
else:
temp_frame = frame_processor.process_frame_v2(temp_frame)
# Calculate and display FPS
current_time = time.time()
fps = 1 / (current_time - prev_time)
frame_count += 1
if current_time - prev_time >= fps_update_interval:
fps = frame_count / (current_time - prev_time)
frame_count = 0
prev_time = current_time
if modules.globals.show_fps:
cv2.putText(
temp_frame,
f"FPS: {fps:.2f}",
f"FPS: {fps:.1f}",
(10, 30),
cv2.FONT_HERSHEY_SIMPLEX,
1,

View File

@ -10,7 +10,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-silicon==1.16.3; sys_platform == 'darwin' and platform_machine == 'arm64'