Lightning-Pod Vision
Overview
The core purpose of this repo is to help Lightning.ai users familiarize with the Lightning ecosystem by providing an example image classification product built with Lightning. The product is an intelligent agent behind a visual interface.
It uses Lightning, ReactJS + the Vercel ecosystem, FastAPI, Supabase, Zuplo, and Prisma.
This is a work in progress, especially the front end.
The docs can be viewed at visionpod-docs.vercel.app
The NextJS app can be viewed at visionpod.vercel.app
Programming Languages and Concepts
Languages
- Python: data engineering, and machine learning
- TypeScript and JavaScript: front-end design and visualization, and select back-end services
- Rust: exposure via project tooling (ruff, turbo) may require troubleshooting errors
Data Engineering and Database Management
- Python + Supabase-Py + Postgres: data acquisition and pushing to Supabase-Postgres
Model Development and Serving
- Lightning: developing and serving the model
- Optuna: hyperparameter optimization trials
- Weights and Biases: experiment management
- FastAPI: developing an API to serve the model with
- Locust: API load balance testing
User Interfaces
- Supabase: database, storage, and user management
- Prisma: Next-generation Node.js and TypeScript ORM
- TurboRepo + NextJS + React: front end
- Vercel: hosting the front end, and monitoring + analytics
Domain
- Topics:
- Computer Vision
- Image Classification
- Data Source: torchvision CIFAR10
- Domain Libraries: torchvision
- Model: Linear Encoder Decoder
Roadmap
The general outline for building this project is:
- data acquistion and storage
- do HPO trials and train from best trial config
- persist model
- build Model serving API with FastAPI
- determine feedback criteria for front end users
- design and build front end
- improve on feedback
Structure
The structure of the project is:
docs-src
is the docusaurus projectlightning-app
is the root Lightning Flow and App that will be deployed to Lightningnext-app
is the Next + React frontend deployed to Vercelpipeline
handles data engineering for Supabase and Prismarequirements
+requirements.txt
helps CI/CD jobs install Python requirementsresearch
handles HPO and trainingtests
are tests for visionpodvisionpod
is the python package and deep learning network
visionpod is the primary source code for the default branch. the following modules will be handled on separate production branches:
Module | Branch |
---|---|
docs-src | docs |
lightning-app | l-app |
next-app | n-app |
Setup
You must have Python and NVM installed.
Installing NVM on macOS
brew install nvm
# update .zshrc or .bashrc
vim .zshrc
add the following to your profile:
to insert snippet, hit:
shift
+i
export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh
to exit insert mode, hit:
esc
+shift
+:wq!
then restart your terminal, and check the nvm version with:
nvm -v
proceed to installing node, enabling yarn, and creating a quickstart project with vite
nvm install lts
corepack enable
To setup a virtual development environment, in terminal, do:
python3 -m venv .venv/
source .venv/bin/activate
pip install -e ".[full]"
pre-commit install
deactivate
cd next-app
yarn config set nodeLinker node-module
yarn install
cd ..