How kanavgoyal898/chromavive works
Project type and purpose
• chromaVive is a full-stack web application (Flask/Python backend + HTML/CSS frontend) that lets users upload grayscale images and colorize them using one of two deep-learning models (ECCV16 for automatic colorization, SIGGRAPH17 for user-guided colorization).
File structure
• Top-level files:
• README.md, requirements.txt – project overview and dependencies
• test.ipynb – exploratory/testing notebook
• src/
• app.py – Flask application entrypoint and route definitions
• colorization/
– demo_release.py – orchestrates image I/O, model loading, and inference
– colorizers/ – Python modules implementing ECCV16 and SIGGRAPH17 pipelines
– imgs, imgs_out – sample input/output folders
• static/ – CSS and client-side assets
• templates/ – Jinja2 templates (index.html upload form, result.html display, base.html layout)
README for architecture clues
• Backend uses Flask with Flask-Session for request handling and session persistence
• Deep learning inference via PyTorch, loading pretrained models for ECCV16 and SIGGRAPH17
• Two operational modes: fully automatic vs. user-hint guided colorization
• Frontend is a thin UI layer sending images via HTTP POST to Flask endpoints
Main components
a. Client (Web Browser)
• UI: HTML templates, CSS assets, file chooser, hint-point drawing interface
b. Web Server (Flask)
• app.py: defines routes (/ , /colorize_auto, /colorize_guided)
• Session Manager: stores user hints and intermediate data
c. Colorization Service
• demo_release.py: receives image and hints, selects model
• Model Loader: loads ECCV16 or SIGGRAPH17 PyTorch weights
• Inference Engine: runs forward pass, returns colorized image
d. Data Stores
• Temporary file storage (imgs, imgs_out) or in-memory buffers
• Session store (Flask-Session)
e. External Libraries & Frameworks
• Flask, Flask-Session – HTTP server & session management
• PyTorch – loading and running neural nets
• Jinja2 – templating
f. (Optional) Notebook Environment
• test.ipynb – used for prototyping, not in production flow
Relationships and data flow
2. Browser issues HTTP POST to Flask endpoint
3. Flask route handler calls demo_release.py
4. demo_release loads appropriate colorizer class from colorizers/
5. Colorizer loads pretrained weights (PyTorch) and performs inference
6. demo_release saves or streams back the colorized image
7. Flask returns rendered result.html displaying output
8. Browser renders the colorized image
Architectural patterns and design principles
• MVC-like separation:
• Model = PyTorch networks & colorizers
• View = Jinja2 templates + static CSS
• Controller = Flask routes + demo_release orchestrator
• Single-process, synchronous inference for simplicity
• Modularity: each colorizer algorithm encapsulated under src/colorization/colorizers