Spaces:
Sleeping
Sleeping
Krishs21 commited on
Commit ·
3220d0b
1
Parent(s): e01b157
code change
Browse files
app.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
|
|
|
|
| 3 |
from tensorflow.keras.preprocessing import image
|
| 4 |
import numpy as np
|
| 5 |
from PIL import Image
|
|
@@ -7,7 +8,7 @@ from PIL import Image
|
|
| 7 |
# Load the trained model (ensure this path is correct in your Space)
|
| 8 |
model = load_model('human_identifier_model.h5')
|
| 9 |
|
| 10 |
-
model.compile(optimizer=Adam(), # Choose the same optimizer used during training
|
| 11 |
loss='binary_crossentropy', # Use the same loss function as during training
|
| 12 |
metrics=['accuracy'])
|
| 13 |
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import keras
|
| 3 |
+
from keras.models import load_model
|
| 4 |
from tensorflow.keras.preprocessing import image
|
| 5 |
import numpy as np
|
| 6 |
from PIL import Image
|
|
|
|
| 8 |
# Load the trained model (ensure this path is correct in your Space)
|
| 9 |
model = load_model('human_identifier_model.h5')
|
| 10 |
|
| 11 |
+
model.compile(optimizer=keras.optimizers.Adam(), # Choose the same optimizer used during training
|
| 12 |
loss='binary_crossentropy', # Use the same loss function as during training
|
| 13 |
metrics=['accuracy'])
|
| 14 |
|