cooldan commited on
Commit
d44648e
Β·
verified Β·
1 Parent(s): b23ad72

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +82 -401
README.md CHANGED
@@ -1,435 +1,116 @@
1
- # πŸš€ SPaCial AI - Complete OCR System
2
-
3
- > **AR-Style Live Camera Scanner + Telegram Bot + Training Data Collection**
4
-
5
- Everything runs on your Hugging Face Space - Deploy in 5 minutes! ⚑
6
-
7
- ---
8
-
9
- ## 🎯 What This Is
10
-
11
- A **complete crowdsourced OCR system** for blueprints and technical drawings:
12
-
13
- - πŸ“Έ **Live Camera Scanner** - AR-style overlay with real-time detection
14
- - πŸ€– **Telegram Bot** - Easy user interface
15
- - πŸ“Š **Training Data Collection** - Automatic model improvement
16
- - ☁️ **Cloud Hosted** - Free on Hugging Face Spaces
17
-
18
- ---
19
-
20
- ## ✨ Features
21
-
22
- ### For Users:
23
- - βœ… Send photo β†’ Get OCR results instantly
24
- - βœ… Open camera β†’ Point at text β†’ See green boxes live
25
- - βœ… Validate or correct detections
26
- - βœ… Download results as JSON
27
- - βœ… Works on any device (mobile/desktop)
28
-
29
- ### For You:
30
- - βœ… Collect training data automatically
31
- - βœ… Store everything in Telegram (free!)
32
- - βœ… No database needed
33
- - βœ… Track improvements over time
34
- - βœ… Crowdsource corrections
35
-
36
- ---
37
-
38
- ## πŸ“± User Experience
39
-
40
- ### 1. Start Bot
41
- ```
42
- User β†’ Telegram β†’ @your_bot β†’ /start
43
-
44
- Bot shows:
45
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
46
- β”‚ [πŸ“Έ Live Camera Scan] β”‚ ← Opens mini app
47
- β”‚ [πŸ“ Upload Photo] β”‚ ← Traditional
48
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
49
- ```
50
-
51
- ### 2. Live Camera (NEW!)
52
- ```
53
- Click "Live Camera Scan"
54
- ↓
55
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
56
- β”‚ πŸ“Š Scanning... β”‚
57
- β”‚ 5 zones detected β”‚
58
- β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
59
- β”‚ πŸŽ₯ CAMERA VIEW β”‚
60
- β”‚ β”‚
61
- β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β” 12.5 Β± 0.1 β”‚ ← Green boxes
62
- β”‚ β”‚ β”‚ β”‚ appear live!
63
- β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
64
- β”‚ β”‚
65
- β”‚ β”Œβ”€β”€β”€β”€β” 10.0 β”‚
66
- β”‚ β”‚ β”‚ β”‚
67
- β”‚ β””β”€β”€β”€β”€β”˜ β”‚
68
- β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
69
- β”‚ [Stop] [Capture] β”‚
70
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
71
- ```
72
-
73
- ### 3. Upload Photo
74
- ```
75
- Send photo β†’ Wait 3s β†’ Get results
76
-
77
- πŸ“Š OCR Results
78
- βœ… Found 15 zones:
79
- 1. 12.5 Β± 0.1 (98%)
80
- 2. 10.0 (95%)
81
- 3. 25.3 Β± 0.2 (97%)
82
- ...
83
-
84
- [βœ… All Correct] [✏️ Fix] [πŸ“₯ JSON]
85
- ```
86
-
87
- ---
88
-
89
- ## πŸ—οΈ Architecture
90
-
91
- ```
92
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
93
- β”‚ Hugging Face Space β”‚
94
- β”‚ β”‚
95
- β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
96
- β”‚ β”‚ app.py (Backend) β”‚ β”‚
97
- β”‚ β”‚ β€’ FastAPI OCR endpoints β”‚ β”‚
98
- β”‚ β”‚ β€’ PaddleOCR processing β”‚ β”‚
99
- β”‚ β”‚ β€’ Telegram bot handlers β”‚ β”‚
100
- β”‚ β”‚ β€’ Webhook receiver β”‚ β”‚
101
- β”‚ β”‚ β€’ Static file serving β”‚ β”‚
102
- β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
103
- β”‚ β”‚
104
- β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
105
- β”‚ β”‚ static/camera.html (Mini App) β”‚ β”‚
106
- β”‚ β”‚ β€’ Real-time camera access β”‚ β”‚
107
- β”‚ β”‚ β€’ Canvas overlay drawing β”‚ β”‚
108
- β”‚ β”‚ β€’ Live OCR visualization β”‚ β”‚
109
- β”‚ β”‚ β€’ Telegram Web App integration β”‚ β”‚
110
- β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
111
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
112
- ↕
113
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
114
- β”‚ Telegram Bot API β”‚
115
- β”‚ β€’ Webhook messages β”‚
116
- β”‚ β€’ Photos & commands β”‚
117
- β”‚ β€’ Callback buttons β”‚
118
- β”‚ β€’ Mini app launcher β”‚
119
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
120
- ↕
121
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
122
- β”‚ Users β”‚
123
- β”‚ β€’ Send /start β†’ Get camera button β”‚
124
- β”‚ β€’ Click button β†’ Mini app opens β”‚
125
- β”‚ β€’ Camera scans β†’ Live boxes appear β”‚
126
- β”‚ β€’ Or upload photo β†’ Get results β”‚
127
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
128
- ↕
129
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
130
- β”‚ Telegram Channel (Storage) β”‚
131
- β”‚ β€’ Training data (JSON) β”‚
132
- β”‚ β€’ Original images β”‚
133
- β”‚ β€’ User corrections β”‚
134
- β”‚ β€’ Free, persistent, backed up β”‚
135
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
136
- ```
137
-
138
- ---
139
-
140
- ## πŸ“¦ What's Included
141
-
142
- ### Backend (`app.py` - 1200 lines)
143
- - βœ… OCR API endpoints
144
- - βœ… Telegram bot webhook handler
145
- - βœ… Training data collection
146
- - βœ… Photo processing (upload & Telegram)
147
- - βœ… Interactive buttons (callbacks)
148
- - βœ… Commands (/start, /help, /status)
149
- - βœ… Mini app serving
150
-
151
- ### Mini App (`static/camera.html` - 270 lines)
152
- - βœ… Camera access (front/back)
153
- - βœ… Real-time frame capture
154
- - βœ… OCR API integration
155
- - βœ… Canvas overlay system
156
- - βœ… Green boxes + text labels
157
- - βœ… Status display
158
- - βœ… Start/Stop/Capture controls
159
-
160
- ### Documentation (5 files)
161
- - βœ… `README.md` - This file (overview)
162
- - βœ… `QUICK_START.md` - 5-minute deploy guide
163
- - βœ… `TELEGRAM_SETUP.md` - Bot configuration
164
- - βœ… `MINI_APP_SETUP.md` - Camera app details
165
- - βœ… `CHANGES_SUMMARY.md` - Technical changes
166
-
167
- ---
168
-
169
- ## ⚑ Quick Start
170
-
171
- ### 1. Create Telegram Bot (2 min)
172
- ```
173
- 1. Message @BotFather
174
- 2. /newbot β†’ Name it
175
- 3. Copy token
176
- ```
177
-
178
- ### 2. Create Telegram Channel (1 min)
179
- ```
180
- 1. Create private channel
181
- 2. Add bot as admin
182
- 3. Get chat ID
183
- ```
184
-
185
- ### 3. Deploy to HF Spaces (2 min)
186
- ```bash
187
- git push
188
-
189
- # Set env vars in HF Space settings:
190
- TELEGRAM_BOT_TOKEN=your_token
191
- TELEGRAM_CHAT_ID=your_chat_id
192
- SPACE_HOST=your-space-name.hf.space
193
- ```
194
-
195
- ### 4. Configure Webhook (30 sec)
196
- ```
197
- Visit: https://your-space.hf.space/telegram/set-webhook?webhook_url=https://your-space.hf.space/telegram/webhook
198
- ```
199
-
200
- ### 5. Test!
201
- ```
202
- Telegram β†’ Bot β†’ /start β†’ Click camera button β†’ DONE! πŸŽ‰
203
- ```
204
-
205
- **[Full instructions in QUICK_START.md](QUICK_START.md)**
206
-
207
- ---
208
-
209
- ## πŸŽ“ How It Works
210
-
211
- ### Live Camera Scanning:
212
-
213
- ```javascript
214
- // Mini app (camera.html)
215
- 1. Access device camera
216
- navigator.mediaDevices.getUserMedia()
217
-
218
- 2. Capture frame every 2 seconds
219
- canvas.toBlob() β†’ image data
220
-
221
- 3. Send to backend
222
- POST /ocr/process
223
-
224
- 4. Receive zones
225
- { zones: [{text, x, y, width, height}] }
226
-
227
- 5. Draw overlay
228
- ctx.strokeRect() β†’ green boxes
229
- ctx.fillText() β†’ labels
230
-
231
- 6. Repeat β†’ Live detection!
232
- ```
233
-
234
- ### Photo Upload:
235
-
236
- ```python
237
- # Backend (app.py)
238
- 1. User sends photo to bot
239
- 2. Telegram webhook β†’ /telegram/webhook
240
- 3. Download photo β†’ process_telegram_photo()
241
- 4. PaddleOCR β†’ detect zones
242
- 5. Format results β†’ format_ocr_results_for_telegram()
243
- 6. Send back to user with buttons
244
- 7. User validates β†’ send_correction_to_telegram()
245
- 8. Store in Telegram channel β†’ Training data!
246
- ```
247
-
248
  ---
