Update app.py
Browse files
app.py
CHANGED
@@ -18,6 +18,8 @@ def resize_image(image):
|
|
18 |
image = image.resize(model_input_size, Image.BILINEAR)
|
19 |
return image
|
20 |
|
|
|
|
|
21 |
def inference(image):
|
22 |
# Check for CUDA and set the device inside inference
|
23 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
|
|
18 |
image = image.resize(model_input_size, Image.BILINEAR)
|
19 |
return image
|
20 |
|
21 |
+
@spaces.GPU
|
22 |
+
@torch.inference_mode()
|
23 |
def inference(image):
|
24 |
# Check for CUDA and set the device inside inference
|
25 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|