#mobileClip-Search: Image Search Application
An image search application based on Apple's mobileClip-Search model, supporting both text-to-image and image-to-image search capabilities.
- Text-to-image search
- Image-to-image similarity search
- Support for both local and AWS S3 storage
- Docker containerization
- AWS EC2 cloud deployment
- Real-time image processing and search
- Efficient vector indexing with FAISS
- Backend: Flask
- Deep Learning: PyTorch
- Model: Apple mobileClip-Search
- Vector Search: FAISS
- Deployment: Docker, AWS EC2
- Storage: Local filesystem / AWS S3
- Web Server: Gunicorn
- Clone the repository and install dependencies:
git clone [your-repository-url]
cd mobileClip-Search
pip install -r requirements.txt- Download the model:
mkdir -p checkpoints
# Download mobileclip_s0.pt to the checkpoints directory- Configure environment variables:
cp .env.example .env
# Edit .env file with your configuration- Run the application:
python app.py- Build and run with Docker:
docker-compose up --build-
Prepare AWS environment:
- Create an EC2 instance
- Configure security group (open port 80)
- Create S3 bucket (if using S3 mode)
-
Configure deployment:
- Copy SSH key to ~/.ssh/
- Configure .env file
-
Deploy:
bash deploy/deploy.shmobileClip-Search/
├── app.py # Main application file
├── requirements.txt # Python dependencies
├── templates/ # HTML templates
│ └── index.html # Main page
├── checkpoints/ # Model directory
│ └── mobileclip_s0.pt # mobileClip-Search model
├── images/ # Image library directory
├── cache/ # Cache directory
├── deploy/ # Deployment files
│ ├── deploy.sh # Deployment script
│ ├── Dockerfile # Docker configuration
│ └── docker-compose.yml # Docker Compose configuration
└── scripts/ # Utility scripts
└── logs.sh # Log viewing script
Configure the following variables in your .env file:
# AWS Credentials
AWS_ACCESS_KEY_ID=your_access_key_id
AWS_SECRET_ACCESS_KEY=your_secret_access_key
AWS_DEFAULT_REGION=ap-southeast-2
S3_BUCKET=your-bucket-name
# EC2 Configuration
EC2_IP=your.ec2.ip.address
EC2_KEY=path/to/your/key.pem
# Application Configuration
STORAGE_TYPE=s3 # or 'local'
FLASK_ENV=production-
Text Search:
- Enter descriptive text in the search box
- Click the "Search" button
- View the most relevant images
-
Image Search:
- Click the "Upload Image" button
- Select an image file
- View similar images
# View real-time logs
bash scripts/logs.sh -f
# View last 100 lines
bash scripts/logs.sh -n 100
# View logs with timestamps
bash scripts/logs.sh -t# Update application
bash deploy/deploy.sh