Spaces:
Build error
Build error
Commit
·
b05691d
1
Parent(s):
8cbae1c
Update app.py
Browse files
app.py
CHANGED
@@ -4,20 +4,10 @@ import urllib
|
|
4 |
import tensorflow as tf
|
5 |
from tensorflow.keras import layers, models, optimizers
|
6 |
import gradio as gr
|
7 |
-
|
8 |
-
from app import CustomAdam
|
9 |
|
10 |
-
#
|
11 |
-
|
12 |
-
def get_config(self):
|
13 |
-
config = super().get_config()
|
14 |
-
config['name'] = 'CustomAdam'
|
15 |
-
return config
|
16 |
-
|
17 |
-
get_custom_objects().update({'CustomAdam': CustomAdam})
|
18 |
-
|
19 |
-
# Load pre-trained model with custom optimizer
|
20 |
-
model = tf.keras.models.load_model('facial_condition_model.h5', custom_objects={'CustomAdam': CustomAdam})
|
21 |
|
22 |
# Function to preprocess image for model input
|
23 |
def preprocess_image(image):
|
|
|
4 |
import tensorflow as tf
|
5 |
from tensorflow.keras import layers, models, optimizers
|
6 |
import gradio as gr
|
7 |
+
import os
|
|
|
8 |
|
9 |
+
# Load pre-trained model
|
10 |
+
model = tf.keras.models.load_model('facial_condition_model.h5')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
# Function to preprocess image for model input
|
13 |
def preprocess_image(image):
|