isLinXu commited on
Commit
e3ac5c6
1 Parent(s): a0e98b8
Files changed (1) hide show
  1. app.py +1 -4
app.py CHANGED
@@ -45,16 +45,13 @@ def download_test_image():
45
 
46
 
47
  def predict_pose(img, model_name, out_dir):
48
- out_dir = "./output/visualizations/"
49
  img_path = "input_img.jpg"
50
  save_image(img, img_path)
51
  device = torch.cuda.current_device() if torch.cuda.is_available() else 'cpu'
52
  inferencer = MMPoseInferencer(model_name, device=device)
53
  result_generator = inferencer(img_path, show=False, out_dir=out_dir)
54
  result = next(result_generator)
55
- save_dir = './output/output/visualizations/'
56
- if not os.path.exists(out_dir):
57
- os.makedirs(out_dir)
58
  out_img_path = save_dir + img_path
59
  print("out_img_path: ", out_img_path)
60
  out_img = PIL.Image.open(out_img_path)
 
45
 
46
 
47
  def predict_pose(img, model_name, out_dir):
 
48
  img_path = "input_img.jpg"
49
  save_image(img, img_path)
50
  device = torch.cuda.current_device() if torch.cuda.is_available() else 'cpu'
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
  out_img_path = save_dir + img_path
56
  print("out_img_path: ", out_img_path)
57
  out_img = PIL.Image.open(out_img_path)