Spaces:
Running
on
Zero
Running
on
Zero
use zero gpu
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import gradio as gr
|
2 |
-
|
3 |
import torch
|
4 |
import torch.nn.functional as F
|
5 |
from torch.utils.data import DataLoader
|
@@ -68,7 +68,7 @@ def preprocess_uploaded_image(uploaded_image, image_size):
|
|
68 |
return uploaded_image
|
69 |
|
70 |
# ヒートマップの生成関数
|
71 |
-
|
72 |
def get_heatmaps(source_num, x_coords, y_coords, uploaded_image):
|
73 |
if type(uploaded_image) == str:
|
74 |
uploaded_image = Image.open(uploaded_image)
|
|
|
1 |
import gradio as gr
|
2 |
+
import spaces
|
3 |
import torch
|
4 |
import torch.nn.functional as F
|
5 |
from torch.utils.data import DataLoader
|
|
|
68 |
return uploaded_image
|
69 |
|
70 |
# ヒートマップの生成関数
|
71 |
+
@spaces.GPU
|
72 |
def get_heatmaps(source_num, x_coords, y_coords, uploaded_image):
|
73 |
if type(uploaded_image) == str:
|
74 |
uploaded_image = Image.open(uploaded_image)
|