Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,12 +10,14 @@ import os
|
|
| 10 |
from PIL import Image
|
| 11 |
import numpy as np
|
| 12 |
import gradio as gr
|
|
|
|
| 13 |
|
| 14 |
model = Xception()
|
| 15 |
|
| 16 |
# Restructure model
|
| 17 |
model = Model(inputs = model.inputs , outputs = model.layers[-2].output)
|
| 18 |
|
|
|
|
| 19 |
|
| 20 |
with open('captions.txt', 'r') as f:
|
| 21 |
next(f)
|
|
|
|
| 10 |
from PIL import Image
|
| 11 |
import numpy as np
|
| 12 |
import gradio as gr
|
| 13 |
+
import tensorflow as tf
|
| 14 |
|
| 15 |
model = Xception()
|
| 16 |
|
| 17 |
# Restructure model
|
| 18 |
model = Model(inputs = model.inputs , outputs = model.layers[-2].output)
|
| 19 |
|
| 20 |
+
caption_model = tf.keras.models.load_model('model.h5')
|
| 21 |
|
| 22 |
with open('captions.txt', 'r') as f:
|
| 23 |
next(f)
|