How ssyquia/claw-patrol works
Project Type and Purpose
• This is a single-service, full-stack ML application built with Streamlit (front-end + lightweight back-end) for image classification.
• Purpose: Users upload a dinosaur image; the app uses a ResNet152V2 model to predict one of 15 species.
File Structure
• Top-level:
• app.py – Streamlit entry point
• model/ – holds the trained ResNet152V2 model file(s)
• data/ – labeled images (used offline for training/experimentation)
• dino-cnn.ipynb – Jupyter notebook for model development/training
• requirements.txt – Python dependencies (Streamlit, TensorFlow/Keras, etc.)
• .devcontainer/ – Docker devcontainer setup for reproducible local development
• venv/ – local Python virtual environment
• No persistent database; inference is served directly from the file system.
README for Insights
• Confirms front-end is served by Streamlit Cloud.
• Highlights the core ML component: ResNet152V2.
• No external APIs or microservices.
Main Components & Their Relationships
a. User & Web Client
• A user accesses the Streamlit web UI via browser (or mobile).
b. Deployment Environment
• Streamlit Cloud (or containerized server) hosting app.py
• Python runtime environment with dependencies from requirements.txt
c. Inference Engine
• app.py routes image inputs into the model loader/inference module
• The ResNet152V2 model is loaded from model/ directory at startup
d. Data Layer (Offline)
• data/ directory used during local training (shown for completeness)
e. Development Environment
• .devcontainer for Dockerized VS Code development
• dino-cnn.ipynb for experimentation and retraining
Interactions (Data Flow):
1. User → uploads image via Streamlit UI
2. Streamlit front-end (in app.py) → passes image to inference function
3. Inference function → loads and runs ResNet152V2 on the image
4. Prediction result → sent back to front-end
5. Streamlit UI → displays predicted species to the user
Architectural Patterns & Principles
• Single-page application with clear separation:
• Presentation layer (Streamlit widgets & layout)
• Inference logic (model loading & prediction)
• Containerized development ensures environment parity (.devcontainer)
• Reusable modules: model loader, preprocessing, prediction
Detailed Components
• Streamlit Server (app.py)
• Dependency Loader (requirements.txt, venv)
• Inference Function (preprocessing + model.predict)
• Model Repository (model/.h5 or saved_weights)
• Offline Training Notebook (dino-cnn.ipynb)
• Devcontainer (Docker config)