Spaces:
Sleeping
Sleeping
Quick Start Guide - VQA Mobile App
This guide will help you get the VQA mobile app running quickly.
Prerequisites Checklist
- Python 3.8+ installed
- Node.js 16+ installed
- VQA model checkpoints available
- Smartphone with Expo Go app installed
- Computer and phone on same WiFi network
Step-by-Step Setup
Step 1: Start the Backend Server
# Open terminal/PowerShell
cd c:\Users\rdeva\Downloads\vqa_coes
# Install backend dependencies (first time only)
pip install -r requirements_api.txt
# Start the server
python backend_api.py
Expected output:
π INITIALIZING ENSEMBLE VQA SYSTEM
βοΈ Device: cuda
π₯ Loading models...
β
Ensemble ready!
Important: Keep this terminal window open! The server must keep running.
Step 2: Find Your Local IP Address
Windows:
ipconfig
Look for "IPv4 Address" under your WiFi adapter (e.g., 192.168.1.100)
Mac/Linux:
ifconfig
# or
ip addr
Step 3: Configure the Mobile App
- Open
ui/src/config/api.js - Replace the IP address:
export const API_BASE_URL = 'http://YOUR_IP_HERE:8000'; // Example: export const API_BASE_URL = 'http://192.168.1.100:8000';
Step 4: Configure Google OAuth (Optional for Testing)
For testing without Google login, you can skip this and modify the app to bypass authentication.
For full Google login:
- Go to Google Cloud Console
- Create a project
- Enable Google+ API
- Create OAuth 2.0 credentials
- Update
ui/src/config/google.jswith your client IDs
Step 5: Start the Mobile App
# Open a NEW terminal/PowerShell
cd c:\Users\rdeva\Downloads\vqa_coes\ui
# Start Expo
npm start
Expected output:
Metro waiting on exp://192.168.1.100:8081
βΊ Scan the QR code above with Expo Go (Android) or the Camera app (iOS)
Step 6: Run on Your Phone
Install Expo Go on your phone:
Scan the QR code:
- Android: Open Expo Go app β Scan QR code
- iOS: Open Camera app β Scan QR code β Tap notification
Wait for app to load (first time may take 1-2 minutes)
Testing Without Google Login
If you want to test the VQA functionality without setting up Google OAuth:
- Open
ui/App.js - Temporarily modify the navigation to always show HomeScreen:
// Replace this:
{user ? (
<Stack.Screen name="Home" component={HomeScreen} />
) : (
<Stack.Screen name="Login" component={LoginScreen} />
)}
// With this:
<Stack.Screen name="Home" component={HomeScreen} />
- Restart the Expo server
Testing the App
Test 1: General Question (Base Model)
- Tap "Gallery" and select an image
- Enter question: "What color is the car?"
- Tap "Ask Question"
- Should show: π Base Model
Test 2: Spatial Question (Spatial Model)
- Select an image with multiple objects
- Enter question: "What is to the right of the table?"
- Tap "Ask Question"
- Should show: π Spatial Model
Troubleshooting
"Cannot connect to server"
- β Check backend is running
- β
Verify IP address in
api.jsis correct - β Ensure phone and computer on same WiFi
- β Check firewall isn't blocking port 8000
"Model not loaded"
- β Check checkpoint files are in project root
- β
Verify file names:
vqa_checkpoint.ptandvqa_spatial_checkpoint.pt - β Check backend terminal for error messages
App won't load on phone
- β Ensure Expo Go is installed
- β Check both devices on same network
- β
Try restarting Expo server (Ctrl+C, then
npm start) - β
Clear Expo cache:
npm start -- --clear
"Permission denied" for camera/gallery
- β Grant permissions when prompted
- β Check phone settings β App permissions
Next Steps
Once everything works:
- Set up Google OAuth for production use
- Customize the UI in
src/styles/theme.js - Add custom icons in
assets/folder - Build standalone app with
eas build
Quick Commands Reference
# Start backend
cd c:\Users\rdeva\Downloads\vqa_coes
python backend_api.py
# Start mobile app
cd c:\Users\rdeva\Downloads\vqa_coes\ui
npm start
# Clear Expo cache
npm start -- --clear
# Install new package
npm install package-name
# Check backend health
curl http://localhost:8000/health
Support
If you encounter issues:
- Check the main README.md
- Review backend terminal logs
- Check Expo console for errors
- Verify all prerequisites are met