root
commited on
Commit
·
48fea0f
1
Parent(s):
e845b5e
fix
Browse files- extract_dwpose_from_vid.py +3 -0
- handler.py +1 -1
- requirements.txt +1 -0
- sampler.py +2 -2
- src/dwpose/__pycache__/wholebody.cpython-310.pyc +0 -0
- src/dwpose/wholebody.py +2 -2
extract_dwpose_from_vid.py
CHANGED
|
@@ -4,6 +4,9 @@ import random
|
|
| 4 |
from pathlib import Path
|
| 5 |
|
| 6 |
import numpy as np
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
from src.dwpose import DWposeDetector
|
| 9 |
from src.utils.util import get_fps, read_frames, save_videos_from_pil
|
|
|
|
| 4 |
from pathlib import Path
|
| 5 |
|
| 6 |
import numpy as np
|
| 7 |
+
import sys
|
| 8 |
+
|
| 9 |
+
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), 'src')))
|
| 10 |
|
| 11 |
from src.dwpose import DWposeDetector
|
| 12 |
from src.utils.util import get_fps, read_frames, save_videos_from_pil
|
handler.py
CHANGED
|
@@ -367,7 +367,7 @@ class EndpointHandler():
|
|
| 367 |
# Perform face swapping
|
| 368 |
# self.print_directory_contents(temp_dir)
|
| 369 |
swapped_face_video_path = os.path.join(save_dir, "swapped_face_output.mp4")
|
| 370 |
-
self._swap_face(
|
| 371 |
|
| 372 |
# Slow down the produced video by 4x
|
| 373 |
self.print_directory_contents(temp_dir)
|
|
|
|
| 367 |
# Perform face swapping
|
| 368 |
# self.print_directory_contents(temp_dir)
|
| 369 |
swapped_face_video_path = os.path.join(save_dir, "swapped_face_output.mp4")
|
| 370 |
+
self._swap_face(cropped_face_path, animation_path, swapped_face_video_path)
|
| 371 |
|
| 372 |
# Slow down the produced video by 4x
|
| 373 |
self.print_directory_contents(temp_dir)
|
requirements.txt
CHANGED
|
@@ -57,3 +57,4 @@ requests==2.32.3
|
|
| 57 |
|
| 58 |
|
| 59 |
rembg
|
|
|
|
|
|
| 57 |
|
| 58 |
|
| 59 |
rembg
|
| 60 |
+
mediapipe
|
sampler.py
CHANGED
|
@@ -10,8 +10,8 @@ handler = EndpointHandler()
|
|
| 10 |
# Define sample inputs
|
| 11 |
inputs = {
|
| 12 |
"inputs": {
|
| 13 |
-
"ref_image_url": "https://
|
| 14 |
-
"video_url": "https://cdn.discordapp.com/attachments/1237667074210267217/
|
| 15 |
"length": 24,
|
| 16 |
"num_inference_steps": 25,
|
| 17 |
"cfg": 3.5,
|
|
|
|
| 10 |
# Define sample inputs
|
| 11 |
inputs = {
|
| 12 |
"inputs": {
|
| 13 |
+
"ref_image_url": "https://cdn.discordapp.com/attachments/1237667074210267217/1246520694142140539/image.jpg?ex=665cb05c&is=665b5edc&hm=364c379a4ddba3755cf89df7012d57b8f2816c50cb310aa64f8cd2eaa96b725f&",
|
| 14 |
+
"video_url": "https://cdn.discordapp.com/attachments/1237667074210267217/1246520695106699344/pose.mov?ex=665cb05c&is=665b5edc&hm=e4e99524fe1d6d9569ea74a623f284c9898e57dc6c029e2a7c1c6e57da656005&",
|
| 15 |
"length": 24,
|
| 16 |
"num_inference_steps": 25,
|
| 17 |
"cfg": 3.5,
|
src/dwpose/__pycache__/wholebody.cpython-310.pyc
CHANGED
|
Binary files a/src/dwpose/__pycache__/wholebody.cpython-310.pyc and b/src/dwpose/__pycache__/wholebody.cpython-310.pyc differ
|
|
|
src/dwpose/wholebody.py
CHANGED
|
@@ -5,8 +5,8 @@ import cv2
|
|
| 5 |
import numpy as np
|
| 6 |
import onnxruntime as ort
|
| 7 |
|
| 8 |
-
from
|
| 9 |
-
from
|
| 10 |
|
| 11 |
ModelDataPathPrefix = Path("./pretrained_weights")
|
| 12 |
|
|
|
|
| 5 |
import numpy as np
|
| 6 |
import onnxruntime as ort
|
| 7 |
|
| 8 |
+
from .onnxdet import inference_detector
|
| 9 |
+
from .onnxpose import inference_pose
|
| 10 |
|
| 11 |
ModelDataPathPrefix = Path("./pretrained_weights")
|
| 12 |
|