AKA Math commited on
Commit Β·
d962d48
1
Parent(s): 2d190aa
Remove emojis and symbols from all files, update Dockerfile
Browse files- Dockerfile +1 -0
- GETTING_STARTED.md +20 -20
- IMAGES.md +5 -5
- LICENSE +1 -1
- PROJECT_SUMMARY.md +30 -32
- README.md +10 -10
- run_simple.sh β run.sh +0 -0
Dockerfile
CHANGED
|
@@ -7,6 +7,7 @@ WORKDIR /app
|
|
| 7 |
RUN apt-get update && apt-get install -y \
|
| 8 |
libgl1 \
|
| 9 |
libglib2.0-0 \
|
|
|
|
| 10 |
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
# Copy requirements first for better caching
|
|
|
|
| 7 |
RUN apt-get update && apt-get install -y \
|
| 8 |
libgl1 \
|
| 9 |
libglib2.0-0 \
|
| 10 |
+
curl \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
# Copy requirements first for better caching
|
GETTING_STARTED.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
-
#
|
| 2 |
|
| 3 |
Welcome! This guide will help you get the demo up and running in just a few minutes.
|
| 4 |
|
| 5 |
-
##
|
| 6 |
|
| 7 |
- **Python 3.11+** (Python 3.9+ should also work)
|
| 8 |
- **Git** (for cloning the repository)
|
|
@@ -13,7 +13,7 @@ Optional:
|
|
| 13 |
- **Make** (for convenient commands)
|
| 14 |
- **Docker** (for containerized deployment)
|
| 15 |
|
| 16 |
-
##
|
| 17 |
|
| 18 |
The absolute fastest way to get started:
|
| 19 |
|
|
@@ -30,7 +30,7 @@ cd sampling-quantization
|
|
| 30 |
|
| 31 |
That's it! Your browser should open to `http://localhost:8501`
|
| 32 |
|
| 33 |
-
##
|
| 34 |
|
| 35 |
### Step 1: Clone the Repository (if needed)
|
| 36 |
|
|
@@ -50,10 +50,10 @@ cd sampling-quantization
|
|
| 50 |
```
|
| 51 |
|
| 52 |
This will:
|
| 53 |
-
-
|
| 54 |
-
-
|
| 55 |
-
-
|
| 56 |
-
-
|
| 57 |
|
| 58 |
#### Option B: Manual Setup
|
| 59 |
|
|
@@ -107,7 +107,7 @@ http://localhost:8501
|
|
| 107 |
|
| 108 |
If it doesn't open automatically, manually navigate to that URL.
|
| 109 |
|
| 110 |
-
##
|
| 111 |
|
| 112 |
Run the test script to make sure everything is working:
|
| 113 |
|
|
@@ -121,10 +121,10 @@ python test_setup.py
|
|
| 121 |
|
| 122 |
You should see:
|
| 123 |
```
|
| 124 |
-
|
| 125 |
```
|
| 126 |
|
| 127 |
-
##
|
| 128 |
|
| 129 |
Once the app is running:
|
| 130 |
|
|
@@ -153,7 +153,7 @@ Once the app is running:
|
|
| 153 |
- Read the explanations
|
| 154 |
- Experiment with different settings
|
| 155 |
|
| 156 |
-
##
|
| 157 |
|
| 158 |
### Problem: "Python not found"
|
| 159 |
|
|
@@ -212,7 +212,7 @@ sudo apt-get install libgl1 libglib2.0-0
|
|
| 212 |
- Close other browser tabs
|
| 213 |
- Check your internet connection (if loading external images)
|
| 214 |
|
| 215 |
-
##
|
| 216 |
|
| 217 |
### For Students
|
| 218 |
- Work through the "Educational Insights" tabs
|
|
@@ -231,7 +231,7 @@ sudo apt-get install libgl1 libglib2.0-0
|
|
| 231 |
- Check out PROJECT_SUMMARY.md for technical details
|
| 232 |
- See IMAGES.md for working with custom images
|
| 233 |
|
| 234 |
-
##
|
| 235 |
|
| 236 |
Want to share this with others online?
|
| 237 |
|
|
@@ -254,7 +254,7 @@ Follow the prompts and enter your Space name (e.g., "username/sampling-demo").
|
|
| 254 |
|
| 255 |
Your demo will be live at: `https://huggingface.co/spaces/username/sampling-demo`
|
| 256 |
|
| 257 |
-
##
|
| 258 |
|
| 259 |
If you prefer Docker:
|
| 260 |
|
|
@@ -268,7 +268,7 @@ docker run -p 8501:8501 sampling-demo
|
|
| 268 |
# Access at http://localhost:8501
|
| 269 |
```
|
| 270 |
|
| 271 |
-
##
|
| 272 |
|
| 273 |
```bash
|
| 274 |
# Setup and installation
|
|
@@ -293,7 +293,7 @@ make deploy # Alternative using make
|
|
| 293 |
make clean # Remove virtual environment
|
| 294 |
```
|
| 295 |
|
| 296 |
-
##
|
| 297 |
|
| 298 |
Before diving in, you might want to review:
|
| 299 |
- Digital image representation basics
|
|
@@ -320,10 +320,10 @@ Good starting points:
|
|
| 320 |
- **Discussions**: Ask questions in GitHub Discussions
|
| 321 |
- **Email**: Contact the course instructor
|
| 322 |
|
| 323 |
-
##
|
| 324 |
|
| 325 |
-
If you made it here and the app is running, congratulations!
|
| 326 |
|
| 327 |
You're ready to explore the fascinating world of image sampling and quantization.
|
| 328 |
|
| 329 |
-
**Enjoy the demo!**
|
|
|
|
| 1 |
+
# Getting Started with the Sampling & Quantization Demo
|
| 2 |
|
| 3 |
Welcome! This guide will help you get the demo up and running in just a few minutes.
|
| 4 |
|
| 5 |
+
## Prerequisites
|
| 6 |
|
| 7 |
- **Python 3.11+** (Python 3.9+ should also work)
|
| 8 |
- **Git** (for cloning the repository)
|
|
|
|
| 13 |
- **Make** (for convenient commands)
|
| 14 |
- **Docker** (for containerized deployment)
|
| 15 |
|
| 16 |
+
## βοΈ Quick Start (30 seconds)
|
| 17 |
|
| 18 |
The absolute fastest way to get started:
|
| 19 |
|
|
|
|
| 30 |
|
| 31 |
That's it! Your browser should open to `http://localhost:8501`
|
| 32 |
|
| 33 |
+
## Detailed Installation
|
| 34 |
|
| 35 |
### Step 1: Clone the Repository (if needed)
|
| 36 |
|
|
|
|
| 50 |
```
|
| 51 |
|
| 52 |
This will:
|
| 53 |
+
- Create a virtual environment
|
| 54 |
+
- Install all dependencies
|
| 55 |
+
- Verify your Python version
|
| 56 |
+
- Run basic checks
|
| 57 |
|
| 58 |
#### Option B: Manual Setup
|
| 59 |
|
|
|
|
| 107 |
|
| 108 |
If it doesn't open automatically, manually navigate to that URL.
|
| 109 |
|
| 110 |
+
## Verify Installation
|
| 111 |
|
| 112 |
Run the test script to make sure everything is working:
|
| 113 |
|
|
|
|
| 121 |
|
| 122 |
You should see:
|
| 123 |
```
|
| 124 |
+
All tests passed! Ready to run the demo.
|
| 125 |
```
|
| 126 |
|
| 127 |
+
## First Steps in the Demo
|
| 128 |
|
| 129 |
Once the app is running:
|
| 130 |
|
|
|
|
| 153 |
- Read the explanations
|
| 154 |
- Experiment with different settings
|
| 155 |
|
| 156 |
+
## Troubleshooting
|
| 157 |
|
| 158 |
### Problem: "Python not found"
|
| 159 |
|
|
|
|
| 212 |
- Close other browser tabs
|
| 213 |
- Check your internet connection (if loading external images)
|
| 214 |
|
| 215 |
+
## Next Steps
|
| 216 |
|
| 217 |
### For Students
|
| 218 |
- Work through the "Educational Insights" tabs
|
|
|
|
| 231 |
- Check out PROJECT_SUMMARY.md for technical details
|
| 232 |
- See IMAGES.md for working with custom images
|
| 233 |
|
| 234 |
+
## Deploying to Hugging Face Spaces
|
| 235 |
|
| 236 |
Want to share this with others online?
|
| 237 |
|
|
|
|
| 254 |
|
| 255 |
Your demo will be live at: `https://huggingface.co/spaces/username/sampling-demo`
|
| 256 |
|
| 257 |
+
## Docker Deployment (Advanced)
|
| 258 |
|
| 259 |
If you prefer Docker:
|
| 260 |
|
|
|
|
| 268 |
# Access at http://localhost:8501
|
| 269 |
```
|
| 270 |
|
| 271 |
+
## Common Commands Reference
|
| 272 |
|
| 273 |
```bash
|
| 274 |
# Setup and installation
|
|
|
|
| 293 |
make clean # Remove virtual environment
|
| 294 |
```
|
| 295 |
|
| 296 |
+
## Learning Resources
|
| 297 |
|
| 298 |
Before diving in, you might want to review:
|
| 299 |
- Digital image representation basics
|
|
|
|
| 320 |
- **Discussions**: Ask questions in GitHub Discussions
|
| 321 |
- **Email**: Contact the course instructor
|
| 322 |
|
| 323 |
+
## Success!
|
| 324 |
|
| 325 |
+
If you made it here and the app is running, congratulations!
|
| 326 |
|
| 327 |
You're ready to explore the fascinating world of image sampling and quantization.
|
| 328 |
|
| 329 |
+
**Enjoy the demo!**
|
IMAGES.md
CHANGED
|
@@ -161,11 +161,11 @@ This ensures the demo works even without internet access or external dependencie
|
|
| 161 |
## Testing Your Images
|
| 162 |
|
| 163 |
Before using an image in production, test:
|
| 164 |
-
-
|
| 165 |
-
-
|
| 166 |
-
-
|
| 167 |
-
-
|
| 168 |
-
-
|
| 169 |
|
| 170 |
## Need Help?
|
| 171 |
|
|
|
|
| 161 |
## Testing Your Images
|
| 162 |
|
| 163 |
Before using an image in production, test:
|
| 164 |
+
- Does it load quickly?
|
| 165 |
+
- Are effects visible at different sampling rates?
|
| 166 |
+
- Does quantization create noticeable banding?
|
| 167 |
+
- Are JPEG artifacts visible at low quality?
|
| 168 |
+
- Is the file size reasonable (<5MB)?
|
| 169 |
|
| 170 |
## Need Help?
|
| 171 |
|
LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
MIT License
|
| 2 |
|
| 3 |
-
Copyright (c) 2025 Image Analysis Course
|
| 4 |
|
| 5 |
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
| 1 |
MIT License
|
| 2 |
|
| 3 |
+
Copyright (c) 2025 Uni Bern Intro to Image Analysis Course
|
| 4 |
|
| 5 |
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
of this software and associated documentation files (the "Software"), to deal
|
PROJECT_SUMMARY.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
#
|
| 2 |
|
| 3 |
## Overview
|
| 4 |
|
|
@@ -7,7 +7,7 @@ This interactive educational demo teaches fundamental concepts in digital image
|
|
| 7 |
- **Quantization**: How bit depth impacts color representation
|
| 8 |
- **Compression**: Differences between PNG (lossless) and JPEG (lossy)
|
| 9 |
|
| 10 |
-
##
|
| 11 |
|
| 12 |
### Interactive Controls
|
| 13 |
- **Sampling Grid Size Slider** (1-16x): Shows pixelation effect and pixel count reduction
|
|
@@ -24,7 +24,7 @@ This interactive educational demo teaches fundamental concepts in digital image
|
|
| 24 |
- **Visual Examples**: All concepts demonstrated with live image processing
|
| 25 |
- **Formula Explanations**: Mathematical basis for all calculations
|
| 26 |
|
| 27 |
-
##
|
| 28 |
|
| 29 |
Students will learn:
|
| 30 |
1. The relationship between sampling rate and image resolution
|
|
@@ -33,7 +33,7 @@ Students will learn:
|
|
| 33 |
4. Differences between lossy and lossless compression
|
| 34 |
5. How JPEG blocking artifacts occur
|
| 35 |
|
| 36 |
-
##
|
| 37 |
|
| 38 |
```
|
| 39 |
sampling-quantization/
|
|
@@ -60,7 +60,7 @@ sampling-quantization/
|
|
| 60 |
βββ check_status.sh # Check deployment status
|
| 61 |
```
|
| 62 |
|
| 63 |
-
##
|
| 64 |
|
| 65 |
### For Users (Simplest)
|
| 66 |
```bash
|
|
@@ -82,7 +82,7 @@ pip install -r requirements.txt
|
|
| 82 |
streamlit run app.py
|
| 83 |
```
|
| 84 |
|
| 85 |
-
##
|
| 86 |
|
| 87 |
### 1. Hugging Face Spaces (Recommended)
|
| 88 |
```bash
|
|
@@ -104,7 +104,7 @@ docker run -p 8501:8501 sampling-demo
|
|
| 104 |
streamlit run app.py --server.port 8501
|
| 105 |
```
|
| 106 |
|
| 107 |
-
##
|
| 108 |
|
| 109 |
### Suggested Lesson Plan
|
| 110 |
|
|
@@ -116,14 +116,14 @@ streamlit run app.py --server.port 8501
|
|
| 116 |
|
| 117 |
**Part 2: Quantization (15 minutes)**
|
| 118 |
1. Reset sampling to 1x
|
| 119 |
-
2. Reduce bits per pixel (8
|
| 120 |
3. Discuss: Color banding, posterization
|
| 121 |
4. Show grayscale interpretation
|
| 122 |
|
| 123 |
**Part 3: Compression (20 minutes)**
|
| 124 |
1. Apply moderate sampling/quantization
|
| 125 |
2. Compare PNG vs JPEG at different qualities
|
| 126 |
-
3. At JPEG quality < 30: Point out
|
| 127 |
4. Discuss use cases for each format
|
| 128 |
|
| 129 |
**Part 4: Interactive Exploration (10 minutes)**
|
|
@@ -136,16 +136,16 @@ streamlit run app.py --server.port 8501
|
|
| 136 |
1. What is the minimum acceptable sampling rate for your use case?
|
| 137 |
2. How many bits per pixel do you really need for grayscale medical images?
|
| 138 |
3. When would you choose PNG over JPEG and vice versa?
|
| 139 |
-
4. Why do JPEG artifacts appear in
|
| 140 |
5. What's the total storage for 1000 photos at different settings?
|
| 141 |
|
| 142 |
-
##
|
| 143 |
|
| 144 |
### Image Processing Pipeline
|
| 145 |
```
|
| 146 |
Original Image
|
| 147 |
β
|
| 148 |
-
Spatial Sampling (downsample
|
| 149 |
β
|
| 150 |
Quantization (reduce bits per channel)
|
| 151 |
β
|
|
@@ -156,10 +156,10 @@ Display + File Size Calculation
|
|
| 156 |
|
| 157 |
### File Size Calculation
|
| 158 |
```
|
| 159 |
-
Raw Size = (Width / Sampling)
|
| 160 |
|
| 161 |
-
PNG Size β Raw Size
|
| 162 |
-
JPEG Size β Raw Size
|
| 163 |
```
|
| 164 |
|
| 165 |
### Key Algorithms
|
|
@@ -168,7 +168,7 @@ JPEG Size β Raw Size Γ 0.3 (typical compression ratio)
|
|
| 168 |
- **Quantization**: `floor(value / step) * step` where `step = 256 / 2^bits`
|
| 169 |
- **JPEG**: OpenCV's `cv.imencode()` with quality parameter
|
| 170 |
|
| 171 |
-
##
|
| 172 |
|
| 173 |
### Change Default Image
|
| 174 |
Edit `load_sample_image()` in `app.py`:
|
|
@@ -198,21 +198,21 @@ See `CONTRIBUTING.md` for guidelines on adding:
|
|
| 198 |
- Interactive exercises
|
| 199 |
- Batch processing
|
| 200 |
|
| 201 |
-
##
|
| 202 |
|
| 203 |
- **Load Time**: < 2 seconds on first load (with caching)
|
| 204 |
- **Interactive Response**: Real-time (< 100ms per slider change)
|
| 205 |
- **Memory Usage**: ~200-300 MB (depends on image size)
|
| 206 |
- **Supported Image Sizes**: Up to 4K (auto-resized to 512px for demo)
|
| 207 |
|
| 208 |
-
##
|
| 209 |
|
| 210 |
1. Very large images (>10MB) may be slow - auto-resized to 512px
|
| 211 |
2. JPEG artifact visibility depends on image content
|
| 212 |
3. File size estimates are approximate (actual compression varies)
|
| 213 |
4. Generated sample image is simple (encourage uploading real images)
|
| 214 |
|
| 215 |
-
##
|
| 216 |
|
| 217 |
Concepts covered align with:
|
| 218 |
- Digital Image Processing (Gonzalez & Woods)
|
|
@@ -220,7 +220,7 @@ Concepts covered align with:
|
|
| 220 |
- Signal processing curricula
|
| 221 |
- Compression theory courses
|
| 222 |
|
| 223 |
-
##
|
| 224 |
|
| 225 |
We welcome contributions! See `CONTRIBUTING.md` for:
|
| 226 |
- Bug reports
|
|
@@ -229,32 +229,30 @@ We welcome contributions! See `CONTRIBUTING.md` for:
|
|
| 229 |
- Documentation improvements
|
| 230 |
- Educational content enhancements
|
| 231 |
|
| 232 |
-
##
|
| 233 |
|
| 234 |
MIT License - Free for educational and commercial use
|
| 235 |
|
| 236 |
-
##
|
| 237 |
|
| 238 |
- Inspired by interactive teaching tools in computer vision
|
| 239 |
- Built with Streamlit for rapid prototyping
|
| 240 |
- OpenCV for image processing
|
| 241 |
- HuggingFace for free hosting
|
| 242 |
|
| 243 |
-
##
|
| 244 |
|
| 245 |
- **Issues**: GitHub Issues for bugs and features
|
| 246 |
- **Questions**: Discussion board for educational questions
|
| 247 |
- **Documentation**: See README.md, QUICKSTART.md, IMAGES.md
|
| 248 |
|
| 249 |
-
##
|
| 250 |
|
| 251 |
Perfect for:
|
| 252 |
-
-
|
| 253 |
-
-
|
| 254 |
-
-
|
| 255 |
-
-
|
| 256 |
-
-
|
| 257 |
|
| 258 |
-
---
|
| 259 |
-
|
| 260 |
-
**Ready to start?** Run `./run_simple.sh` and explore! π
|
|
|
|
| 1 |
+
# Image Sampling and Quantization Demo - Project Summary
|
| 2 |
|
| 3 |
## Overview
|
| 4 |
|
|
|
|
| 7 |
- **Quantization**: How bit depth impacts color representation
|
| 8 |
- **Compression**: Differences between PNG (lossless) and JPEG (lossy)
|
| 9 |
|
| 10 |
+
## Key Features
|
| 11 |
|
| 12 |
### Interactive Controls
|
| 13 |
- **Sampling Grid Size Slider** (1-16x): Shows pixelation effect and pixel count reduction
|
|
|
|
| 24 |
- **Visual Examples**: All concepts demonstrated with live image processing
|
| 25 |
- **Formula Explanations**: Mathematical basis for all calculations
|
| 26 |
|
| 27 |
+
## Educational Objectives
|
| 28 |
|
| 29 |
Students will learn:
|
| 30 |
1. The relationship between sampling rate and image resolution
|
|
|
|
| 33 |
4. Differences between lossy and lossless compression
|
| 34 |
5. How JPEG blocking artifacts occur
|
| 35 |
|
| 36 |
+
## Project Structure
|
| 37 |
|
| 38 |
```
|
| 39 |
sampling-quantization/
|
|
|
|
| 60 |
βββ check_status.sh # Check deployment status
|
| 61 |
```
|
| 62 |
|
| 63 |
+
## Quick Start
|
| 64 |
|
| 65 |
### For Users (Simplest)
|
| 66 |
```bash
|
|
|
|
| 82 |
streamlit run app.py
|
| 83 |
```
|
| 84 |
|
| 85 |
+
## Deployment Options
|
| 86 |
|
| 87 |
### 1. Hugging Face Spaces (Recommended)
|
| 88 |
```bash
|
|
|
|
| 104 |
streamlit run app.py --server.port 8501
|
| 105 |
```
|
| 106 |
|
| 107 |
+
## Teaching with This Demo
|
| 108 |
|
| 109 |
### Suggested Lesson Plan
|
| 110 |
|
|
|
|
| 116 |
|
| 117 |
**Part 2: Quantization (15 minutes)**
|
| 118 |
1. Reset sampling to 1x
|
| 119 |
+
2. Reduce bits per pixel (8 to 4 to 2 to 1)
|
| 120 |
3. Discuss: Color banding, posterization
|
| 121 |
4. Show grayscale interpretation
|
| 122 |
|
| 123 |
**Part 3: Compression (20 minutes)**
|
| 124 |
1. Apply moderate sampling/quantization
|
| 125 |
2. Compare PNG vs JPEG at different qualities
|
| 126 |
+
3. At JPEG quality < 30: Point out 8x8 blocking
|
| 127 |
4. Discuss use cases for each format
|
| 128 |
|
| 129 |
**Part 4: Interactive Exploration (10 minutes)**
|
|
|
|
| 136 |
1. What is the minimum acceptable sampling rate for your use case?
|
| 137 |
2. How many bits per pixel do you really need for grayscale medical images?
|
| 138 |
3. When would you choose PNG over JPEG and vice versa?
|
| 139 |
+
4. Why do JPEG artifacts appear in 8x8 blocks?
|
| 140 |
5. What's the total storage for 1000 photos at different settings?
|
| 141 |
|
| 142 |
+
## Technical Details
|
| 143 |
|
| 144 |
### Image Processing Pipeline
|
| 145 |
```
|
| 146 |
Original Image
|
| 147 |
β
|
| 148 |
+
Spatial Sampling (downsample to upsample with nearest neighbor)
|
| 149 |
β
|
| 150 |
Quantization (reduce bits per channel)
|
| 151 |
β
|
|
|
|
| 156 |
|
| 157 |
### File Size Calculation
|
| 158 |
```
|
| 159 |
+
Raw Size = (Width / Sampling) x (Height / Sampling) x Channels x Bits / 8
|
| 160 |
|
| 161 |
+
PNG Size β Raw Size x 0.7 (typical compression ratio)
|
| 162 |
+
JPEG Size β Raw Size x 0.3 (typical compression ratio)
|
| 163 |
```
|
| 164 |
|
| 165 |
### Key Algorithms
|
|
|
|
| 168 |
- **Quantization**: `floor(value / step) * step` where `step = 256 / 2^bits`
|
| 169 |
- **JPEG**: OpenCV's `cv.imencode()` with quality parameter
|
| 170 |
|
| 171 |
+
## Customization
|
| 172 |
|
| 173 |
### Change Default Image
|
| 174 |
Edit `load_sample_image()` in `app.py`:
|
|
|
|
| 198 |
- Interactive exercises
|
| 199 |
- Batch processing
|
| 200 |
|
| 201 |
+
## Performance
|
| 202 |
|
| 203 |
- **Load Time**: < 2 seconds on first load (with caching)
|
| 204 |
- **Interactive Response**: Real-time (< 100ms per slider change)
|
| 205 |
- **Memory Usage**: ~200-300 MB (depends on image size)
|
| 206 |
- **Supported Image Sizes**: Up to 4K (auto-resized to 512px for demo)
|
| 207 |
|
| 208 |
+
## Known Limitations
|
| 209 |
|
| 210 |
1. Very large images (>10MB) may be slow - auto-resized to 512px
|
| 211 |
2. JPEG artifact visibility depends on image content
|
| 212 |
3. File size estimates are approximate (actual compression varies)
|
| 213 |
4. Generated sample image is simple (encourage uploading real images)
|
| 214 |
|
| 215 |
+
## Educational Resources
|
| 216 |
|
| 217 |
Concepts covered align with:
|
| 218 |
- Digital Image Processing (Gonzalez & Woods)
|
|
|
|
| 220 |
- Signal processing curricula
|
| 221 |
- Compression theory courses
|
| 222 |
|
| 223 |
+
## Contributing
|
| 224 |
|
| 225 |
We welcome contributions! See `CONTRIBUTING.md` for:
|
| 226 |
- Bug reports
|
|
|
|
| 229 |
- Documentation improvements
|
| 230 |
- Educational content enhancements
|
| 231 |
|
| 232 |
+
## License
|
| 233 |
|
| 234 |
MIT License - Free for educational and commercial use
|
| 235 |
|
| 236 |
+
## Acknowledgments
|
| 237 |
|
| 238 |
- Inspired by interactive teaching tools in computer vision
|
| 239 |
- Built with Streamlit for rapid prototyping
|
| 240 |
- OpenCV for image processing
|
| 241 |
- HuggingFace for free hosting
|
| 242 |
|
| 243 |
+
## Support
|
| 244 |
|
| 245 |
- **Issues**: GitHub Issues for bugs and features
|
| 246 |
- **Questions**: Discussion board for educational questions
|
| 247 |
- **Documentation**: See README.md, QUICKSTART.md, IMAGES.md
|
| 248 |
|
| 249 |
+
## Success Stories
|
| 250 |
|
| 251 |
Perfect for:
|
| 252 |
+
- Graduate image analysis courses
|
| 253 |
+
- Computer vision fundamentals
|
| 254 |
+
- Self-paced online learning
|
| 255 |
+
- Workshop demonstrations
|
| 256 |
+
- Research group tutorials
|
| 257 |
|
| 258 |
+
--- **Ready to start?** Run `./run_simple.sh` and explore!
|
|
|
|
|
|
README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
---
|
| 2 |
title: Image Sampling and Quantization Demo
|
| 3 |
-
emoji:
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: purple
|
| 6 |
sdk: streamlit
|
|
@@ -10,9 +10,9 @@ pinned: false
|
|
| 10 |
license: mit
|
| 11 |
---
|
| 12 |
|
| 13 |
-
#
|
| 14 |
|
| 15 |
-
An educational demonstration showing how sampling and quantization impact image visualization and storage.
|
| 16 |
|
| 17 |
## What You'll Learn
|
| 18 |
|
|
@@ -35,11 +35,11 @@ This interactive demo teaches fundamental concepts in digital image processing:
|
|
| 35 |
|
| 36 |
## Features
|
| 37 |
|
| 38 |
-
-
|
| 39 |
-
-
|
| 40 |
-
-
|
| 41 |
-
-
|
| 42 |
-
-
|
| 43 |
|
| 44 |
## Local Development
|
| 45 |
|
|
@@ -72,7 +72,7 @@ The app will be available at `http://localhost:8501`
|
|
| 72 |
This app is designed to be deployed to Hugging Face Spaces:
|
| 73 |
|
| 74 |
1. Create a new Space on [Hugging Face](https://huggingface.co/spaces)
|
| 75 |
-
2. Choose "
|
| 76 |
3. Push this repository to your Space
|
| 77 |
|
| 78 |
Or use the deployment script:
|
|
@@ -94,7 +94,7 @@ This demo is designed for:
|
|
| 94 |
|
| 95 |
- **Nyquist Sampling Theorem**: Understanding sampling limits
|
| 96 |
- **Bit Depth**: Relationship between bits and color/gray levels
|
| 97 |
-
- **File Size Calculation**: Width
|
| 98 |
- **Lossy vs. Lossless Compression**: JPEG vs. PNG trade-offs
|
| 99 |
- **Blocking Artifacts**: DCT-based compression effects
|
| 100 |
|
|
|
|
| 1 |
---
|
| 2 |
title: Image Sampling and Quantization Demo
|
| 3 |
+
emoji:
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: purple
|
| 6 |
sdk: streamlit
|
|
|
|
| 10 |
license: mit
|
| 11 |
---
|
| 12 |
|
| 13 |
+
# Interactive Image Sampling and Quantization Demo
|
| 14 |
|
| 15 |
+
An educational demonstration showing how sampling and quantization impact image visualization and storage.
|
| 16 |
|
| 17 |
## What You'll Learn
|
| 18 |
|
|
|
|
| 35 |
|
| 36 |
## Features
|
| 37 |
|
| 38 |
+
- **Interactive Sliders**: Real-time adjustment of sampling rate and bit depth
|
| 39 |
+
- **Live File Size Estimates**: See how changes affect storage requirements
|
| 40 |
+
- **Side-by-Side Comparisons**: Original vs. processed images
|
| 41 |
+
- **Compression Artifacts**: Visualize JPEG blocking effects
|
| 42 |
+
- **Educational Insights**: Learn the theory behind each concept
|
| 43 |
|
| 44 |
## Local Development
|
| 45 |
|
|
|
|
| 72 |
This app is designed to be deployed to Hugging Face Spaces:
|
| 73 |
|
| 74 |
1. Create a new Space on [Hugging Face](https://huggingface.co/spaces)
|
| 75 |
+
2. Choose "Docker" as the SDK
|
| 76 |
3. Push this repository to your Space
|
| 77 |
|
| 78 |
Or use the deployment script:
|
|
|
|
| 94 |
|
| 95 |
- **Nyquist Sampling Theorem**: Understanding sampling limits
|
| 96 |
- **Bit Depth**: Relationship between bits and color/gray levels
|
| 97 |
+
- **File Size Calculation**: Width x Height x Bits per pixel / 8
|
| 98 |
- **Lossy vs. Lossless Compression**: JPEG vs. PNG trade-offs
|
| 99 |
- **Blocking Artifacts**: DCT-based compression effects
|
| 100 |
|
run_simple.sh β run.sh
RENAMED
|
File without changes
|