Compare commits

...

11 Commits

Author SHA1 Message Date
hoangngoc5275 d0e3f36ddf
Merge 2edde04570 into 6e618baf34 2024-09-28 20:27:11 +08:00
KRSHH 6e618baf34
Update README.md 2024-09-28 17:22:21 +05:30
KRSHH 0edcaae713
Merge pull request #650 from KRSHH/main
Preview video Frame by Frame using left and right arrow keys
2024-09-28 12:37:40 +05:30
KRSHH dff6cec2f9
Comment Indention fix 2024-09-27 20:59:48 +05:30
KRSHH 4d1d2c86af
Preview video Frame by Frame using left and right arrow keys 2024-09-27 20:40:32 +05:30
KRSHH e00c398825
Merge branch 'hacksider:main' into main 2024-09-27 20:20:22 +05:30
KRSHH 683481804c
Delete outdated docs directory 2024-09-26 11:03:46 +05:30
looman loras 2edde04570 Merge branch 'main' of https://github.com/hoangngoc5275/Deepface
* 'main' of https://github.com/hoangngoc5275/Deepface:
  Create python-package.yml
2024-09-18 17:18:02 +07:00
hoangngoc5275 5da4632c15
Merge branch 'hacksider:main' into main 2024-09-17 11:16:08 +07:00
hoangngoc5275 0f65be8bb3
Merge branch 'hacksider:main' into main 2024-09-16 20:53:42 +07:00
hoangngoc5275 d0faf924d1
Create python-package.yml
Signed-off-by: hoangngoc5275 <hoangngocngoc50@gmail.com>
2024-09-14 15:03:47 +07:00
5 changed files with 78 additions and 2 deletions

View File

@ -0,0 +1,40 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python package
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest

View File

@ -45,10 +45,16 @@ Track and change faces on the fly.
## Quick Start (Windows / Nvidia)
[![Download](https://github.com/user-attachments/assets/3e3e252a-4bfa-41fb-a88c-84557402a7c7)](https://hacksider.gumroad.com/l/vccdmm)
[Download latest pre-built version with CUDA support](https://hacksider.gumroad.com/l/vccdmm) - No Manual Installation/Downloading required.
## Installation (Manual)
Please be aware that the installation needs technical skills and is NOT for beginners. Please do NOT open platform and installation related issues on GitHub before discussing it on the discord server.
**Please be aware that the installation needs technical skills and is NOT for beginners, consider downloading the prebuilt. Please do NOT open platform and installation related issues on GitHub before discussing it on the discord server.**
### Basic Installation (CPU)
This is more likely to work on your computer but will be slower as it utilizes the CPU.
@ -386,3 +392,5 @@ This is an open-source project developed in our free time. Updates may be delaye
<a href="https://github.com/hacksider/Deep-Live-Cam/graphs/contributors" target="_blank">
<img src="https://contrib.rocks/image?repo=hacksider/Deep-Live-Cam" />
</a>
![Alt](https://repobeats.axiom.co/api/embed/fec8e29c45dfdb9c5916f3a7830e1249308d20e1.svg "Repobeats analytics image")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

View File

@ -5,7 +5,7 @@ from typing import Callable, Tuple
import cv2
from PIL import Image, ImageOps
import tkinterdnd2 as tkdnd
import time
import modules.globals
import modules.metadata
from modules.face_analyser import (
@ -682,6 +682,29 @@ def create_preview(parent: ctk.CTkToplevel) -> ctk.CTkToplevel:
)
preview_slider.pack(fill="x", padx=20, pady=10)
last_update_time = 0
debounce_delay = 0.1 # Adjust this delay as needed (in seconds)
def on_key_press(event):
nonlocal last_update_time
current_time = time.time()
if current_time - last_update_time > debounce_delay:
current_frame = int(preview_slider.get())
if event.keysym == "Left":
new_frame = max(0, current_frame - 1)
elif event.keysym == "Right":
new_frame = min(int(preview_slider.cget("to")), current_frame + 1)
else:
return # Ignore other key presses
preview_slider.set(new_frame)
update_preview(new_frame)
last_update_time = current_time
preview.bind("<Left>", on_key_press)
preview.bind("<Right>", on_key_press)
return preview
@ -879,6 +902,11 @@ def init_preview() -> None:
preview_slider.configure(to=video_frame_total)
preview_slider.pack(fill="x")
preview_slider.set(0)
# Disable slider if it's an image
if is_image(modules.globals.target_path):
preview_slider.configure(state="disabled")
else:
preview_slider.configure(state="normal")
def update_preview(frame_number: int = 0) -> None: