Spaces:
Sleeping
Sleeping
Changed the model path from dir path to file path
Browse files
app.py
CHANGED
|
@@ -2,11 +2,11 @@ import gradio as gr
|
|
| 2 |
from torchvision import transforms
|
| 3 |
import tensorflow as tf
|
| 4 |
|
| 5 |
-
tf.config.experimental._could_use_gpu_kernel = False
|
| 6 |
|
| 7 |
-
model_path = "./4-15_ViT-B16_Lung3_v1"
|
| 8 |
-
|
| 9 |
-
model = tf.keras.layers.TFSMLayer(model_path, call_endpoint='serving_default')
|
| 10 |
|
| 11 |
# Define preprocessing function
|
| 12 |
def preprocess_image(image):
|
|
|
|
| 2 |
from torchvision import transforms
|
| 3 |
import tensorflow as tf
|
| 4 |
|
| 5 |
+
# tf.config.experimental._could_use_gpu_kernel = False
|
| 6 |
|
| 7 |
+
model_path = "./4-15_ViT-B16_Lung3_v1/saved_model.pb"
|
| 8 |
+
model = tf.keras.models.load_model(model_path)
|
| 9 |
+
# model = tf.keras.layers.TFSMLayer(model_path, call_endpoint='serving_default')
|
| 10 |
|
| 11 |
# Define preprocessing function
|
| 12 |
def preprocess_image(image):
|