-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharchitecture.html
More file actions
234 lines (225 loc) Β· 14.4 KB
/
Copy patharchitecture.html
File metadata and controls
234 lines (225 loc) Β· 14.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Architecture | Doctane - System Design</title>
<meta name="description" content="Doctane system architecture. Learn about the OCR pipeline, detection models, recognition models, and data flow.">
<meta name="keywords" content="OCR architecture, system design, text detection, text recognition, pipeline">
<meta name="author" content="Purushothaman Natarajan">
<meta name="robots" content="index, follow">
<link rel="canonical" href="https://purushothaman-natarajan.github.io/doctane/architecture.html">
<meta property="og:type" content="website">
<meta property="og:url" content="https://purushothaman-natarajan.github.io/doctane/architecture.html">
<meta property="og:title" content="Architecture | Doctane - System Design">
<meta property="og:description" content="Doctane system architecture. Learn about the OCR pipeline, detection models, and recognition models.">
<meta property="og:image" content="https://purushothaman-natarajan.github.io/doctane/og-image.svg">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Architecture | Doctane - System Design">
<meta name="twitter:description" content="Doctane system architecture. Learn about the OCR pipeline, detection models, and recognition models.">
<meta name="twitter:image" content="https://purushothaman-natarajan.github.io/doctane/og-image.svg">
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>π¬</text></svg>">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
<style>
:root { --bg-body: #ffffff; --bg-surface: #f0f4f8; --text-primary: #1a1a2e; --text-secondary: #4a5568; --text-tertiary: #718096; --accent-blue: #1a73e8; --accent-blue-hover: #1557b0; --accent-green: #34a853; --accent-orange: #fbbc04; --accent-purple: #8b5cf6; --border-light: #e2e8f0; --shadow-md: 0 8px 24px rgba(26, 115, 232, 0.12); --shadow-lg: 0 20px 40px rgba(26, 115, 232, 0.16); }
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Outfit', -apple-system, sans-serif; background: var(--bg-body); color: var(--text-primary); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 2rem; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.animate { animation: fadeInUp 0.5s ease-out both; }
header { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: rgba(255,255,255,0.92); backdrop-filter: blur(24px); border-bottom: 1px solid var(--border-light); transition: all 0.3s; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo { display: flex; align-items: center; gap: 0.625rem; font-size: 1.375rem; font-weight: 600; letter-spacing: -0.01em; }
.logo-icon { width: 36px; height: 36px; background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple)); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: white; font-size: 1.125rem; box-shadow: 0 4px 12px rgba(26, 115, 232, 0.25); }
nav { display: flex; align-items: center; gap: 0.5rem; }
.nav-links { display: flex; gap: 0.25rem; list-style: none; }
.nav-links a { padding: 0.5rem 1rem; font-size: 0.875rem; color: var(--text-secondary); border-radius: 100px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); font-weight: 500; }
.nav-links a:hover { background: var(--bg-surface); color: var(--accent-purple); }
.btn { display: inline-flex; align-items: center; padding: 0.5rem 1rem; border-radius: 100px; font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); border: none; }
.btn-primary { background: var(--accent-blue); color: white; }
.btn-primary:hover { background: var(--accent-blue-hover); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-secondary { background: transparent; color: var(--accent-blue); }
.mobile-menu-btn { display: none; background: none; border: none; padding: 0.5rem; cursor: pointer; color: var(--text-primary); }
.mobile-menu { display: none; position: fixed; top: 68px; left: 0; right: 0; bottom: 0; background: var(--bg-body); padding: 1rem; z-index: 99; overflow-y: auto; }
.mobile-menu.active { display: block; }
.mobile-menu a { display: block; padding: 1rem; font-size: 1.125rem; font-weight: 500; color: var(--text-secondary); border-bottom: 1px solid var(--border-light); }
@media (max-width: 900px) { .nav-links { display: none; } .mobile-menu-btn { display: block; } }
</style>
</head>
<body>
<header>
<div class="container">
<div class="header-inner">
<a href="index.html" class="logo"><div class="logo-icon">π¬</div><span>Doctane</span></a>
<nav>
<ul class="nav-links">
<li><a href="index.html#features">Features</a></li>
<li><a href="index.html#pipeline">Pipeline</a></li>
<li><a href="index.html#models">Models</a></li>
<li><a href="index.html#quickstart">Get Started</a></li>
<li><a href="index.html#profile">Profile</a></li>
<li><a href="https://github.com/Purushothaman-natarajan/doctane">GitHub</a></li>
<li><a href="docs.html">Docs</a></li>
</ul>
<button class="mobile-menu-btn" aria-label="Menu">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 12h18M3 6h18M3 18h18"></path></svg>
</button>
</nav>
</div>
</div>
</header>
<div class="mobile-menu">
<a href="index.html#features">Features</a>
<a href="index.html#pipeline">Pipeline</a>
<a href="index.html#models">Models</a>
<a href="index.html#quickstart">Get Started</a>
<a href="index.html#profile">Profile</a>
<a href="https://github.com/Purushothaman-natarajan/doctane">GitHub</a>
<a href="docs.html">Docs</a>
</div>
<main class="main">
<div class="container">
<div class="section-header">
<h1>System Architecture</h1>
<p>Understanding Doctane's modular pipeline design</p>
</div>
<div class="architecture-diagram">
<h3 style="margin-bottom: 1.5rem; text-align: center;">Processing Pipeline</h3>
<div class="pipeline-flow">
<div class="pipeline-box animate" style="animation-delay: 0.1s;">
<h4>π Input</h4>
<p>Images & PDFs</p>
</div>
<span class="arrow">β</span>
<div class="pipeline-box animate" style="animation-delay: 0.2s;">
<h4>π Preprocess</h4>
<p>Orientation & Straighten</p>
</div>
<span class="arrow">β</span>
<div class="pipeline-box animate" style="animation-delay: 0.3s;">
<h4>π― Detect</h4>
<p>Text Boxes</p>
</div>
<span class="arrow">β</span>
<div class="pipeline-box animate" style="animation-delay: 0.4s;">
<h4>π Recognize</h4>
<p>Text Transcription</p>
</div>
<span class="arrow">β</span>
<div class="pipeline-box animate" style="animation-delay: 0.5s;">
<h4>π¦ Output</h4>
<p>Document Object</p>
</div>
</div>
</div>
<div class="component-grid">
<div class="component-card animate" style="animation-delay: 0.1s;">
<h3>πΌοΈ Preprocessor</h3>
<p>Handles image preprocessing including orientation detection and page straightening.</p>
<ul>
<li>Orientation Detection <span>β</span></li>
<li>Auto-deskew <span>β</span></li>
<li>Image Enhancement <span>β</span></li>
</ul>
</div>
<div class="component-card animate" style="animation-delay: 0.2s;">
<h3>π― Detection Module</h3>
<p>Segmentation-based text detection with support for straight and rotated text.</p>
<ul>
<li>LinkNet <span>β</span></li>
<li>DeepLabV3+ <span>β</span></li>
<li>SegFormer <span>β</span></li>
</ul>
</div>
<div class="component-card animate" style="animation-delay: 0.3s;">
<h3>π Recognition Module</h3>
<p>Sequence-to-sequence text recognition with attention mechanisms.</p>
<ul>
<li>SAR <span>β</span></li>
<li>ViTSTR <span>β</span></li>
<li>CRNN <span>β</span></li>
</ul>
</div>
<div class="component-card animate" style="animation-delay: 0.4s;">
<h3>π§ Builder Module</h3>
<p>Constructs hierarchical Document objects with structure preservation.</p>
<ul>
<li>Page <span>β</span></li>
<li>Block <span>β</span></li>
<li>Line/Word <span>β</span></li>
</ul>
</div>
<div class="component-card animate" style="animation-delay: 0.5s;">
<h3>β‘ Training Module</h3>
<p>Distributed training support with DDP for multi-GPU setups.</p>
<ul>
<li>DDP Support <span>β</span></li>
<li>Checkpointing <span>β</span></li>
<li>Logging <span>β</span></li>
</ul>
</div>
<div class="component-card animate" style="animation-delay: 0.6s;">
<h3>π Export Module</h3>
<p>Multiple output formats for downstream processing.</p>
<ul>
<li>JSON <span>β</span></li>
<li>hOCR <span>β</span></li>
<li>PDF <span>β</span></li>
</ul>
</div>
</div>
<div class="data-flow">
<h3>Data Flow Architecture</h3>
<div class="flow-step animate" style="animation-delay: 0.1s;">
<div class="flow-step-num">1</div>
<div class="flow-step-content"><h4>Image Input</h4><p>Raw images (PNG, JPG, PDF) are loaded and converted to numpy arrays</p></div>
</div>
<div class="flow-step animate" style="animation-delay: 0.2s;">
<div class="flow-step-num">2</div>
<div class="flow-step-content"><h4>Preprocessing</h4><p>OrientationPredictor detects page tilt, OrientationCorrector straightens if needed</p></div>
</div>
<div class="flow-step animate" style="animation-delay: 0.3s;">
<div class="flow-step-num">3</div>
<div class="flow-step-content"><h4>Text Detection</h4><p>DetectionPredictor runs segmentation model to produce binary mask of text regions</p></div>
</div>
<div class="flow-step animate" style="animation-delay: 0.4s;">
<div class="flow-step-num">4</div>
<div class="flow-step-content"><h4>Crop Extraction</h4><p>Geometry module extracts ROIs based on detection mask contours</p></div>
</div>
<div class="flow-step animate" style="animation-delay: 0.5s;">
<div class="flow-step-num">5</div>
<div class="flow-step-content"><h4>Text Recognition</h4><p>RecognitionPredictor transcribes each crop to text using trained model</p></div>
</div>
<div class="flow-step animate" style="animation-delay: 0.6s;">
<div class="flow-step-num">6</div>
<div class="flow-step-content"><h4>Document Assembly</h4><p>DocumentBuilder assembles Page β Block β Line β Word hierarchy with confidence</p></div>
</div>
</div>
</div>
</main>
<footer>
<div class="container">
<div class="footer-content">
<div class="footer-links">
<a href="index.html">Home</a><a href="docs.html">Docs</a><a href="architecture.html">Architecture</a><a href="developer-guide.html">Developer Guide</a><a href="privacy.html">Privacy</a><a href="terms.html">Terms</a><a href="https://github.com/Purushothaman-natarajan/doctane">GitHub</a>
</div>
<p class="footer-copy">Doctane - OCR Development Environment</p>
</div>
</div>
</footer>
<script>
document.querySelector('.mobile-menu-btn').addEventListener('click', function() {
document.querySelector('.mobile-menu').classList.toggle('active');
});
document.querySelectorAll('.mobile-menu a').forEach(function(link) {
link.addEventListener('click', function() {
document.querySelector('.mobile-menu').classList.remove('active');
});
});
</script>
</body>
</html>