Spaces:
Sleeping
Sleeping
Commit
·
31b7258
1
Parent(s):
66f98ad
Update app.py
Browse files
app.py
CHANGED
|
@@ -49,7 +49,6 @@ def load_encoder_model():
|
|
| 49 |
|
| 50 |
|
| 51 |
st.title(":blue[Nishant Guvvada's] :red[AI Journey] Image Caption Generation")
|
| 52 |
-
image = Image.open('./title.jpg')
|
| 53 |
st.image(image)
|
| 54 |
st.write("""
|
| 55 |
# Multi-Modal Machine Learning
|
|
@@ -78,6 +77,11 @@ word_to_index = StringLookup(
|
|
| 78 |
mask_token="", vocabulary=tokenizer
|
| 79 |
)
|
| 80 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
|
| 82 |
## Probabilistic prediction using the trained model
|
| 83 |
def predict_caption(file):
|
|
|
|
| 49 |
|
| 50 |
|
| 51 |
st.title(":blue[Nishant Guvvada's] :red[AI Journey] Image Caption Generation")
|
|
|
|
| 52 |
st.image(image)
|
| 53 |
st.write("""
|
| 54 |
# Multi-Modal Machine Learning
|
|
|
|
| 77 |
mask_token="", vocabulary=tokenizer
|
| 78 |
)
|
| 79 |
|
| 80 |
+
# Lookup table: Index -> Word
|
| 81 |
+
index_to_word = StringLookup(
|
| 82 |
+
mask_token="", vocabulary=tokenizer.get_vocabulary(), invert=True
|
| 83 |
+
)
|
| 84 |
+
|
| 85 |
|
| 86 |
## Probabilistic prediction using the trained model
|
| 87 |
def predict_caption(file):
|