TourVision automatically transforms static property images into professional video tours using Google's Gemini AI for image classification and Veo 3.1 for cinematic video generation. No manual editing required - just provide images and get a polished property tour video!
π€ AI-Powered Classification - Automatically categorizes images by room type using Gemini Vision
π₯ Cinematic Video Generation - Creates smooth transitions with Veo 3.1
π Smart Scene Selection - Intelligently picks the best image pairs for transitions
β‘ Automated Stitching - Combines all clips with crossfades and professional effects
π Token Tracking - Logs all API usage and costs in CSV format
π― Dynamic Pacing - Automatically adjusts clip duration to hit target length
π¨ Professional Effects - Fade-in, fade-out, and crossfade transitions
Images β AI Classification β Video Generation β Automated Stitching β Final Tour
- Image Analysis - Gemini 2.0 Flash identifies room types (bedroom, kitchen, living_room, etc.)
- Grouping - Images are automatically grouped by detected labels
- Smart Selection - For multi-image rooms, AI selects the best pair for transitions
- Video Generation - Veo 3.1 creates smooth cinematic clips with panoramas or frame bridging
- Final Assembly - MoviePy stitches everything with crossfade transitions
TourVision/
βββ pipeline_new.py # Main pipeline script
βββ .env # API keys (not committed)
βββ token_counter.csv # API usage tracking
βββ images/
β βββ {PROPERTY_CODE}/ # Input images folder
β βββ image1.webp
β βββ image2.jpg
β βββ ...
βββ output/
βββ {PROPERTY_CODE}/ # Generated videos
βββ 005_bedroom.mp4
βββ 005_kitchen.mp4
βββ final_property_tour_005.mp4
- Python 3.8+
- Google Gemini API Key (Get one here)
- Veo API Access (requires Google Cloud account)
- Clone the repository
git clone https://github.com/YourUsername/TourVision.git
cd TourVision- Install dependencies
pip install google-genai moviepy python-dotenv- Set up environment variables
# Create .env file
echo "GEMINI_API_KEY=your_api_key_here" > .env- Prepare your images
# Create folder structure
mkdir -p images/005
# Add your property images to images/005/- Run the pipeline
python pipeline_new.pyEdit these settings in tourVision.py:
# Property Settings
PROPERTY_CODE = "005" # Change for each property
# Paths
IMAGE_FOLDER = f"D:\\images\\{PROPERTY_CODE}"
OUTPUT_FOLDER = f"output/{PROPERTY_CODE}"
# AI Models
MODEL_VISION = "gemini-2.0-flash" # Image classification
MODEL_VIDEO = "veo-3.1-fast-generate-preview" # Video generation
# Video Settings
TRANSITION_DUR = 1.2 # Crossfade duration in seconds
TOTAL_TARGET_DURATION = 45.0 # Final video target length-
Individual Scene Clips
005_bedroom.mp4005_kitchen.mp4005_living_room.mp4- etc.
-
Final Tour Video
final_property_tour_005.mp4(45 seconds, 16:9, 24fps)
-
Usage Report
token_counter.csv- Detailed API usage tracking
| Timestamp | Property ID | Process Name | Model | Execution Time | Prompt Tokens | Candidate Tokens | Total Tokens |
|---|---|---|---|---|---|---|---|
| 2024-01-28 10:30:45 | 005 | Image Classification | gemini-2.0-flash | 1.234 | 256 | 12 | 268 |
| 2024-01-28 10:31:02 | 005 | Video Generation | veo-3.1 | 45.678 | 128 | 0 | 128 |
The AI automatically identifies and groups:
- ποΈ Bedroom
- π³ Kitchen
- ποΈ Living Room
- πΏ Bathroom
- π’ Lobby / Entrance
- ποΈ Exterior
π ΏοΈ Parking- π Pool / Amenities
- And more...
# Creates smooth panorama pan
"A smooth horizontal panorama pan of this {room_type}."# AI selects best 2 images, creates transition
"Accurate bridge between frames for {room_type}."properties = ["001", "002", "003"]
for code in properties:
PROPERTY_CODE = code
run_full_pipeline()TOTAL_TARGET_DURATION = 60.0 # 1-minute tourTRANSITION_DUR = 2.0 # Slower, smoother transitions- Image Classification: ~1-2 seconds per image
- Video Generation: ~30-60 seconds per clip
- Stitching: ~5-10 seconds
- Total Time: ~5-10 minutes for 10-image property
- Ensure images are in correct folder:
images/{PROPERTY_CODE}/ - Check image formats (supports .webp, .jpg, .jpeg)
# Verify .env file exists and contains:
GEMINI_API_KEY=your_actual_key# Increase wait time in the code
while not operation.done:
time.sleep(30) # Increase from 15 to 30 seconds# Reinstall with specific version
pip uninstall moviepy
pip install moviepy==2.0.0Based on Google AI pricing (approximate):
- Gemini 2.0 Flash: ~$0.01 per 1000 images
- Veo 3.1 Fast: ~$0.05 per generated video clip
- Example: 10-image property β $0.50 - $1.00
- π Real Estate - Automated property listings
- π¨ Hotels - Virtual room tours
- π’ Commercial - Office space showcases
- ποΈ Rentals - Apartment walk-throughs
- ποΈ Construction - Progress documentation
- Never commit
.envfiles to Git - Add
.envto.gitignore - Use environment variables for API keys
- Rotate API keys periodically
# Environment
.env
*.env
# Output
output/
*.mp4
# API Tracking
token_counter.csv
# Python
__pycache__/
*.pyc
.venv/
venv/
# OS
.DS_Store
Thumbs.db- Audio narration using text-to-speech
- Custom branding/watermarks
- Batch processing UI
- Cloud deployment (AWS/GCP)
- Real-time progress dashboard
- Custom music integration
- Multi-language support
- 360Β° virtual tour support
run_full_pipeline()Executes the complete pipeline:
- Classify images
- Group by room type
- Generate video clips
- Stitch final tour
- Log API usage
log_api_hit(process_name, model_name, start_time, usage_metadata)
# Tracks API usage to CSV
load_image_for_veo(path)
# Prepares image for Veo model
get_image_part(path)
# Prepares image for Gemini Vision
clean_json_response(text)
# Parses JSON from AI responseContributions welcome! Please follow these steps:
- Fork the repository
- Create feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open Pull Request
This project is licensed under the MIT License - see LICENSE file for details.
- Google Gemini AI - Image classification
- Google Veo - Video generation
- MoviePy - Video editing
- Real estate photography community
Shubroto Das
- GitHub: @ShubrotoDas10
Issues or questions?
- Open an Issue
- Check Documentation
- Review Examples
If this project helped you, please consider giving it a β!
Transform Property Images into Professional Tours with AI β¨