Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,7 +13,7 @@ captioner = pipeline("image-to-text", model="Salesforce/blip-image-captioning-ba
|
|
| 13 |
# Interfaz Streamlit
|
| 14 |
st.title("🗺️ Asistente Turístico Visual Inteligente")
|
| 15 |
|
| 16 |
-
uploaded_file = st.file_uploader("Carga la imagen de un lugar turístico", type=['jpg', 'png', 'jpeg'])
|
| 17 |
|
| 18 |
if uploaded_file is not None:
|
| 19 |
image = Image.open(uploaded_file)
|
|
@@ -22,9 +22,9 @@ if uploaded_file is not None:
|
|
| 22 |
if st.button("Generar información turística"):
|
| 23 |
with st.spinner('🖼️ Identificando lugar...'):
|
| 24 |
descripcion = captioner(image)[0]['generated_text']
|
| 25 |
-
st.markdown(f"**
|
| 26 |
|
| 27 |
-
with st.spinner('📚 Generando información turística
|
| 28 |
prompt = f"""Genera información turística detallada sobre el siguiente lugar: {descripcion}.
|
| 29 |
Incluye breve historia, datos curiosos, y recomendaciones para visitarlo."""
|
| 30 |
info = gemini_model.generate_content(prompt)
|
|
|
|
| 13 |
# Interfaz Streamlit
|
| 14 |
st.title("🗺️ Asistente Turístico Visual Inteligente")
|
| 15 |
|
| 16 |
+
uploaded_file = st.file_uploader("Carga la imagen de un lugar turístico para darte informacion", type=['jpg', 'png', 'jpeg'])
|
| 17 |
|
| 18 |
if uploaded_file is not None:
|
| 19 |
image = Image.open(uploaded_file)
|
|
|
|
| 22 |
if st.button("Generar información turística"):
|
| 23 |
with st.spinner('🖼️ Identificando lugar...'):
|
| 24 |
descripcion = captioner(image)[0]['generated_text']
|
| 25 |
+
st.markdown(f"**Hmmm... Parece ser que tu foto es:** _{descripcion}_")
|
| 26 |
|
| 27 |
+
with st.spinner('📚 Generando información turística...'):
|
| 28 |
prompt = f"""Genera información turística detallada sobre el siguiente lugar: {descripcion}.
|
| 29 |
Incluye breve historia, datos curiosos, y recomendaciones para visitarlo."""
|
| 30 |
info = gemini_model.generate_content(prompt)
|