249
-
250
- ## πŸ”— Endpoints
251
-
252
- ### User-Facing:
253
- - `GET /` - Health check
254
- - `GET /camera` - Mini app interface
255
- - `POST /ocr/process` - Upload & process image
256
-
257
- ### Bot Integration:
258
- - `POST /telegram/webhook` - Receive messages
259
- - `POST /telegram/set-webhook` - Configure webhook
260
- - `GET /telegram/status` - Check configuration
261
-
262
- ### Training Data:
263
- - `POST /corrections/submit` - Submit user corrections
264
-
265
- ### Documentation:
266
- - `GET /docs` - Interactive API docs (FastAPI)
267
-
268
  ---
269
 
270
- ## πŸ“Š Stats
271
 
272
- ### Code:
273
- - **Backend:** 1,200 lines (Python/FastAPI)
274
- - **Mini App:** 270 lines (HTML/JS)
275
- - **Documentation:** 5 markdown files
276
 
277
- ### Features:
278
- - **3 ways to scan:** Camera, upload, send to bot
279
- - **2 types of storage:** Telegram channel + temporary files
280
- - **1 deployment:** Everything on HF Spaces
281
 
282
- ### Performance:
283
- - **OCR:** 2-5 seconds per image
284
- - **Live scan:** Every 2 seconds
285
- - **Bot response:** <1 second
286
- - **Total latency:** ~3 seconds end-to-end
 
