Abdul Rafay commited on
Commit
aedb7f1
Β·
1 Parent(s): a4ef98f

readme file added

Browse files
Files changed (1) hide show
  1. readme.md +102 -0
readme.md ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Numera
3
+ emoji: πŸ”’
4
+ colorFrom: indigo
5
+ colorTo: purple
6
+ sdk: docker
7
+ app_file: main.py
8
+ pinned: false
9
+ ---
10
+
11
+ # πŸ”’ Numera
12
+
13
+ ### From Scribble to Signal.
14
+
15
+ Numera is a neural network–powered web app that recognizes handwritten digits (0–9).
16
+ Draw a number on the canvas and let the model predict it in real time.
17
+
18
+ ---
19
+
20
+ ## 🧠 About the Model
21
+
22
+ - Built with **PyTorch**
23
+ - Convolutional Neural Network (CNN)
24
+ - Trained on the **MNIST dataset**
25
+ - ~98% accuracy
26
+ - CPU-optimized for fast inference
27
+
28
+ ---
29
+
30
+ ## βš™οΈ How It Works
31
+
32
+ 1. User draws a digit on the canvas
33
+ 2. Image is converted to grayscale
34
+ 3. Image is inverted (to match MNIST format)
35
+ 4. Resized to 28Γ—28
36
+ 5. Passed through the CNN model
37
+ 6. Prediction + confidence score returned
38
+
39
+ ---
40
+
41
+ ## πŸ— Tech Stack
42
+
43
+ - **FastAPI** – Backend API
44
+ - **Gradio** – Interactive frontend
45
+ - **PyTorch** – Model inference
46
+ - **Docker** – Deployment
47
+ - Hosted on **Hugging Face Spaces**
48
+
49
+ ---
50
+
51
+ ## πŸš€ Deployment
52
+
53
+ This Space uses the **Docker runtime**.
54
+
55
+ The container:
56
+ - Installs dependencies
57
+ - Loads `model.pt`
58
+ - Runs `uvicorn main:app`
59
+ - Serves the app on port 7860
60
+
61
+ ---
62
+
63
+ ## πŸ“ Project Structure
64
+
65
+ .
66
+ β”œβ”€β”€ main.py # FastAPI + Gradio app
67
+ β”œβ”€β”€ model.py # CNN architecture
68
+ β”œβ”€β”€ model.pt # Trained weights (Git LFS)
69
+ β”œβ”€β”€ requirements.txt
70
+ β”œβ”€β”€ Dockerfile
71
+ └── README.md
72
+
73
+
74
+ ---
75
+
76
+ ## 🎯 Features
77
+
78
+ βœ”οΈ Draw digits directly in browser
79
+ βœ”οΈ Real-time prediction
80
+ βœ”οΈ Confidence score display
81
+ βœ”οΈ Lightweight CPU deployment
82
+
83
+ ---
84
+
85
+ ## πŸ‘¨β€πŸ’» Author
86
+
87
+ Developed by **Abdul Rafay**
88
+ Computer Science student building AI-powered systems.
89
+
90
+ ---
91
+
92
+ ## πŸ“Œ Future Improvements
93
+
94
+ - Probability distribution chart
95
+ - Model versioning
96
+ - GPU support
97
+ - Improved preprocessing pipeline
98
+ - CI/CD integration
99
+
100
+ ---
101
+
102
+ ✨ Thank you for trying Numera!