Sitemap

Creando un Asistente de Blog de Viaje con IA para documentar aventuras en la Patagonia

5 min readFeb 15, 2025

La Patagonia, con sus paisajes impresionantes y naturaleza salvaje, merece ser documentada no solo con fotos, sino también con un contexto rico y significativo. Por eso, vamos a crear una herramienta que combine el poder de Vertex AI y Gemini para analizar mis fotos de viaje y generar información valiosa automáticamente.

Qué hace esta herramienta?

  • Analiza fotos de viaje para identificar lugares y puntos de interés
  • Genera descripciones detalladas e información histórica
  • Crea automáticamente pies de foto para redes sociales
  • Sugiere lugares cercanos para visitar (travel tips!)
  • Generar una imagen inspirada en la foto y su riqueza histórica

Construyendo el proyecto paso a paso

  1. Configuración inicial
  • Crear un proyecto en Google Cloud
  • Habilitar las APIs necesarias (Vertex AI y Vision AI)
  • Instalar las bibliotecas de Python requeridas

2. Un poco de código

# Setup and Installation
!pip install google-cloud-aiplatform
!pip install google-cloud-vision
!pip install vertexai
from vertexai.preview.generative_models import GenerativeModel, Part
from vertexai.preview.vision_models import ImageGenerationModel
from vertexai.preview import generative_models
import vertexai

from google.colab import auth
from google.colab import files

import base64
from PIL import Image
from io import BytesIO
# Model names
MODEL_NAME = "gemini-2.0-flash-exp"
IMAGE_MODEL_NAME = "imagen-3.0-generate-002"
# VertexAI settings
# Project and location settings (replace with your values)
PROJECT_ID = "TU_PROYECTO"
LOCATION = "us-central1"

Y a continuación, se desarrollan los siguientes métodos:

  • def encode_image(image_path)
  • def analyze_photo(image_path, prompt, project_id=PROJECT_ID, location=LOCATION)
  • def generate_image(prompt, project_id=PROJECT_ID, location=LOCATION):

Y finalmente, definir el prompt de análisis:

analysis_prompt = """
Analyze this travel photo and provide:
1. Description of what you see
2. Cultural or historical significance
3. Travel tips for visitors
4. Best time to visit
5. Type of photography that would work best here

Format the response in a clear, easy-to-read structure.
"""
# Analyze the uploaded photo
analysis_result = analyze_photo(image_path, analysis_prompt)

Y ahora generar la nueva imagen, incluyendo la respuesta del prompt anterior:

generation_prompt = """
Based on {analysis_result}, generate a new image
that encourages further exploration of the same
landscapes. Incorporate elements that highlight
the historical significance of the place,
making the connection between its past
and present visually compelling.
"""
# Generate new image
generated_image = generate_image(generation_prompt)

Probando el código varias veces, obtuve respuestas interesantes, aquí comparto algunas:

Imagen de entrada (Input Image) — mi foto del Chaten, Patagonia Argentina, Diciembre 2024

Respuesta al análisis de la imagen:

Photo Analysis:
Okay, here's an analysis of the provided travel photo:

**1. Description of what I see**

The photo depicts a dramatic mountain landscape. The dominant feature is a rugged, jagged mountain peak, partially covered in snow and glaciers. The rock face is steep and textured. The sky is a clear, bright blue with a hint of clouds on the left. Dense green vegetation covers the lower slopes of the adjacent mountain. The perspective suggests the photo was taken from a slightly lower elevation, looking up at the peaks. The photo has been taken vertically, but the image is on its side.

**2. Cultural or Historical Significance**

Based on the landscape, this is most likely a mountain in Patagonia, possibly Mount Fitz Roy, located in the southern Andes, on the border between Argentina and Chile.