287
 
288
- ---
289
-
290
- ## 🌟 Why This Is Special
291
-
292
- ### Traditional OCR:
293
- ```
294
- Upload β†’ Wait β†’ Get results β†’ Done
295
- (No improvement, no feedback loop)
296
- ```
297
-
298
- ### This System:
299
- ```
300
- Scan live β†’ See boxes β†’ Validate β†’ Correct β†’ Train model β†’ Improve β†’ Better results
301
- (Continuous improvement with every user!)
302
- ```
303
 
304
- ### Unique Features:
305
- - βœ… **AR-style overlay** - See detections in real-time
306
- - βœ… **Crowdsourced training** - Users improve the model
307
- - βœ… **Telegram storage** - No database needed
308
- - βœ… **Multi-modal** - Camera, upload, or send
309
- - βœ… **Mobile-first** - Works on any device
310
- - βœ… **Zero infrastructure** - Just HF Spaces
311
 
312
- ---
313
-
314
- ## πŸ“š Documentation
315
 
316
- - **[Quick Start](QUICK_START.md)** - Deploy in 5 minutes
317
- - **[Telegram Setup](TELEGRAM_SETUP.md)** - Bot configuration guide
318
- - **[Mini App Details](MINI_APP_SETUP.md)** - Camera app documentation
319
- - **[Changes Summary](CHANGES_SUMMARY.md)** - Technical overview
320
 
321
- ---
 
 
 
322
 
323
- ## πŸ”§ Configuration
324
 
