Spaces:
Build error
Build error
jhj0517
commited on
Commit
·
9852d5d
1
Parent(s):
bd46fc3
add spaces annotation
Browse files- musepose_inference.py +4 -1
- pose_align.py +4 -0
musepose_inference.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 1 |
import os
|
| 2 |
from datetime import datetime
|
| 3 |
from pathlib import Path
|
| 4 |
-
|
| 5 |
import torch
|
| 6 |
from diffusers import AutoencoderKL, DDIMScheduler
|
| 7 |
from einops import repeat
|
|
@@ -20,6 +19,9 @@ from musepose.pipelines.pipeline_pose2vid_long import Pose2VideoPipeline
|
|
| 20 |
from musepose.utils.util import get_fps, read_frames, save_videos_grid
|
| 21 |
from downloading_weights import download_models
|
| 22 |
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
class MusePoseInference:
|
| 25 |
def __init__(self,
|
|
@@ -48,6 +50,7 @@ class MusePoseInference:
|
|
| 48 |
if not os.path.exists(self.output_dir):
|
| 49 |
os.makedirs(self.output_dir)
|
| 50 |
|
|
|
|
| 51 |
def infer_musepose(
|
| 52 |
self,
|
| 53 |
ref_image_path: str,
|
|
|
|
| 1 |
import os
|
| 2 |
from datetime import datetime
|
| 3 |
from pathlib import Path
|
|
|
|
| 4 |
import torch
|
| 5 |
from diffusers import AutoencoderKL, DDIMScheduler
|
| 6 |
from einops import repeat
|
|
|
|
| 19 |
from musepose.utils.util import get_fps, read_frames, save_videos_grid
|
| 20 |
from downloading_weights import download_models
|
| 21 |
|
| 22 |
+
# ZeroGPU
|
| 23 |
+
import spaces
|
| 24 |
+
|
| 25 |
|
| 26 |
class MusePoseInference:
|
| 27 |
def __init__(self,
|
|
|
|
| 50 |
if not os.path.exists(self.output_dir):
|
| 51 |
os.makedirs(self.output_dir)
|
| 52 |
|
| 53 |
+
@spaces.GPU
|
| 54 |
def infer_musepose(
|
| 55 |
self,
|
| 56 |
ref_image_path: str,
|
pose_align.py
CHANGED
|
@@ -11,6 +11,9 @@ from pose.script.dwpose import DWposeDetector, draw_pose
|
|
| 11 |
from pose.script.util import size_calculate, warpAffine_kps
|
| 12 |
from downloading_weights import download_models
|
| 13 |
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
'''
|
| 16 |
Detect dwpose from img, then align it by scale parameters
|
|
@@ -36,6 +39,7 @@ class PoseAlignmentInference:
|
|
| 36 |
if not os.path.exists(self.output_dir):
|
| 37 |
os.makedirs(self.output_dir)
|
| 38 |
|
|
|
|
| 39 |
def align_pose(
|
| 40 |
self,
|
| 41 |
vidfn: str,
|
|
|
|
| 11 |
from pose.script.util import size_calculate, warpAffine_kps
|
| 12 |
from downloading_weights import download_models
|
| 13 |
|
| 14 |
+
# ZeroGPU
|
| 15 |
+
import spaces
|
| 16 |
+
|
| 17 |
|
| 18 |
'''
|
| 19 |
Detect dwpose from img, then align it by scale parameters
|
|
|
|
| 39 |
if not os.path.exists(self.output_dir):
|
| 40 |
os.makedirs(self.output_dir)
|
| 41 |
|
| 42 |
+
@spaces.GPU
|
| 43 |
def align_pose(
|
| 44 |
self,
|
| 45 |
vidfn: str,
|