Add files using upload-large-folder tool
Browse files- .gitattributes +5 -0
- HTMLDownload.png +3 -0
- LunaProcessing.png +3 -0
- PDFPreview.png +3 -0
- RAWMD.png +3 -0
- RAWText.png +3 -0
- README.md +189 -330
.gitattributes
CHANGED
@@ -33,3 +33,8 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
RAWMD.png filter=lfs diff=lfs merge=lfs -text
|
37 |
+
HTMLDownload.png filter=lfs diff=lfs merge=lfs -text
|
38 |
+
PDFPreview.png filter=lfs diff=lfs merge=lfs -text
|
39 |
+
RAWText.png filter=lfs diff=lfs merge=lfs -text
|
40 |
+
LunaProcessing.png filter=lfs diff=lfs merge=lfs -text
|
HTMLDownload.png
ADDED
![]() |
Git LFS Details
|
LunaProcessing.png
ADDED
![]() |
Git LFS Details
|
PDFPreview.png
ADDED
![]() |
Git LFS Details
|
RAWMD.png
ADDED
![]() |
Git LFS Details
|
RAWText.png
ADDED
![]() |
Git LFS Details
|
README.md
CHANGED
@@ -26,59 +26,92 @@ license: mit
|
|
26 |
|
27 |
## ✨ **What Makes Luna OCR Special**
|
28 |
|
29 |
-
<div align="center">
|
30 |
-
|
31 |
-
### 🎯 **Core Capabilities**
|
32 |
-
|
33 |
-
</div>
|
34 |
-
|
35 |
<table>
|
36 |
<tr>
|
37 |
<td align="center" width="25%">
|
38 |
-
|
39 |
-
|
40 |
-
|
|
|
|
|
41 |
</td>
|
42 |
<td align="center" width="25%">
|
43 |
-
|
44 |
-
|
45 |
-
|
|
|
|
|
46 |
</td>
|
47 |
<td align="center" width="25%">
|
48 |
-
|
49 |
-
|
50 |
-
|
|
|
|
|
51 |
</td>
|
52 |
<td align="center" width="25%">
|
53 |
-
|
54 |
-
|
55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
</td>
|
57 |
</tr>
|
58 |
</table>
|
59 |
|
60 |
---
|
61 |
|
62 |
-
##
|
63 |
|
64 |
<table>
|
65 |
<tr>
|
66 |
<td width="50%">
|
67 |
|
68 |
-
###
|
69 |
-
|
70 |
-
|
71 |
-
- 🌐 **HTML Documents**: Interactive viewer with styling
|
72 |
-
- ⚡ **Real-time**: Live progress updates and preview
|
73 |
|
74 |
</td>
|
75 |
<td width="50%">
|
76 |
|
77 |
-
### 🎨 **
|
78 |
-
|
79 |
-
-
|
80 |
-
- 🌐 **HTML**: Styled output with glassmorphism theme
|
81 |
-
- 📄 **Plain Text**: Clean, readable format
|
82 |
|
83 |
</td>
|
84 |
</tr>
|
@@ -86,123 +119,107 @@ license: mit
|
|
86 |
|
87 |
---
|
88 |
|
89 |
-
##
|
90 |
|
91 |
<table>
|
92 |
<tr>
|
93 |
<td align="center" width="25%">
|
94 |
-
|
95 |
-
|
96 |
-
|
|
|
|
|
97 |
</td>
|
98 |
<td align="center" width="25%">
|
99 |
-
|
100 |
-
|
101 |
-
|
|
|
|
|
102 |
</td>
|
103 |
<td align="center" width="25%">
|
104 |
-
|
105 |
-
|
106 |
-
|
|
|
|
|
107 |
</td>
|
108 |
<td align="center" width="25%">
|
109 |
-
|
110 |
-
|
111 |
-
|
|
|
|
|
112 |
</td>
|
113 |
</tr>
|
114 |
</table>
|
115 |
|
116 |
-
### 🎨 **UI/UX
|
|
|
117 |
| Component | Technology | Purpose |
|
118 |
|-----------|------------|---------|
|
119 |
| 🎭 **Design System** | Glassmorphism + Radix UI | Modern, accessible interface |
|
120 |
| ⚡ **Animations** | Framer Motion + GSAP | Smooth, professional transitions |
|
121 |
| 📱 **Responsiveness** | CSS Grid + Flexbox | Perfect on all devices |
|
122 |
-
|
|
123 |
|
124 |
---
|
125 |
|
126 |
-
## 📦 **
|
127 |
-
|
128 |
-
### 🚀 **Quick Start (2 minutes)**
|
129 |
|
130 |
```bash
|
131 |
-
#
|
132 |
git clone https://huggingface.co/veela4/luna_ocr
|
133 |
cd luna_ocr
|
134 |
|
135 |
-
#
|
136 |
npm install && cd server && npm install && cd ..
|
137 |
|
138 |
-
#
|
139 |
npm start
|
140 |
```
|
141 |
|
142 |
-
> 🔐 **No .env file needed!** API keys are stored securely in encrypted local storage
|
143 |
|
144 |
### 🌐 **Access Points**
|
|
|
145 |
| Service | URL | Purpose |
|
146 |
|---------|-----|---------|
|
147 |
-
| 🖥️ **Frontend** | `http://localhost:3000` | Main application
|
148 |
-
| 🔧 **Backend
|
149 |
-
| 📊 **Health Check** | `http://localhost:3002/api/health` | System status
|
150 |
|
151 |
---
|
152 |
|
153 |
-
##
|
154 |
|
155 |
<table>
|
156 |
<tr>
|
157 |
<td width="33%">
|
158 |
|
159 |
-
###
|
160 |
-
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
- 📋 **PDF Files**
|
165 |
-
- Multi-page processing
|
166 |
-
- Page-by-page extraction
|
167 |
-
- Progress tracking
|
168 |
-
- 🌐 **HTML Documents**
|
169 |
-
- Styled content
|
170 |
-
- Table preservation
|
171 |
-
- Interactive viewer
|
172 |
|
173 |
</td>
|
174 |
<td width="33%">
|
175 |
|
176 |
-
###
|
177 |
-
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
- 🇺🇸 **English**
|
182 |
-
- High accuracy
|
183 |
-
- Technical terminology
|
184 |
-
- Mixed language support
|
185 |
-
- 🌍 **Multi-language**
|
186 |
-
- Auto-detection
|
187 |
-
- Preserve original language
|
188 |
-
- Mixed content handling
|
189 |
|
190 |
</td>
|
191 |
<td width="33%">
|
192 |
|
193 |
-
###
|
194 |
-
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
- 🧠 **Structured Mode**
|
199 |
-
- Gemini 2.5 Pro
|
200 |
-
- Maximum accuracy
|
201 |
-
- Advanced formatting
|
202 |
-
- 📊 **Smart Tables**
|
203 |
-
- Auto-detection
|
204 |
-
- Structure preservation
|
205 |
-
- Sortable output
|
206 |
|
207 |
</td>
|
208 |
</tr>
|
@@ -210,99 +227,66 @@ npm start
|
|
210 |
|
211 |
---
|
212 |
|
213 |
-
##
|
|
|
|
|
|
|
|
|
214 |
|
215 |
-
###
|
|
|
|
|
|
|
|
|
216 |
|
217 |
-
|
218 |
-
|
219 |
-
| **📝 Markdown** | Documentation | Tables, headers, formatting | GitHub, wikis, blogs |
|
220 |
-
| **📊 JSON** | Data processing | Structured, queryable | APIs, databases, analytics |
|
221 |
-
| **🌐 HTML** | Web publishing | Styled, interactive | Websites, reports, presentations |
|
222 |
-
| **📄 Plain Text** | Quick reading | Clean, readable | Notes, emails, drafts |
|
223 |
|
224 |
-
###
|
|
|
|
|
|
|
|
|
225 |
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
|
230 |
-
|
231 |
-
|--------|--------|------|
|
232 |
-
| กาแฟ อเมริกาโน่ | 2 แก้ว | 120 บาท |
|
233 |
-
| ขนมปังโฮลวีท | 1 ชิ้น | 45 บาท |
|
234 |
|
235 |
-
|
236 |
-
```
|
237 |
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
"fileName": "receipt.jpg",
|
243 |
-
"characterCount": 1247,
|
244 |
-
"processingMode": "structured",
|
245 |
-
"confidence": 0.98
|
246 |
-
},
|
247 |
-
"content": {
|
248 |
-
"title": "รายงานการขาย Q4 2024",
|
249 |
-
"tables": [
|
250 |
-
{
|
251 |
-
"headers": ["รายการ", "จำนวน", "ราคา"],
|
252 |
-
"rows": [
|
253 |
-
["กาแฟ อเมริกาโน่", "2 แก้ว", "120 บาท"],
|
254 |
-
["ขนมปังโฮลวีท", "1 ชิ้น", "45 บาท"]
|
255 |
-
]
|
256 |
-
}
|
257 |
-
]
|
258 |
-
}
|
259 |
-
}
|
260 |
-
```
|
261 |
|
262 |
---
|
263 |
|
264 |
-
##
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
|
269 |
-
|
270 |
-
|
|
271 |
-
|
|
272 |
-
| ✨ **Format Preservation** | Maintains original styling and layout | AI-powered structure detection |
|
273 |
-
| 🔧 **Error Correction** | Fixes OCR mistakes using AI context | Context-aware processing |
|
274 |
-
| 📈 **Data Categorization** | Auto-sorts and labels extracted data | Smart content organization |
|
275 |
-
| 🎯 **Smart Extraction** | Identifies key information automatically | Pattern recognition |
|
276 |
-
|
277 |
-
### 🚀 **Processing Pipeline**
|
278 |
-
|
279 |
-
```mermaid
|
280 |
-
graph LR
|
281 |
-
A[📤 Upload] --> B[🔍 Analysis]
|
282 |
-
B --> C[🤖 AI Processing]
|
283 |
-
C --> D[✨ Enhancement]
|
284 |
-
D --> E[📊 Formatting]
|
285 |
-
E --> F[📋 Output]
|
286 |
-
|
287 |
-
style A fill:#e1f5fe
|
288 |
-
style C fill:#f3e5f5
|
289 |
-
style F fill:#e8f5e8
|
290 |
-
```
|
291 |
|
292 |
---
|
293 |
|
294 |
-
##
|
295 |
|
296 |
-
### 🔌 **Endpoints
|
297 |
|
298 |
-
| Method | Endpoint | Purpose |
|
299 |
-
|
300 |
-
| `POST` | `/api/ocr` |
|
301 |
-
| `GET` | `/api/health` |
|
302 |
-
| `GET` | `/api/progress/:id` |
|
303 |
-
| `POST` | `/api/cleanup` |
|
|
|
|
|
304 |
|
305 |
-
### 📤 **OCR Processing Request**
|
306 |
```bash
|
307 |
curl -X POST http://localhost:3002/api/ocr \
|
308 |
-H "Content-Type: multipart/form-data" \
|
@@ -311,24 +295,22 @@ curl -X POST http://localhost:3002/api/ocr \
|
|
311 |
-F "mode=structured"
|
312 |
```
|
313 |
|
314 |
-
### 📥 **Response
|
|
|
315 |
```json
|
316 |
{
|
317 |
"success": true,
|
318 |
-
"sessionId": "1704067200000",
|
319 |
"data": {
|
320 |
"fileName": "document.pdf",
|
321 |
-
"processingMode": "structured",
|
322 |
"extractedText": "## Document Title\n\n...",
|
323 |
"formats": {
|
324 |
-
"txt": "Plain text
|
325 |
-
"md": "## Markdown
|
326 |
-
"json": {
|
327 |
},
|
328 |
"metadata": {
|
329 |
"characterCount": 1247,
|
330 |
-
"wordCount": 234
|
331 |
-
"confidence": 0.98
|
332 |
}
|
333 |
}
|
334 |
}
|
@@ -336,66 +318,6 @@ curl -X POST http://localhost:3002/api/ocr \
|
|
336 |
|
337 |
---
|
338 |
|
339 |
-
## 🏆 **What You Get**
|
340 |
-
|
341 |
-
<div align="center">
|
342 |
-
|
343 |
-
### 🎯 **Processing Capabilities**
|
344 |
-
|
345 |
-
</div>
|
346 |
-
|
347 |
-
<table>
|
348 |
-
<tr>
|
349 |
-
<td align="center" width="25%">
|
350 |
-
<h3>🇹�* Thai Text</h3>
|
351 |
-
<p><strong>Optimized Processing</strong></p>
|
352 |
-
<p>Perfect word spacing and context understanding</p>
|
353 |
-
</td>
|
354 |
-
<td align="center" width="25%">
|
355 |
-
<h3>📊 Tables</h3>
|
356 |
-
<p><strong>Structure Preserved</strong></p>
|
357 |
-
<p>Complex tables converted to markdown format</p>
|
358 |
-
</td>
|
359 |
-
<td align="center" width="25%">
|
360 |
-
<h3>� Englissh Text</h3>
|
361 |
-
<p><strong>High Accuracy</strong></p>
|
362 |
-
<p>Clean character recognition and formatting</p>
|
363 |
-
</td>
|
364 |
-
<td align="center" width="25%">
|
365 |
-
<h3>🎨 Formatting</h3>
|
366 |
-
<p><strong>Style Retention</strong></p>
|
367 |
-
<p>Original layout and styling preserved</p>
|
368 |
-
</td>
|
369 |
-
</tr>
|
370 |
-
</table>
|
371 |
-
|
372 |
-
### ⚡ **Performance Features**
|
373 |
-
|
374 |
-
<table>
|
375 |
-
<tr>
|
376 |
-
<td width="50%">
|
377 |
-
|
378 |
-
#### 🚀 **Speed & Efficiency**
|
379 |
-
- **Fast Processing**: Optimized for daily use
|
380 |
-
- **Real-time Updates**: Live progress tracking
|
381 |
-
- **Auto Cleanup**: Temporary files managed automatically
|
382 |
-
- **Memory Efficient**: Optimized resource usage
|
383 |
-
|
384 |
-
</td>
|
385 |
-
<td width="50%">
|
386 |
-
|
387 |
-
#### 🎯 **Quality & Accuracy**
|
388 |
-
- **AI Enhancement**: Gemini 2.5 models for best results
|
389 |
-
- **Context Aware**: Understands document types
|
390 |
-
- **Error Correction**: Fixes common OCR mistakes
|
391 |
-
- **Multi-language**: Thai and English support
|
392 |
-
|
393 |
-
</td>
|
394 |
-
</tr>
|
395 |
-
</table>
|
396 |
-
|
397 |
-
---
|
398 |
-
|
399 |
## 🛡️ **Security & Privacy**
|
400 |
|
401 |
### 🔐 **Security Features**
|
@@ -404,111 +326,57 @@ curl -X POST http://localhost:3002/api/ocr \
|
|
404 |
|---------|----------------|---------|
|
405 |
| 🔑 **API Key Encryption** | AES-256 + Device Salt | Secure local storage |
|
406 |
| 🗑️ **Auto Cleanup** | 15-minute intervals | No data persistence |
|
407 |
-
| 🚫 **
|
408 |
-
| 🔒 **HTTPS Only** | TLS
|
409 |
-
| 🛡️ **Input Validation** | Comprehensive sanitization | Prevent attacks |
|
410 |
-
|
411 |
-
### 🔐 **Encryption Details**
|
412 |
-
```javascript
|
413 |
-
// Multi-layer encryption with device fingerprinting
|
414 |
-
const encryptedKey = encrypt(apiKey, deviceSalt + additionalSalt);
|
415 |
-
localStorage.setItem('luna_secure_config_v2', encryptedKey);
|
416 |
-
```
|
417 |
|
418 |
---
|
419 |
|
420 |
-
## 🎮 **User Interface
|
421 |
|
422 |
-
###
|
|
|
|
|
|
|
|
|
423 |
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
- **Glassmorphism Design**: Modern blur effects
|
430 |
-
- **3D Orb Animation**: Interactive WebGL orb
|
431 |
-
- **Smooth Transitions**: Framer Motion animations
|
432 |
-
- **Responsive Layout**: Perfect on all devices
|
433 |
-
- **Dark Theme**: Eye-friendly interface
|
434 |
-
- **Progress Tracking**: Real-time visual feedback
|
435 |
-
|
436 |
-
</td>
|
437 |
-
<td width="50%">
|
438 |
-
|
439 |
-
#### ⚡ **Interaction Features**
|
440 |
-
- **Drag & Drop**: Intuitive file upload
|
441 |
-
- **Paste Support**: Direct image pasting
|
442 |
-
- **Live Preview**: See results as processed
|
443 |
-
- **Format Switching**: Toggle between outputs
|
444 |
-
- **Copy to Clipboard**: One-click copying
|
445 |
-
- **Download Options**: Multiple export formats
|
446 |
-
|
447 |
-
</td>
|
448 |
-
</tr>
|
449 |
-
</table>
|
450 |
-
|
451 |
-
### 📱 **Mobile Optimization**
|
452 |
-
- Touch-friendly interface
|
453 |
-
- Responsive design
|
454 |
-
- Optimized performance
|
455 |
-
- Gesture support
|
456 |
|
457 |
---
|
458 |
|
459 |
-
## 🤝 **Contributing
|
460 |
|
461 |
-
### 🌟 **
|
462 |
|
463 |
<table>
|
464 |
<tr>
|
465 |
<td width="50%">
|
466 |
|
467 |
-
#### 🐛 **
|
468 |
-
- Detailed
|
469 |
- Reproduction steps
|
470 |
-
- Environment
|
471 |
-
- Expected
|
472 |
-
|
473 |
-
#### 💡 **Feature Requests**
|
474 |
-
- Use case descriptions
|
475 |
-
- Implementation suggestions
|
476 |
-
- Priority justification
|
477 |
-
- Community voting
|
478 |
|
479 |
</td>
|
480 |
<td width="50%">
|
481 |
|
482 |
-
####
|
483 |
-
-
|
484 |
-
-
|
485 |
-
-
|
486 |
-
-
|
487 |
-
|
488 |
-
#### 📖 **Documentation**
|
489 |
-
- API documentation
|
490 |
-
- Tutorial creation
|
491 |
-
- Example projects
|
492 |
-
- Translation support
|
493 |
|
494 |
</td>
|
495 |
</tr>
|
496 |
</table>
|
497 |
|
498 |
-
### 🌟 **Project Highlights**
|
499 |
-
|
500 |
-
<div align="center">
|
501 |
-
|
502 |
-
[](https://huggingface.co/veela4/luna_ocr)
|
503 |
-
[](https://huggingface.co/veela4/luna_ocr)
|
504 |
-
[](https://huggingface.co/veela4/luna_ocr)
|
505 |
-
[](https://huggingface.co/veela4/luna_ocr)
|
506 |
-
|
507 |
-
</div>
|
508 |
-
|
509 |
---
|
510 |
|
511 |
-
## 📄 **License
|
512 |
|
513 |
<div align="center">
|
514 |
|
@@ -517,23 +385,14 @@ localStorage.setItem('luna_secure_config_v2', encryptedKey);
|
|
517 |
|
518 |
[](https://opensource.org/licenses/MIT)
|
519 |
|
520 |
-
*Use, modify, distribute, and sell without restrictions*
|
521 |
-
|
522 |
---
|
523 |
|
524 |
-
|
525 |
-
|
526 |
-
<td align="center">
|
527 |
-
<strong>🚀 Ready to transform your document workflow?</strong>
|
528 |
-
<br><br>
|
529 |
<a href="https://huggingface.co/veela4/luna_ocr">
|
530 |
<img src="https://img.shields.io/badge/🌙_Try_Luna_OCR-Now_Free-blue?style=for-the-badge&logo=rocket" />
|
531 |
</a>
|
532 |
-
</td>
|
533 |
-
</tr>
|
534 |
-
</table>
|
535 |
|
536 |
-
**Built with ❤️
|
537 |
-
*Making document processing intelligent, fast, and beautiful*
|
538 |
|
539 |
</div>
|
|
|
26 |
|
27 |
## ✨ **What Makes Luna OCR Special**
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
<table>
|
30 |
<tr>
|
31 |
<td align="center" width="25%">
|
32 |
+
|
33 |
+
### 🤖 **AI-Powered**
|
34 |
+
**Google Gemini 2.5**
|
35 |
+
Flash & Pro models for optimal speed and accuracy
|
36 |
+
|
37 |
</td>
|
38 |
<td align="center" width="25%">
|
39 |
+
|
40 |
+
### 🇹🇭 **Thai Optimized**
|
41 |
+
**Perfect Word Spacing**
|
42 |
+
Specialized prompts for Thai text processing
|
43 |
+
|
44 |
</td>
|
45 |
<td align="center" width="25%">
|
46 |
+
|
47 |
+
### 📊 **Smart Tables**
|
48 |
+
**Structure Preserved**
|
49 |
+
Complex tables converted to markdown format
|
50 |
+
|
51 |
</td>
|
52 |
<td align="center" width="25%">
|
53 |
+
|
54 |
+
### 🔐 **Secure Storage**
|
55 |
+
**AES-256 Encryption**
|
56 |
+
API keys encrypted with device salt
|
57 |
+
|
58 |
+
</td>
|
59 |
+
</tr>
|
60 |
+
</table>
|
61 |
+
|
62 |
+
---
|
63 |
+
|
64 |
+
## 🎯 **Live Processing Demo**
|
65 |
+
|
66 |
+
<div align="center">
|
67 |
+
|
68 |
+
### � **Reaul-time Progress Tracking**
|
69 |
+

|
70 |
+
*Live processing with detailed logs, character counts, and progress tracking*
|
71 |
+
|
72 |
+
</div>
|
73 |
+
|
74 |
+
---
|
75 |
+
|
76 |
+
## 📝 **Output Format Examples**
|
77 |
+
|
78 |
+
<table>
|
79 |
+
<tr>
|
80 |
+
<td width="50%">
|
81 |
+
|
82 |
+
### 📄 **Raw Text Output**
|
83 |
+

|
84 |
+
*Clean, readable plain text extraction*
|
85 |
+
|
86 |
+
</td>
|
87 |
+
<td width="50%">
|
88 |
+
|
89 |
+
### � **Marhkdown Format**
|
90 |
+

|
91 |
+
*Structured markdown with tables and formatting*
|
92 |
+
|
93 |
</td>
|
94 |
</tr>
|
95 |
</table>
|
96 |
|
97 |
---
|
98 |
|
99 |
+
## 🌐 **Document Viewer & Export**
|
100 |
|
101 |
<table>
|
102 |
<tr>
|
103 |
<td width="50%">
|
104 |
|
105 |
+
### 📋 **PDF Preview**
|
106 |
+

|
107 |
+
*Interactive PDF viewer with page navigation*
|
|
|
|
|
108 |
|
109 |
</td>
|
110 |
<td width="50%">
|
111 |
|
112 |
+
### 🎨 **HTML Export**
|
113 |
+

|
114 |
+
*Beautiful glassmorphism-styled HTML output*
|
|
|
|
|
115 |
|
116 |
</td>
|
117 |
</tr>
|
|
|
119 |
|
120 |
---
|
121 |
|
122 |
+
## �️ S**Technology Stack**
|
123 |
|
124 |
<table>
|
125 |
<tr>
|
126 |
<td align="center" width="25%">
|
127 |
+
|
128 |
+

|
129 |
+
**Frontend Engine**
|
130 |
+
Lightning-fast UI
|
131 |
+
|
132 |
</td>
|
133 |
<td align="center" width="25%">
|
134 |
+
|
135 |
+

|
136 |
+
**AI Brain**
|
137 |
+
Flash & Pro models
|
138 |
+
|
139 |
</td>
|
140 |
<td align="center" width="25%">
|
141 |
+
|
142 |
+

|
143 |
+
**Backend Power**
|
144 |
+
Express + Sharp
|
145 |
+
|
146 |
</td>
|
147 |
<td align="center" width="25%">
|
148 |
+
|
149 |
+

|
150 |
+
**3D Graphics**
|
151 |
+
Stunning visuals
|
152 |
+
|
153 |
</td>
|
154 |
</tr>
|
155 |
</table>
|
156 |
|
157 |
+
### 🎨 **UI/UX Components**
|
158 |
+
|
159 |
| Component | Technology | Purpose |
|
160 |
|-----------|------------|---------|
|
161 |
| 🎭 **Design System** | Glassmorphism + Radix UI | Modern, accessible interface |
|
162 |
| ⚡ **Animations** | Framer Motion + GSAP | Smooth, professional transitions |
|
163 |
| 📱 **Responsiveness** | CSS Grid + Flexbox | Perfect on all devices |
|
164 |
+
| � **SecuFrity** | AES-256 + Salt encryption | Secure API key storage |
|
165 |
|
166 |
---
|
167 |
|
168 |
+
## 📦 **Quick Start**
|
|
|
|
|
169 |
|
170 |
```bash
|
171 |
+
# Clone the repository
|
172 |
git clone https://huggingface.co/veela4/luna_ocr
|
173 |
cd luna_ocr
|
174 |
|
175 |
+
# Install dependencies
|
176 |
npm install && cd server && npm install && cd ..
|
177 |
|
178 |
+
# Launch the application
|
179 |
npm start
|
180 |
```
|
181 |
|
182 |
+
> 🔐 **No .env file needed!** API keys are stored securely in encrypted local storage.
|
183 |
|
184 |
### 🌐 **Access Points**
|
185 |
+
|
186 |
| Service | URL | Purpose |
|
187 |
|---------|-----|---------|
|
188 |
+
| 🖥️ **Frontend** | `http://localhost:3000` | Main application |
|
189 |
+
| 🔧 **Backend** | `http://localhost:3002` | REST API |
|
190 |
+
| 📊 **Health Check** | `http://localhost:3002/api/health` | System status |
|
191 |
|
192 |
---
|
193 |
|
194 |
+
## 📄 **Supported File Types**
|
195 |
|
196 |
<table>
|
197 |
<tr>
|
198 |
<td width="33%">
|
199 |
|
200 |
+
### 🖼️ **Images**
|
201 |
+
- PNG, JPEG, WebP
|
202 |
+
- High-resolution support
|
203 |
+
- Auto-enhancement
|
204 |
+
- Drag & drop upload
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
205 |
|
206 |
</td>
|
207 |
<td width="33%">
|
208 |
|
209 |
+
### 📋 **PDF Files**
|
210 |
+
- Multi-page processing
|
211 |
+
- Page-by-page extraction
|
212 |
+
- Progress tracking
|
213 |
+
- Interactive viewer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
214 |
|
215 |
</td>
|
216 |
<td width="33%">
|
217 |
|
218 |
+
### 🌐 **HTML Documents**
|
219 |
+
- Styled content
|
220 |
+
- Table preservation
|
221 |
+
- Interactive viewer
|
222 |
+
- Glassmorphism theme
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
223 |
|
224 |
</td>
|
225 |
</tr>
|
|
|
227 |
|
228 |
---
|
229 |
|
230 |
+
## 🇹🇭 **Language Support**
|
231 |
+
|
232 |
+
<table>
|
233 |
+
<tr>
|
234 |
+
<td width="50%">
|
235 |
|
236 |
+
### 🇹🇭 **Thai Language**
|
237 |
+
- **Optimized word spacing**
|
238 |
+
- **Context-aware processing**
|
239 |
+
- **Cultural text understanding**
|
240 |
+
- **Mixed language support**
|
241 |
|
242 |
+
</td>
|
243 |
+
<td width="50%">
|
|
|
|
|
|
|
|
|
244 |
|
245 |
+
### 🇺🇸 **English & Others**
|
246 |
+
- **High accuracy recognition**
|
247 |
+
- **Technical terminology**
|
248 |
+
- **Auto-language detection**
|
249 |
+
- **Preserve original formatting**
|
250 |
|
251 |
+
</td>
|
252 |
+
</tr>
|
253 |
+
</table>
|
254 |
|
255 |
+
---
|
|
|
|
|
|
|
256 |
|
257 |
+
## 🎨 **Processing Modes**
|
|
|
258 |
|
259 |
+
| Mode | Model | Speed | Best For |
|
260 |
+
|------|-------|-------|----------|
|
261 |
+
| ⚡ **Standard** | Gemini 2.5 Flash | Fast | Quick processing |
|
262 |
+
| 🧠 **Structured** | Gemini 2.5 Pro | Slower | Maximum accuracy |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
263 |
|
264 |
---
|
265 |
|
266 |
+
## 📊 **Output Formats**
|
267 |
+
|
268 |
+
| Format | Best For | Features |
|
269 |
+
|--------|----------|----------|
|
270 |
+
| 📝 **Markdown** | Documentation | Tables, headers, GitHub-compatible |
|
271 |
+
| 📊 **JSON** | Data processing | Structured, queryable, metadata |
|
272 |
+
| 🌐 **HTML** | Web publishing | Styled, glassmorphism theme |
|
273 |
+
| � **Plain Text** | Quick reading | Clean, readable format |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
274 |
|
275 |
---
|
276 |
|
277 |
+
## � ***API Reference**
|
278 |
|
279 |
+
### 🔌 **Main Endpoints**
|
280 |
|
281 |
+
| Method | Endpoint | Purpose |
|
282 |
+
|--------|----------|---------|
|
283 |
+
| `POST` | `/api/ocr` | Process documents |
|
284 |
+
| `GET` | `/api/health` | System status |
|
285 |
+
| `GET` | `/api/progress/:id` | Processing status |
|
286 |
+
| `POST` | `/api/cleanup` | Clear temp files |
|
287 |
+
|
288 |
+
### 📤 **Example Request**
|
289 |
|
|
|
290 |
```bash
|
291 |
curl -X POST http://localhost:3002/api/ocr \
|
292 |
-H "Content-Type: multipart/form-data" \
|
|
|
295 |
-F "mode=structured"
|
296 |
```
|
297 |
|
298 |
+
### 📥 **Example Response**
|
299 |
+
|
300 |
```json
|
301 |
{
|
302 |
"success": true,
|
|
|
303 |
"data": {
|
304 |
"fileName": "document.pdf",
|
|
|
305 |
"extractedText": "## Document Title\n\n...",
|
306 |
"formats": {
|
307 |
+
"txt": "Plain text...",
|
308 |
+
"md": "## Markdown...",
|
309 |
+
"json": { "structured": "data" }
|
310 |
},
|
311 |
"metadata": {
|
312 |
"characterCount": 1247,
|
313 |
+
"wordCount": 234
|
|
|
314 |
}
|
315 |
}
|
316 |
}
|
|
|
318 |
|
319 |
---
|
320 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
321 |
## 🛡️ **Security & Privacy**
|
322 |
|
323 |
### 🔐 **Security Features**
|
|
|
326 |
|---------|----------------|---------|
|
327 |
| 🔑 **API Key Encryption** | AES-256 + Device Salt | Secure local storage |
|
328 |
| 🗑️ **Auto Cleanup** | 15-minute intervals | No data persistence |
|
329 |
+
| 🚫 **Local Processing** | No cloud storage | Complete privacy |
|
330 |
+
| 🔒 **HTTPS Only** | TLS encryption | Secure transmission |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
331 |
|
332 |
---
|
333 |
|
334 |
+
## 🎮 **User Interface**
|
335 |
|
336 |
+
### 🌟 **Visual Features**
|
337 |
+
- **Glassmorphism Design** - Modern blur effects
|
338 |
+
- **3D Orb Animation** - Interactive WebGL orb
|
339 |
+
- **Smooth Transitions** - Framer Motion animations
|
340 |
+
- **Dark Theme** - Eye-friendly interface
|
341 |
|
342 |
+
### ⚡ **Interaction Features**
|
343 |
+
- **Drag & Drop** - Intuitive file upload
|
344 |
+
- **Paste Support** - Direct image pasting
|
345 |
+
- **Live Preview** - Real-time results
|
346 |
+
- **Format Switching** - Toggle between outputs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
347 |
|
348 |
---
|
349 |
|
350 |
+
## 🤝 **Contributing**
|
351 |
|
352 |
+
### 🌟 **How to Help**
|
353 |
|
354 |
<table>
|
355 |
<tr>
|
356 |
<td width="50%">
|
357 |
|
358 |
+
#### 🐛 **Report Issues**
|
359 |
+
- Detailed descriptions
|
360 |
- Reproduction steps
|
361 |
+
- Environment info
|
362 |
+
- Expected behavior
|
|
|
|
|
|
|
|
|
|
|
|
|
363 |
|
364 |
</td>
|
365 |
<td width="50%">
|
366 |
|
367 |
+
#### 💡 **Suggest Features**
|
368 |
+
- Use case descriptions
|
369 |
+
- Implementation ideas
|
370 |
+
- Priority justification
|
371 |
+
- Community feedback
|
|
|
|
|
|
|
|
|
|
|
|
|
372 |
|
373 |
</td>
|
374 |
</tr>
|
375 |
</table>
|
376 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
377 |
---
|
378 |
|
379 |
+
## 📄 **License**
|
380 |
|
381 |
<div align="center">
|
382 |
|
|
|
385 |
|
386 |
[](https://opensource.org/licenses/MIT)
|
387 |
|
|
|
|
|
388 |
---
|
389 |
|
390 |
+
### 🚀 **Ready to Get Started?**
|
391 |
+
|
|
|
|
|
|
|
392 |
<a href="https://huggingface.co/veela4/luna_ocr">
|
393 |
<img src="https://img.shields.io/badge/🌙_Try_Luna_OCR-Now_Free-blue?style=for-the-badge&logo=rocket" />
|
394 |
</a>
|
|
|
|
|
|
|
395 |
|
396 |
+
**Built with ❤️ for developers who demand accuracy**
|
|
|
397 |
|
398 |
</div>
|