Stable-X commited on
Commit
aff85de
1 Parent(s): 10cae83

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -4,6 +4,7 @@ import functools
4
  import os
5
  import tempfile
6
  import torch
 
7
  import gradio as gr
8
  from PIL import Image
9
  from gradio_imageslider import ImageSlider
@@ -52,9 +53,9 @@ def create_demo():
52
  predictor = load_predictor()
53
 
54
  # Create processing functions for each data type
55
- process_object = functools.partial(process_image, predictor, data_type="object")
56
- process_scene = functools.partial(process_image, predictor, data_type="indoor")
57
- process_human = functools.partial(process_image, predictor, data_type="object")
58
 
59
  # Define markdown content
60
  HEADER_MD = """
 
4
  import os
5
  import tempfile
6
  import torch
7
+ import spaces
8
  import gradio as gr
9
  from PIL import Image
10
  from gradio_imageslider import ImageSlider
 
53
  predictor = load_predictor()
54
 
55
  # Create processing functions for each data type
56
+ process_object = spaces.GPU(functools.partial(process_image, predictor, data_type="object"))
57
+ process_scene = spaces.GPU(functools.partial(process_image, predictor, data_type="indoor"))
58
+ process_human = spaces.GPU(functools.partial(process_image, predictor, data_type="object"))
59
 
60
  # Define markdown content
61
  HEADER_MD = """