325
- ### Required Environment Variables:
326
- ```env
327
- TELEGRAM_BOT_TOKEN=1234567890:ABC...
328
- TELEGRAM_CHAT_ID=-1001234567890
329
- SPACE_HOST=your-space-name.hf.space
330
  ```
331
-
332
- ### Optional (Auto-configured):
333
- ```env
334
- PADDLE_HOME=/app/.paddlex
335
- PADDLEOCR_HOME=/app/.paddleocr
336
  ```
337
 
338
- ---
339
-
340
- ## πŸ› Troubleshooting
341
-
342
- ### Bot not responding?
343
- ```bash
344
- curl https://your-space.hf.space/telegram/status
345
  ```
346
-
347
- ### Mini app won't open?
 
 
 
 
348
  ```
349
- Check SPACE_HOST env var
350
- Try: https://your-space.hf.space/camera
351
- ```
352
-
353
- ### Camera not working?
354
- ```
355
- 1. Grant permissions
356
- 2. Use HTTPS (required)
357
- 3. Try mobile device
358
- ```
359
-
360
- ### More help:
361
- - [MINI_APP_SETUP.md](MINI_APP_SETUP.md#troubleshooting)
362
- - Check HF Space logs
363
- - Visit `/docs` for API testing
364
-
365
- ---
366
-
367
- ## 🎯 Use Cases
368
 
 
369
 
 
 
 
 
370
 
 
 
 
 
371
 
 
 
 
 
372
 
 
373
 
374
- - βœ… **Blueprint scanning** - Extract dimensions
375
- - βœ… **Technical drawings** - Detect measurements
376
- - βœ… **Quality control** - Verify dimensions
377
- - βœ… **Documentation** - Digitize old plans
378
- - βœ… **Field work** - Scan on-site
379
- - βœ… **Training data** - Collect corrections
380
 
381
- ---
382
 
 
 
 
 
383
 
 
384
 
 
 
 
 
 
385
 
 
 
 
 
 
386
 
387
- ## πŸš€ Future Enhancements
388
 
389
- ### Possible Additions:
390
- - Video file processing (scan across large blueprint)
391
- - Multi-frame stitching (combine angles)
392
- - Export to Excel/CSV
393
- - Custom models per user
394
- - Analytics dashboard
395
- - Multi-language support
396
- - Voice feedback
397
- - AR measurement tools
398
 
399
  ---
400
 
401
-
402
-
403
-
404
- ## 🀝 Contributing
405
-
406
- This is a complete, deployable system. To customize:
407
-
408
-
409
-
410
-
411
- 1. **Adjust scan interval:** `camera.html` line 150
412
- 2. **Change UI colors:** `camera.html` CSS section
413
- 3. **Modify OCR settings:** `app.py` line 363-381
414
- 4. **Add features:** Extend endpoints in `app.py`
415
-
416
- ---
417
-
418
- ## πŸ“„ License
419
-
420
- MIT License - Use freely for any purpose!
421
-
422
- ---
423
-
424
-
425
- ## πŸŽ‰ You're Ready!
426
-
427
- Deploy to Hugging Face Spaces and start scanning!
428
-
429
- **Read [QUICK_START.md](QUICK_START.md) for step-by-step instructions.**
430
-
431
- ---
432
-
433
- Built with ❀️ for the blueprint scanning community
434
-
435
- **Questions?** Check the docs or HF Space logs!
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ title: SPaCial AI OCR Service
3
+ emoji: πŸ”
4
+ colorFrom: blue
5
+ colorTo: purple
6
+ sdk: docker
7
+ sdk_version: "4.21.0"
8
+ app_file: app.py
9
+ pinned: false
10
+ license: mit
 
 
 
 
 
 
 
 
 
 
11
  ---
12
 
13
+ # SPaCial AI OCR Service πŸ”
14
 
15
+ Advanced OCR service using PaddleOCR for dimension detection in technical drawings. Perfect for extracting measurements, tolerances, and text from engineering drawings.
 
 
 
16
 
17
+ ## πŸš€ Features
 
 
 
18
 
19
+ - **High-Accuracy OCR**: Uses PaddleOCR with multiple detection modes
20
+ - **Dimension Detection**: Automatically identifies measurements and tolerances
21
+ - **Vertical Text Support**: Handles rotated text (90Β°, 180Β°, 270Β°)
22
+ - **Interactive Canvas**: Draw rectangles or click to detect text
23
+ - **Real-time Processing**: Fast and efficient text extraction
24
+ - **Multiple Modes**: Fast, accurate, and hardcore detection modes
25
 
26
+ ## 🎯 How to Use
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
+ ### 1. Upload an Image
29
+ - Click "Choose File" to upload a technical drawing
30
+ - Supported formats: JPG, PNG, WebP
 
 
 
 
31
 
32
+ ### 2. Auto-Detection
33
+ - The system automatically detects all text zones
34
+ - Each zone shows confidence percentage and rotation angle
35
 
36
+ ### 3. Manual Selection
37
+ - **Double-click**: Click on any text to detect it precisely
38
+ - **Draw Rectangle**: Drag to draw a rectangle around text for better detection
 
39
 
40
+ ### 4. Zone Management
41
+ - **Rotate**: Click the rotate button to improve vertical text detection
42
+ - **Fit**: Click thumbnail to re-OCR with better accuracy
43
+ - **Delete**: Remove unwanted zones
44
 
45
+ ## πŸ”§ API Endpoints
46
 
47
+ ### Process Image
 
 
 
 
48
  ```
49
+ POST /ocr/process
50
+ - file: Image file
51
+ - mode: "fast", "accurate", or "hardcore"
52
+ - rotation: 0, 90, 180, 270 degrees
 
53
  ```
54
 
55
+ ### Process Center Point
 
 
 
 
 
 
56
  ```
57
+ POST /ocr/process-center
58
+ - image: Base64 encoded image
59
+ - center_point: {"x": x, "y": y}
60
+ - rectangle_bounds: {"x1": x1, "y1": y1, "x2": x2, "y2": y2}
61
+ - use_rectangle: true/false
62
+ - rotation: rotation angle
63
  ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
 
65
+ ## πŸ› οΈ Technical Details
66
 
67
+ ### Detection Modes
68
+ - **Fast**: Quick detection for position finding
69
+ - **Accurate**: Balanced speed and accuracy
70
+ - **Hardcore**: Maximum accuracy with preprocessing
71
 
72
+ ### Vertical Text Handling
73
+ - Automatic detection of vertical text regions
74
+ - 90Β° rotation for better OCR accuracy
75
+ - Proper coordinate mapping back to original image
76
 
77
+ ### Text Correction
78
+ - Built-in correction rules for common OCR errors
79
+ - Tolerance parsing for engineering measurements
80
+ - Dimension validation and formatting
81
 
82
+ ## πŸ“Š Performance
83
 
84
+ - **Processing Time**: 1-3 seconds per image
85
+ - **Accuracy**: 95%+ for clear technical drawings
86
+ - **Supported Languages**: English (optimized for numbers and dimensions)
87
+ - **Image Size**: Up to 10MB, auto-resized for processing
 
 
88
 
89
+ ## πŸ” Use Cases
90
 
91
+ - **Engineering Drawings**: Extract dimensions and tolerances
92
+ - **Technical Documentation**: Digitize handwritten measurements
93
+ - **Quality Control**: Verify measurements on drawings
94
+ - **CAD Integration**: Convert scanned drawings to digital data
95
 
96
+ ## 🚨 Troubleshooting
97
 
98
+ ### Common Issues
99
+ 1. **Low Confidence**: Try "hardcore" mode or draw a rectangle around text
100
+ 2. **Vertical Text**: Use the rotate button to improve detection
101
+ 3. **Split Text**: Draw a rectangle to capture the full text
102
+ 4. **Small Text**: Ensure image resolution is sufficient
103
 
104
+ ### Tips for Best Results
105
+ - Use high-contrast images
106
+ - Ensure text is clearly visible
107
+ - For vertical text, use the rotate feature
108
+ - Draw rectangles around complex text regions
109
 
110
+ ## πŸ“ License
111
 
112
+ This project is part of the SPaCial AI system for technical drawing analysis.
 
 
 
 
 
 
 
 
113
 
114
  ---
115
 
116
+ **Ready to extract text from your technical drawings? Upload an image and start detecting!** 🎯