Spaces:
Paused
Paused
update gradio client for mmpose
Browse files
app.py
CHANGED
|
@@ -6,7 +6,12 @@ import numpy as np
|
|
| 6 |
from PIL import Image
|
| 7 |
from moviepy.editor import *
|
| 8 |
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
def get_frames(video_in):
|
| 12 |
frames = []
|
|
@@ -50,7 +55,13 @@ def get_mmpose_filter(i):
|
|
| 50 |
|
| 51 |
#image = np.array(image)
|
| 52 |
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
image = Image.open(image)
|
| 55 |
#image = Image.fromarray(image)
|
| 56 |
image.save("mmpose_frame_" + str(i) + ".jpeg")
|
|
|
|
| 6 |
from PIL import Image
|
| 7 |
from moviepy.editor import *
|
| 8 |
|
| 9 |
+
from gradio_client import Client
|
| 10 |
+
|
| 11 |
+
mmpose_client = Client("https://fffiloni-mmpose-estimation.hf.space/--replicas/67vw9/")
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
#mmpose = gr.Interface.load(name="spaces/fffiloni/mmpose-estimation")
|
| 15 |
|
| 16 |
def get_frames(video_in):
|
| 17 |
frames = []
|
|
|
|
| 55 |
|
| 56 |
#image = np.array(image)
|
| 57 |
|
| 58 |
+
mmpose_result = mmpose_client.predict(
|
| 59 |
+
i, # filepath in 'img' Image component
|
| 60 |
+
api_name="/predict"
|
| 61 |
+
)
|
| 62 |
+
print(mmpose_result)
|
| 63 |
+
|
| 64 |
+
image = mmpose_result[1]
|
| 65 |
image = Image.open(image)
|
| 66 |
#image = Image.fromarray(image)
|
| 67 |
image.save("mmpose_frame_" + str(i) + ".jpeg")
|