jhj0517
commited on
Commit
·
da162f8
1
Parent(s):
0095d61
add progress for pose alignment
Browse files- pose_align.py +4 -0
pose_align.py
CHANGED
|
@@ -6,6 +6,7 @@ import os
|
|
| 6 |
import moviepy.video.io.ImageSequenceClip
|
| 7 |
from datetime import datetime
|
| 8 |
import gc
|
|
|
|
| 9 |
|
| 10 |
from pose.script.dwpose import DWposeDetector, draw_pose
|
| 11 |
from pose.script.util import size_calculate, warpAffine_kps
|
|
@@ -48,6 +49,7 @@ class PoseAlignmentInference:
|
|
| 48 |
image_resolution: int,
|
| 49 |
align_frame: int,
|
| 50 |
max_frame: int,
|
|
|
|
| 51 |
):
|
| 52 |
download_models(model_dir=self.model_dir)
|
| 53 |
output_filename = "pose_temp"
|
|
@@ -281,6 +283,8 @@ class PoseAlignmentInference:
|
|
| 281 |
result_demo = [] # = Writer(args, None, H, 3*W1+2*W2, outfn, fps)
|
| 282 |
result_pose_only = [] # Writer(args, None, H, W1, args.outfn_align_pose_video, fps)
|
| 283 |
for i in range(len(body_seq)):
|
|
|
|
|
|
|
| 284 |
pose_t={}
|
| 285 |
pose_t["bodies"]={}
|
| 286 |
pose_t["bodies"]["candidate"]=body_seq[i]
|
|
|
|
| 6 |
import moviepy.video.io.ImageSequenceClip
|
| 7 |
from datetime import datetime
|
| 8 |
import gc
|
| 9 |
+
import gradio as gr
|
| 10 |
|
| 11 |
from pose.script.dwpose import DWposeDetector, draw_pose
|
| 12 |
from pose.script.util import size_calculate, warpAffine_kps
|
|
|
|
| 49 |
image_resolution: int,
|
| 50 |
align_frame: int,
|
| 51 |
max_frame: int,
|
| 52 |
+
gradio_progress=gr.Progress()
|
| 53 |
):
|
| 54 |
download_models(model_dir=self.model_dir)
|
| 55 |
output_filename = "pose_temp"
|
|
|
|
| 283 |
result_demo = [] # = Writer(args, None, H, 3*W1+2*W2, outfn, fps)
|
| 284 |
result_pose_only = [] # Writer(args, None, H, W1, args.outfn_align_pose_video, fps)
|
| 285 |
for i in range(len(body_seq)):
|
| 286 |
+
gradio_progress(i/len(body_seq), "Aligning Pose.... After this, go to Step 2.")
|
| 287 |
+
|
| 288 |
pose_t={}
|
| 289 |
pose_t["bodies"]={}
|
| 290 |
pose_t["bodies"]["candidate"]=body_seq[i]
|