How ojasrane/singular-value-decomposition works
This repository is an SVD learning and image-compression application, exposed through a Streamlit lab and reusable Python modules. Users can explore compression interactively, upload and compress images for download, view images or custom .svd files, and experiment with PCA. The compute path supports both NumPy-optimized and from-scratch SVD; PCA uses the optimized method, while metrics quantify reconstruction and storage tradeoffs. Edges follow the README and shown imports/calls; unsampled page details and analysis notebooks are not expanded into runtime flows.
Main entry points: playground.py SVD and PCA playground · optimized_svd.py Optimized SVD · landing_page.py Lab home · image_compression.py Image compression
Components 12
Interactive lab
- Lab home
web_app/landing_page.py - Image compressor
web_app/pages/compressor.py - SVD and PCA playground
web_app/pages/playground.py - Image viewer
web_app/pages/image_viewer.py
SVD and PCA
- Image compression
application/image_compression.py - Optimized SVD
optimized_method/optimized_svd.py - Scratch SVD
mathematical_foundation/svd_from_scratch.py - PCA
application/principal_component_analysis.py
Encoding and metrics
- SVD file encoder
svd_encoder/svd.py - Compression metrics
metrics/metrics.py - Array and file helpers
utils.py
Other components
- Visitor
Connections 18
- Visitor → Lab home: opens lab
README.md - Lab home → SVD and PCA playground: routes to
web_app/landing_page.py - Lab home → Image compressor: routes to
web_app/landing_page.py - Lab home → Image viewer: routes to
web_app/landing_page.py - Image compressor → Image compression: compresses image
web_app/pages/compressor.py - Image compressor → Compression metrics: reads ratio
web_app/pages/compressor.py - SVD and PCA playground → Optimized SVD: reconstructs
web_app/pages/playground.py - SVD and PCA playground → Image compression: gets k
web_app/pages/playground.py - SVD and PCA playground → PCA: fits and projects
web_app/pages/playground.py - SVD and PCA playground → Compression metrics: plots quality
web_app/pages/playground.py - Image viewer → SVD file encoder: decodes SVD
web_app/pages/image_viewer.py - Image compression → Optimized SVD: decomposes and reconstructs
application/image_compression.py - Image compression → Scratch SVD: decomposes
application/image_compression.py - PCA → Optimized SVD: decomposes data
application/principal_component_analysis.py - SVD file encoder → Optimized SVD: decomposes and reconstructs
svd_encoder/svd.py - SVD file encoder → Array and file helpers: reads bytes
svd_encoder/svd.py - Compression metrics → Array and file helpers: extracts diagonal
metrics/metrics.py - Optimized SVD → Array and file helpers: extracts diagonal
optimized_method/optimized_svd.py