Spaces:
Running on Zero
Running on Zero
added spaces.GPU at the classify_image
Browse files
app.py
CHANGED
|
@@ -8,6 +8,8 @@ import gdown
|
|
| 8 |
import numpy as np
|
| 9 |
import tensorflow as tf
|
| 10 |
|
|
|
|
|
|
|
| 11 |
from PIL import Image
|
| 12 |
from tensorflow.keras.applications.mobilenet_v2 import preprocess_input
|
| 13 |
|
|
@@ -138,7 +140,7 @@ def preprocess_image(img):
|
|
| 138 |
# ============================================================
|
| 139 |
# PREDICTION
|
| 140 |
# ============================================================
|
| 141 |
-
|
| 142 |
def classify_image(img):
|
| 143 |
"""Return class probabilities and a human-readable result."""
|
| 144 |
|
|
|
|
| 8 |
import numpy as np
|
| 9 |
import tensorflow as tf
|
| 10 |
|
| 11 |
+
import spaces
|
| 12 |
+
|
| 13 |
from PIL import Image
|
| 14 |
from tensorflow.keras.applications.mobilenet_v2 import preprocess_input
|
| 15 |
|
|
|
|
| 140 |
# ============================================================
|
| 141 |
# PREDICTION
|
| 142 |
# ============================================================
|
| 143 |
+
@spaces.GPU
|
| 144 |
def classify_image(img):
|
| 145 |
"""Return class probabilities and a human-readable result."""
|
| 146 |
|