How otniel113/jankenpon-deploy works
Project type and purpose
• This is a Python-based web application (Flask) that serves a pre‐trained CNN model (best_model.h5) to classify user‐uploaded images as rock, paper, or scissors.
• It’s deployed on Heroku (Procfile present), with a lightweight frontend (HTML + uploads) and a backend inference service.
File structure
• app.py: Flask application entry point, routes, and inference logic
• best_model.h5: Serialized Keras CNN model used at runtime
• requirements.txt: Python dependencies (Flask, TensorFlow/Keras, etc.)
• Procfile: Declares Gunicorn command for Heroku deployment
• templates/index.html: Jinja2 template for the upload form and result display
• static/uploads: Directory for temporarily storing user uploads
Key insights from the README
• Deployed URL: https://jankenpon-deploy.herokuapp.com/
• Inference relies on a CNN trained elsewhere (Jankenpon-CV3 repo).
• Known limitations: less accurate on real-world data, tends toward “paper” predictions.
Main components and their relationships
a. Client (Web Browser)
• Presents HTML form (index.html) to user
• Uploads image via HTTP POST
b. Load Balancer / Heroku Router (optional layer)
• Receives incoming requests, forwards to web dyno
c. Web Dyno (Gunicorn + Flask)
• Gunicorn workers launch app.py
• Routes: “/” serves index.html, “/predict” handles uploads
• On upload: saves file to static/uploads, invokes Keras model
d. ML Inference Component
• In-memory loading of best_model.h5 at startup or per request
• Processes image, returns prediction label
e. Storage
• Ephemeral Heroku filesystem for static/uploads
• No persistent database in this project
f. Response Flow
• Flask renders a results page or JSON payload
• Client displays prediction
Architectural patterns and technologies
• Two-Tier (Client + Server + ML library)
• MVC-style separation: Templates (View), app.py (Controller), model file (Model)
• RESTful endpoint for predictions
• Heroku deployment using Gunicorn (Procfile)
• TensorFlow/Keras for CNN inference
Detailed elements
• Labels: “User Browser,” “Heroku Router,” “Gunicorn,” “Flask app.py,” “CNN model (best_model.h5),” “static/uploads folder”
• Data flows: file upload path, inference call, HTTP response path
• Notes on config: Procfile declares “web: gunicorn app:app”
• External links: Keras, Flask, Heroku