Update model/model.py
Browse files- model/model.py +4 -4
model/model.py
CHANGED
|
@@ -1,12 +1,12 @@
|
|
| 1 |
from huggingface_hub import from_pretrained_keras
|
| 2 |
from PIL import Image
|
|
|
|
| 3 |
import numpy as np
|
|
|
|
| 4 |
import tensorflow as tf
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
import keras
|
| 9 |
-
model = keras.saving.load_model("hf://sensei-ml/Brain_Tumors_Classificator_CNN_Keras_Model")
|
| 10 |
|
| 11 |
def predict(image_path):
|
| 12 |
image = Image.fromarray(image_path)
|
|
|
|
| 1 |
from huggingface_hub import from_pretrained_keras
|
| 2 |
from PIL import Image
|
| 3 |
+
import keras
|
| 4 |
import numpy as np
|
| 5 |
+
import os
|
| 6 |
import tensorflow as tf
|
| 7 |
|
| 8 |
+
os.environ['KERAS_BACKEND'] = 'tensorflow'
|
| 9 |
+
model = keras.saving.load_model('hf://sensei-ml/Brain_Tumors_Classificator_CNN_Keras_Model')
|
|
|
|
|
|
|
| 10 |
|
| 11 |
def predict(image_path):
|
| 12 |
image = Image.fromarray(image_path)
|