Currently, Google Cloud Run instances have been deleted in order to save costs. URLs in the code won't work, but replacing them with newly created URLs will do the job after creating new instances.
This project presents a scalable image processing system that leverages a hybrid cloud architecture combining local virtual machines (VMs) and serverless cloud containers. It supports multiple concurrent users via a Streamlit-based frontend and intelligently distributes image processing tasks using a custom load balancer based on real-time CPU utilization metrics.
- Modular microservices for:
- Image-to-sketch conversion
- Background removal
- Image caption generation (using Salesforce BLIP)
- Real-time CPU and RAM monitoring of VMs
- Automatic task offloading to Google Cloud Run when VM load exceeds a threshold
- REST APIs and socket communication for robust inter-process coordination
- Dynamic dashboard for monitoring system health and task status
- Support for multiple concurrent users and image uploads
- Frontend: Streamlit UI for task selection, image upload, and result visualization.
- Backend:
- Flask APIs for communication between components.
- A load balancer that chooses between VMs or Google Cloud Run based on current load.
- Dockerized microservices hosted locally or on GCP.
- Monitoring: Real-time metrics shared via
psutiland socket programming. - Cloud Integration: Auto-scaling containers deployed on Cloud Run.
- User selects an operation and uploads images via the Streamlit UI.
- Task is routed by the load balancer to the most optimal resource (VM or GCP).
- Image processing is executed and results returned to the frontend.
- Admin dashboard updates live resource metrics for monitoring.
- Python, Flask, Streamlit
- Google Cloud Run
- Docker
psutil,socket,OpenCV,rembg,transformers(for BLIP)
/frontend/- Streamlit app (homepage.py)/load_balancer/- Load distribution logic, live metrics management/vm_tasks/- Flask APIs for image processing services/containers/- Dockerfiles and deployment configs for GCP/monitoring/- Admin dashboard and resource logging
- Python 3.8+
- Docker installed and configured
- Google Cloud CLI configured with billing and IAM roles set up
- VirtualBox or another VM environment (if running local VMs)
- Demonstrated scalability via autoscaling containers
- Live visualization of system resource usage
- Successful processing of complex image tasks (e.g., BLIP captioning) with intelligent load redirection
- Horizontal VM autoscaling using infrastructure-as-code
- ML-based predictive routing in the load balancer
- Support for additional cloud providers (Azure, AWS) to avoid vendor lock-in
- Secure API layer and data encryption for sensitive workloads