IsshikiHugh commited on
Commit
56f3727
·
1 Parent(s): db71071

update: gpu supports

Browse files
lib/kits/gradio/hsmr_service.py CHANGED
@@ -59,8 +59,8 @@ class HSMRService:
59
  # 1a. Setup UI.
60
  gr.Markdown(self.description)
61
 
62
- with gr.Tab(label='HSMR-IMG-CPU'):
63
- gr.Markdown('> **Pure CPU** demo for recoverying human mesh and skeleton from a single image. Each inference may take **about 3 minutes**.')
64
  with gr.Row(equal_height=False):
65
  with gr.Column():
66
  input_image = gr.Image(
 
59
  # 1a. Setup UI.
60
  gr.Markdown(self.description)
61
 
62
+ with gr.Tab(label='HSMR-IMG'):
63
+ gr.Markdown('> Demo for recoverying human mesh and skeleton from a single image. (For **Pure CPU** demo, inference may take **about 1~3 minutes**.)')
64
  with gr.Row(equal_height=False):
65
  with gr.Column():
66
  input_image = gr.Image(
tools/service.py CHANGED
@@ -1,12 +1,14 @@
1
  from lib.kits.gradio import *
2
 
3
  import os
 
4
 
5
  os.environ['PYOPENGL_PLATFORM'] = 'egl'
6
 
7
 
8
  if __name__ == '__main__':
9
  # Start serving.
10
- backend = HSMRBackend(device='cpu')
 
11
  hsmr_service = HSMRService(backend)
12
  hsmr_service.serve()
 
1
  from lib.kits.gradio import *
2
 
3
  import os
4
+ import torch
5
 
6
  os.environ['PYOPENGL_PLATFORM'] = 'egl'
7
 
8
 
9
  if __name__ == '__main__':
10
  # Start serving.
11
+ device = 'cuda' if torch.cuda.is_available() else 'cpu'
12
+ backend = HSMRBackend(device=device)
13
  hsmr_service = HSMRService(backend)
14
  hsmr_service.serve()