root commited on
Commit
48fea0f
·
1 Parent(s): e845b5e
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('./good_face.jpeg', animation_path, swapped_face_video_path)
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://media.discordapp.net/attachments/1237667074210267217/1246013998042976276/image.jpg?ex=665ad876&is=665986f6&hm=e7f0e6fd51c1068c15f1a750ca97abb4b2a4bfed396160ff44cf1abecb489d11&=&format=webp&width=896&height=1194",
14
- "video_url": "https://cdn.discordapp.com/attachments/1237667074210267217/1245971599660679208/pose.mov?ex=665ab0fa&is=66595f7a&hm=63691e23a23ebd8657a10ec708d63a06046a124c3940aa133de22a94aa1fd6c5&",
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 src.dwpose.onnxdet import inference_detector
9
- from src.dwpose.onnxpose import inference_pose
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