Spaces:
Running
on
Zero
Running
on
Zero
Try decorate
Browse files- app.py +2 -0
- requirements.txt +1 -0
app.py
CHANGED
@@ -3,6 +3,7 @@ import numpy as np
|
|
3 |
from PIL import Image
|
4 |
import cv2
|
5 |
from sim.simulator import GenieSimulator
|
|
|
6 |
|
7 |
RES = 512
|
8 |
image = Image.open("sim/assets/langtable_prompt/frame_06.png")
|
@@ -44,6 +45,7 @@ def model(direction: str, genie=genie):
|
|
44 |
return Image.fromarray(next_image)
|
45 |
|
46 |
# Gradio function to handle user input
|
|
|
47 |
def handle_input(direction):
|
48 |
print(f"User clicked: {direction}")
|
49 |
new_image = model(direction) # Get a new image from the model
|
|
|
3 |
from PIL import Image
|
4 |
import cv2
|
5 |
from sim.simulator import GenieSimulator
|
6 |
+
import spaces
|
7 |
|
8 |
RES = 512
|
9 |
image = Image.open("sim/assets/langtable_prompt/frame_06.png")
|
|
|
45 |
return Image.fromarray(next_image)
|
46 |
|
47 |
# Gradio function to handle user input
|
48 |
+
@spaces.GPU
|
49 |
def handle_input(direction):
|
50 |
print(f"User clicked: {direction}")
|
51 |
new_image = model(direction) # Get a new image from the model
|
requirements.txt
CHANGED
@@ -13,6 +13,7 @@ diffusers # used for stable diffusion tokenizers
|
|
13 |
opencv-python
|
14 |
tensorflow_datasets
|
15 |
tensorflow
|
|
|
16 |
gcsfs
|
17 |
|
18 |
# official MaskGIT
|
|
|
13 |
opencv-python
|
14 |
tensorflow_datasets
|
15 |
tensorflow
|
16 |
+
spaces
|
17 |
gcsfs
|
18 |
|
19 |
# official MaskGIT
|