Update app.py
Browse files
app.py
CHANGED
@@ -2,11 +2,11 @@ import gradio as gr
|
|
2 |
from PIL import Image
|
3 |
import numpy as np
|
4 |
from tensorflow.keras.preprocessing import image as keras_image
|
5 |
-
from tensorflow.keras.applications.
|
6 |
from tensorflow.keras.models import load_model
|
7 |
|
8 |
# Load your trained model
|
9 |
-
model = load_model('/home/user/app/
|
10 |
|
11 |
def predict_character(img):
|
12 |
img = Image.fromarray(img.astype('uint8'), 'RGB') # Ensure the image is in RGB format
|
|
|
2 |
from PIL import Image
|
3 |
import numpy as np
|
4 |
from tensorflow.keras.preprocessing import image as keras_image
|
5 |
+
from tensorflow.keras.applications.resnet50 import preprocess_input
|
6 |
from tensorflow.keras.models import load_model
|
7 |
|
8 |
# Load your trained model
|
9 |
+
model = load_model('/home/user/app/resnet50.h5') # Ensure this path is correct
|
10 |
|
11 |
def predict_character(img):
|
12 |
img = Image.fromarray(img.astype('uint8'), 'RGB') # Ensure the image is in RGB format
|