Miroslav Purkrabek commited on
Commit
50e6e4b
·
1 Parent(s): 4912829

add spaces wrappers

Browse files
Files changed (2) hide show
  1. app.py +5 -2
  2. requirements.txt +8 -8
app.py CHANGED
@@ -6,6 +6,7 @@ import threading
6
  import numpy as np
7
  import mmcv
8
  from time import sleep
 
9
 
10
  from mmpose.apis import inference_topdown
11
  from mmpose.apis import init_model as init_pose_estimator
@@ -124,6 +125,7 @@ class AsyncFrameProcessor:
124
  with self.output_lock:
125
  self.latest_output_frame = processed_frame
126
 
 
127
  def _process_frame(self, frame, bbox_thr=0.3, nms_thr=0.8, kpt_thr=0.3):
128
  # predict bbox
129
  processing_start = time.time()
@@ -217,6 +219,7 @@ class AsyncFrameProcessor:
217
  if self.processing_thread and self.processing_thread.is_alive():
218
  self.processing_thread.join(timeout=2.0)
219
 
 
220
  def init_models(self):
221
  # Init detector
222
  if self.det_model is None:
@@ -258,14 +261,14 @@ with gr.Blocks(css=css) as demo:
258
  gr.HTML(
259
  """
260
  <h1 style='text-align: center'>
261
- Async Frame Processing Demo (Powered by WebRTC ⚡️)
262
  </h1>
263
  """
264
  )
265
  gr.HTML(
266
  """
267
  <h3 style='text-align: center'>
268
- Real-time frame processing with single-slot queues
269
  </h3>
270
  """
271
  )
 
6
  import numpy as np
7
  import mmcv
8
  from time import sleep
9
+ import spaces
10
 
11
  from mmpose.apis import inference_topdown
12
  from mmpose.apis import init_model as init_pose_estimator
 
125
  with self.output_lock:
126
  self.latest_output_frame = processed_frame
127
 
128
+ @spaces.GPU
129
  def _process_frame(self, frame, bbox_thr=0.3, nms_thr=0.8, kpt_thr=0.3):
130
  # predict bbox
131
  processing_start = time.time()
 
219
  if self.processing_thread and self.processing_thread.is_alive():
220
  self.processing_thread.join(timeout=2.0)
221
 
222
+ @spaces.GPU
223
  def init_models(self):
224
  # Init detector
225
  if self.det_model is None:
 
261
  gr.HTML(
262
  """
263
  <h1 style='text-align: center'>
264
+ ProbPose Webcam Demo (CVPR 2025)
265
  </h1>
266
  """
267
  )
268
  gr.HTML(
269
  """
270
  <h3 style='text-align: center'>
271
+ See <a href="https://MiraPurkrabek.github.io/ProbPose/" target="_blank">https://MiraPurkrabek.github.io/ProbPose/</a> for details.
272
  </h3>
273
  """
274
  )
requirements.txt CHANGED
@@ -1,10 +1,10 @@
1
 
2
- ## MMCV
3
- --no-binary=mmcv,mmengine,mmdet,mmpretrain
4
- mmcv @ git+https://github.com/open-mmlab/[email protected]
5
- mmengine @ git+https://github.com/open-mmlab/[email protected]
6
- mmdet @ git+https://github.com/open-mmlab/[email protected]
7
- mmpretrain @ git+https://github.com/open-mmlab/[email protected]
8
 
9
  ## build.txt
10
  # These must be installed before building mmpose
@@ -24,7 +24,7 @@ pillow
24
  scipy
25
  torchvision
26
 
27
- --no-binary=xtcocotools
28
  xtcocotools
29
 
30
  ## tests.txt
@@ -44,4 +44,4 @@ requests
44
  ## gradio app
45
  fastrtc
46
 
47
- mmpose @ git+https://github.com/MiraPurkrabek/ProbPose_code.git
 
1
 
2
+ # ## MMCV
3
+ # --no-binary=mmcv-full,mmengine,mmdet,mmpretrain
4
+ # mmcv @ git+https://github.com/open-mmlab/[email protected]
5
+ # mmengine @ git+https://github.com/open-mmlab/[email protected]
6
+ # mmdet @ git+https://github.com/open-mmlab/[email protected]
7
+ # mmpretrain @ git+https://github.com/open-mmlab/[email protected]
8
 
9
  ## build.txt
10
  # These must be installed before building mmpose
 
24
  scipy
25
  torchvision
26
 
27
+ # --no-binary=xtcocotools
28
  xtcocotools
29
 
30
  ## tests.txt
 
44
  ## gradio app
45
  fastrtc
46
 
47
+ # mmpose @ git+https://github.com/MiraPurkrabek/ProbPose_code.git