Osc17-2003 commited on
Commit
7350737
·
verified ·
1 Parent(s): 93f0d14

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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"**Descripción visual generada:** _{descripcion}_")
26
 
27
- with st.spinner('📚 Generando información turística con Gemini...'):
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)