Spaces:
Runtime error
Runtime error
isLinXu
commited on
Commit
•
a281d68
1
Parent(s):
f5e1ae7
update
Browse files
app.py
CHANGED
@@ -51,9 +51,12 @@ def predict_pose(img, model_name, out_dir):
|
|
51 |
inferencer = MMPoseInferencer(model_name, device=device)
|
52 |
result_generator = inferencer(img_path, show=False, out_dir=out_dir)
|
53 |
result = next(result_generator)
|
54 |
-
save_dir = 'output/visualizations/'
|
55 |
-
|
56 |
-
|
|
|
|
|
|
|
57 |
out_img = PIL.Image.open(out_img_path)
|
58 |
return out_img
|
59 |
|
|
|
51 |
inferencer = MMPoseInferencer(model_name, device=device)
|
52 |
result_generator = inferencer(img_path, show=False, out_dir=out_dir)
|
53 |
result = next(result_generator)
|
54 |
+
save_dir = './output/visualizations/'
|
55 |
+
if os.path.exists(save_dir):
|
56 |
+
out_img_path = save_dir + img_path
|
57 |
+
print("out_img_path: ", out_img_path)
|
58 |
+
else:
|
59 |
+
out_img_path = img_path
|
60 |
out_img = PIL.Image.open(out_img_path)
|
61 |
return out_img
|
62 |
|