Spaces:
Runtime error
Runtime error
jaydemirandilla
commited on
Commit
·
b08fdd4
1
Parent(s):
367a3ec
Update app.py
Browse files
app.py
CHANGED
@@ -3,16 +3,8 @@ import gradio as gr
|
|
3 |
import tensorflow as tf
|
4 |
from PIL import Image, ImageDraw, ImageFont
|
5 |
|
6 |
-
|
7 |
-
def load_modified_model(model_path):
|
8 |
-
return tf.keras.models.load_model(model_path)
|
9 |
|
10 |
-
# Load the trained model
|
11 |
-
print("Loading model...")
|
12 |
-
model = load_modified_model('denseNet121.h5')
|
13 |
-
print("Model loaded successfully.")
|
14 |
-
|
15 |
-
# Function to classify food vs. non-food image using the loaded model
|
16 |
def classify_food_vs_nonfood(image):
|
17 |
try:
|
18 |
# Preprocess image
|
|
|
3 |
import tensorflow as tf
|
4 |
from PIL import Image, ImageDraw, ImageFont
|
5 |
|
6 |
+
model = tf.keras.models.load_model('denseNet121.h5')
|
|
|
|
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
def classify_food_vs_nonfood(image):
|
9 |
try:
|
10 |
# Preprocess image
|