* **Indigenous Significance:** Patagonia has a rich indigenous history. Before European colonization, the Tehuelche people inhabited the region. These mountains hold spiritual significance for them, representing power and connection to the land.
* **Exploration and Climbing History:** The Fitz Roy region attracted explorers and mountaineers throughout the 20th century. Successfully climbing these peaks is considered a significant achievement in mountaineering due to challenging weather conditions and the technical difficulty of the climbs.

**3. Travel Tips for Visitors**

* **Book Accommodation in Advance:** Towns like El Chalten (Argentina) fill up quickly during the peak season.
* **Pack for All Weather Conditions:** Patagonia is known for its unpredictable and rapidly changing weather. Layers are essential. Bring waterproof and windproof gear.
* **Hiking Boots are Essential:** If you plan to hike, invest in good quality, broken-in hiking boots.
* **Bring Sun Protection:** The high altitude and reflective snow can intensify the sun's rays. Use sunscreen, sunglasses, and a hat.
* **Be Prepared for Wind:** Strong winds are common in Patagonia.
* **Check Trail Conditions:** Before embarking on any hike, check the latest trail conditions and weather forecasts.
* **Consider Hiring a Guide:** For more challenging climbs or treks, consider hiring a local guide.
* **Respect the Environment:** Practice Leave No Trace principles. Pack out everything you pack in, stay on designated trails, and avoid disturbing wildlife.

**4. Best Time to Visit**

The best time to visit Patagonia is during the Southern Hemisphere's summer months, which are from **November to early April**. During this time, the weather is generally milder, with longer daylight hours. However, be aware that even in summer, the weather can be unpredictable.

**5. Type of Photography that Would Work Best Here**

* **Landscape Photography:** Wide-angle lenses are ideal to capture the vastness of the mountains and the dramatic sky.
* **Long Exposure Photography:** Can be used to smooth out the movement of clouds and water (if any).
* **Telephoto Photography:** Can isolate specific peaks or details within the mountain range.
* **Panoramic Photography:** To capture the expansive vistas.
* **Time-Lapse Photography:** Would be great for capturing the changing light and weather patterns.
* **Black and White Photography:** Can emphasize the textures and dramatic forms of the mountains.
* **Astrophotography:** The dark skies are great for capturing the stars at night.

Esa es de las respuestas que más me gustó ^^

Y aquí algunas de las imágenes generadas 🎨 👩‍🎨

Revisa el código completo en este cuadernillo en colab!

3. Funcionalidades clave

  • Detección de lugares con Vision AI
  • Análisis de la imagen con Gemini para generar contenido del blog viajero.

¿Por qué es útil para mi blog de la Patagonia?

La Patagonia ❤ es rica en lugares históricos, formaciones geológicas únicas y paisajes impresionantes. Esta herramienta me ayudará a:

  • Identificar formaciones geológicas específicas
  • Obtener contexto histórico sobre lugares remotos
  • Generar contenido informativo para mis lectores
  • Crear descripciones atractivas para redes sociales
  • Sugerir rutas y lugares cercanos para explorar

Beneficios para los lectores del blog

  • Información más rica y detallada sobre cada lugar
  • Contexto histórico y cultural preciso
  • Sugerencias prácticas de viaje

Próximos pasos

Planeo expandir la herramienta para incluir:

  • Análisis de condiciones climáticas óptimas + Información sobre la flora y fauna local
  • Rutas de senderismo cercanas ❤
  • Una interfaz (web/movil?) donde el usuario pueda subir sus fotos y tener texto sugerido para implementar su blog!

Conclusión

Esta herramienta no solo mejorará mi blog sobre la Patagonia (puedes leer la parte 1, aquí, sin asistente de IA 🙊), sino que también ayudará a otros viajeros a apreciar mejor la riqueza natural y cultural de la región.

#VertexAI #VertexAISprint #Gemini

--

--

Lesly Zerna
Lesly Zerna

Written by Lesly Zerna

🤖 enthusiastic explorer | AI + Education | startups

Responses (1)