A comprehensive Django-based travel application that combines AI-powered landmark identification with location-based exploration and travel planning features.
Creator: Divyansh Chaudhary, MCS from UIUC
- AI Landmark Identification: Upload images and get instant landmark recognition using advanced computer vision models
- Nearby Exploration: Discover landmarks and attractions around your current location using Google Places API
- Travel Planning: Save and manage your favorite locations in a personalized travel plan
- Interactive Chat: Ask questions about identified landmarks using AI-powered conversational interface
- VQA (Visual Question Answering) Model: Identifies landmarks from uploaded images
- GPT-2 Integration: Generates detailed descriptions and answers questions about landmarks
- Real-time Processing: Instant AI model status monitoring and response generation
- Google Places Integration: Real-time nearby location discovery
- Interactive Maps: Visual representation of saved locations using Leaflet.js
- Location Management: Save, organize, and remove locations from your travel plan
Travel Guide App/
βββ requirements.txt # Python dependencies
βββ travelguide/ # Main Django project
β βββ manage.py # Django management script
β βββ db.sqlite3 # SQLite database
β βββ core/ # Main Django app
β β βββ models.py # Database models
β β βββ views.py # View functions and logic
β β βββ urls.py # URL routing
β β βββ forms.py # Django forms
β β βββ admin.py # Django admin configuration
β β βββ apps.py # App configuration
β β βββ vqa_service.py # VQA model service
β β βββ gpt2_service.py # GPT-2 model service
β β βββ migrations/ # Database migrations
β β βββ templates/core/ # HTML templates
β β βββ home.html # Landing page
β β βββ login.html # Login page
β β βββ signup.html # Registration page
β β βββ profile.html # User profile page
β β βββ explore_nearby.html # Nearby exploration page
β β βββ find_landmark.html # Landmark identification page
β β βββ plan.html # Travel planning page
β βββ static/ # Static files
β β βββ css/ # Stylesheets
β β β βββ style.css # Main styles
β β β βββ explore.css # Exploration page styles
β β βββ js/ # JavaScript files
β β β βββ main.js # Main JavaScript
β β β βββ explore.js # Exploration functionality
β β β βββ signup.js # Registration validation
β β βββ images/ # Static images
β βββ media/ # User-uploaded files
β β βββ landmark_images/ # Uploaded landmark images
β β βββ profile_pictures/ # User profile pictures
β βββ travelguide/ # Django project settings
β βββ settings.py # Django settings
β βββ urls.py # Main URL configuration
β βββ wsgi.py # WSGI configuration
β βββ asgi.py # ASGI configuration
βββ test_*.py # Test files
- Python 3.9 or higher
- pip (Python package installer)
- Git
git clone <repository-url>
cd "Travel Guide App"# Copy the example environment file
cp env.example .env
# Edit .env file with your configuration
# - Generate a new Django SECRET_KEY
# - Add your Google Places API key (optional)
# - Configure other settings as neededpython -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activatepip install -r requirements.txtcd travelguide
python manage.py makemigrations
python manage.py migratepython manage.py createsuperuserpython manage.py runserverThe application will be available at http://127.0.0.1:8000/
- Django 4.2.23: Web framework
- Pillow 10.1.0: Image processing
- torch 2.1.2: PyTorch for deep learning
- torchvision 0.16.2: Computer vision utilities
- transformers 4.36.0: Hugging Face transformers library
- timm 0.9.10: Computer vision models
- numpy: Numerical computing
- sentencepiece 0.1.99: Text tokenization
- peft 0.7.1: Parameter-efficient fine-tuning
Location: core/vqa_service.py, core/views.py
How it works:
- Uses a pre-trained VQA (Visual Question Answering) model
- Processes uploaded images through the model
- Extracts landmark names from AI responses
- Provides detailed descriptions and chat functionality
Key Components:
# VQA Service initialization
class VQAService:
def __init__(self):
self.model = None
self.processor = None
self.is_ready = False
def identify_landmark(self, image_path):
# Process image and return landmark identificationLocation: core/views.py, static/js/explore.js
How it works:
- Uses Google Places API for location discovery
- Implements geolocation to find user's current position
- Displays nearby landmarks with ratings, types, and addresses
- Allows saving locations to travel plan
Key Features:
- Real-time location search
- Interactive save/unsave functionality
- Persistent saved state management
Location: core/models.py, core/views.py, templates/core/plan.html
How it works:
SavedLocationmodel stores user's saved places- Interactive map using Leaflet.js
- AJAX-based save/remove operations
- Supports both regular locations and AI-identified landmarks
Database Model:
class SavedLocation(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE)
place_id = models.CharField(max_length=255, unique=True)
name = models.CharField(max_length=255)
address = models.TextField()
latitude = models.DecimalField(max_digits=9, decimal_places=6, null=True)
longitude = models.DecimalField(max_digits=9, decimal_places=6, null=True)
types = models.JSONField(default=list)
rating = models.DecimalField(max_digits=3, decimal_places=1, null=True)
saved_at = models.DateTimeField(auto_now_add=True)Location: core/models.py, core/views.py, core/forms.py
Features:
- Custom user profile with profile pictures
- Secure authentication system
- User-specific saved locations
- Profile management interface
Location: core/views.py, templates/core/find_landmark.html
How it works:
- Real-time chat interface for landmark questions
- Integrates with VQA model for contextual responses
- Maintains conversation context about identified landmarks
- Bootstrap 5.3.0: Responsive UI framework
- Bootstrap Icons: Icon library
- Custom CSS: Modern, gradient-based design
- Squircle Cards: Rounded corner design elements
- AJAX Integration: Seamless backend communication
- Real-time Updates: Dynamic content loading
- Form Validation: Client-side validation
- Interactive Maps: Leaflet.js integration
The application uses environment variables for sensitive configuration. Copy env.example to .env and configure:
- SECRET_KEY: Generate a new Django secret key
- DEBUG: Set to
Falsein production - ALLOWED_HOSTS: Configure for your domain
- GOOGLE_PLACES_API_KEY: Add your API key for location features
- Database: Consider PostgreSQL for production
- Never commit
.envfiles to version control - Generate a unique SECRET_KEY for each deployment
- Use environment variables for all sensitive data
- Keep DEBUG=False in production
- Regularly update dependencies
To enable nearby location features:
- Get a Google Places API key
- Add it to your environment variables
- Configure the API in the views
The project includes several test files:
test_vqa.py: VQA model testingtest_gpt2_integration.py: GPT-2 integration testingtest_dependencies.py: Dependency verification
Run tests with:
python manage.py test- Static Files: Run
python manage.py collectstatic - Database: Use PostgreSQL or MySQL
- Web Server: Configure with Nginx + Gunicorn
- Environment: Set
DEBUG=False - Security: Update
SECRET_KEYandALLOWED_HOSTS
FROM python:3.9
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
RUN python manage.py collectstatic --noinput
EXPOSE 8000
CMD ["gunicorn", "travelguide.wsgi:application"]- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.
Divyansh Chaudhary
MCS from UIUC
- LinkedIn: https://www.linkedin.com/in/divyansh7c
- GitHub: https://github.com/itsDV7
- Django community for the excellent web framework
- Hugging Face for the transformer models
- Google Places API for location services
- Bootstrap team for the UI framework
- UIUC for the academic foundation
Built with β€οΈ and AI π€
