-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocs.html
More file actions
277 lines (249 loc) · 16.1 KB
/
Copy pathdocs.html
File metadata and controls
277 lines (249 loc) · 16.1 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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Docs | Doctane - Complete OCR Documentation</title>
<meta name="description" content="Complete documentation for Doctane OCR framework. Installation, API reference, configuration, training guides, and examples.">
<meta name="keywords" content="OCR, documentation, API reference, text detection, text recognition, PyTorch, deep learning">
<meta name="author" content="Purushothaman Natarajan">
<meta name="robots" content="index, follow">
<link rel="canonical" href="https://purushothaman-natarajan.github.io/doctane/docs.html">
<meta name="theme-color" content="#1a73e8">
<!-- Open Graph -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://purushothaman-natarajan.github.io/doctane/docs.html">
<meta property="og:title" content="Docs | Doctane - Complete OCR Documentation">
<meta property="og:description" content="Complete documentation for Doctane OCR framework. Installation, API reference, and configuration guides.">
<meta property="og:image" content="https://purushothaman-natarajan.github.io/doctane/og-image.svg">
<meta property="og:site_name" content="Doctane">
<!-- Twitter -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Docs | Doctane - Complete OCR Documentation">
<meta name="twitter:description" content="Complete documentation for Doctane OCR framework. Installation, API reference, and configuration guides.">
<meta name="twitter:image" content="https://purushothaman-natarajan.github.io/doctane/og-image.svg">
<!-- Favicon -->
<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; --bg-elevated: #ffffff;
--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-sm: 0 2px 8px rgba(26, 115, 232, 0.08);
--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; } }
.main { padding: 6rem 0 4rem; }
.docs-grid { display: grid; grid-template-columns: 280px 1fr; gap: 3rem; }
@media (max-width: 768px) { .docs-grid { grid-template-columns: 1fr; } }
.sidebar { position: sticky; top: 100px; height: fit-content; background: var(--bg-surface); border-radius: 16px; padding: 1.5rem; }
.sidebar h3 { font-size: 0.75rem; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1rem; }
.sidebar ul { list-style: none; }
.sidebar li { margin-bottom: 0.5rem; }
.sidebar a { font-size: 0.9rem; color: var(--text-secondary); transition: color 0.2s; }
.sidebar a:hover, .sidebar a.active { color: var(--accent-blue); }
.content h1 { font-size: 2.5rem; font-weight: 400; margin-bottom: 1rem; animation: fadeInUp 0.5s; }
.content h2 { font-size: 1.5rem; font-weight: 500; margin: 2rem 0 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border-light); animation: fadeInUp 0.5s 0.1s both; }
.content h3 { font-size: 1.125rem; font-weight: 500; margin: 1.5rem 0 0.75rem; }
.content p { color: var(--text-secondary); margin-bottom: 1rem; }
.content ul, .content ol { margin: 1rem 0 1rem 1.5rem; color: var(--text-secondary); }
.content li { margin-bottom: 0.5rem; }
.code-block { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); border-radius: 12px; padding: 1.25rem; font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; overflow-x: auto; margin: 1rem 0; border: 1px solid rgba(139, 92, 246, 0.15); }
.code-block .comment { color: #6a9955; }
.code-block .keyword { color: #569cd6; }
.api-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.api-table th, .api-table td { padding: 0.75rem; text-align: left; border: 1px solid var(--border-light); }
.api-table th { background: var(--bg-surface); font-weight: 500; }
.api-table td { color: var(--text-secondary); font-family: monospace; font-size: 0.85rem; }
.note { padding: 1rem 1.25rem; border-radius: 12px; margin: 1rem 0; }
.note-warning { background: #fef7e0; border: 1px solid var(--accent-orange); }
.note h4 { font-size: 0.95rem; font-weight: 500; margin-bottom: 0.5rem; }
.note-warning h4 { color: #b06000; }
footer { background: var(--bg-surface); border-top: 1px solid var(--border-light); padding: 2rem 0; margin-top: 4rem; }
.footer-content { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-links a { font-size: 0.875rem; color: var(--text-secondary); }
.footer-links a:hover { color: var(--text-primary); }
.footer-copy { font-size: 0.875rem; color: var(--text-tertiary); }
</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="docs-grid">
<aside class="sidebar">
<h3>Getting Started</h3>
<ul>
<li><a href="#installation">Installation</a></li>
<li><a href="#quickstart">Quick Start</a></li>
<li><a href="#configuration">Configuration</a></li>
</ul>
<h3>API Reference</h3>
<ul>
<li><a href="#ocr-predictor">OCRPredictor</a></li>
<li><a href="#detection">Detection Models</a></li>
<li><a href="#recognition">Recognition Models</a></li>
<li><a href="#datasets">Datasets</a></li>
</ul>
<h3>Guides</h3>
<ul>
<li><a href="#training">Training</a></li>
<li><a href="#inference">Inference</a></li>
<li><a href="#custom-models">Custom Models</a></li>
</ul>
</aside>
<div class="content">
<h1>Documentation</h1>
<p>Comprehensive guide to Doctane's features, API, and usage.</p>
<h2 id="installation">Installation</h2>
<div class="code-block">
<span class="comment"># From source</span>
<span class="keyword">git</span> clone https://github.com/Purushothaman-natarajan/doctane.git
<span class="keyword">cd</span> doctane
<span class="keyword">pip</span> install -e .
</div>
<h2 id="quickstart">Quick Start</h2>
<div class="code-block">
<span class="keyword">import</span> numpy <span class="keyword">as</span> np
<span class="keyword">from</span> PIL <span class="keyword">import</span> Image
<span class="keyword">from</span> doctane.ocr_pipeline.ocr_predictor <span class="keyword">import</span> OCRPredictor
image = Image.open(<span class="string">"document.jpg"</span>).convert(<span class="string">"RGB"</span>)
np_image = np.array(image)
predictor = OCRPredictor()
output = predictor([np_image])
<span class="keyword">for</span> page <span class="keyword">in</span> output.pages:
<span class="keyword">print</span>(page)
</div>
<div class="note note-warning">
<h4>⚠️ Important</h4>
<p>This is an open-source development framework. You need to provide your own trained model weights. We do not host or provide pre-trained weights.</p>
</div>
<h2 id="configuration">Configuration</h2>
<div class="code-block">
detection:
model: seg_linknet_resnet50
input_size: [512, 512]
batch_size: 8
recognition:
model: sar_resnet34
vocab_size: 95
batch_size: 32
training:
epochs: 100
lr: 0.001
</div>
<h2 id="ocr-predictor">OCRPredictor</h2>
<p>Main class for end-to-end OCR processing.</p>
<table class="api-table">
<tr><th>Method</th><th>Description</th></tr>
<tr><td>__init__(det_predictor, reco_predictor)</td><td>Initialize with detection and recognition models</td></tr>
<tr><td>(images: List[np.ndarray]) -> Document</td><td>Process list of images and return Document</td></tr>
</table>
<h2 id="detection">Detection Models</h2>
<ul>
<li><strong>LinkNet</strong> - Fast and lightweight</li>
<li><strong>DeepLabV3+</strong> - High accuracy for complex layouts</li>
<li><strong>SegFormer</strong> - State-of-the-art transformer-based</li>
</ul>
<h2 id="recognition">Recognition Models</h2>
<ul>
<li><strong>SAR</strong> - Sequence Approximation Recognition</li>
<li><strong>ViTSTR</strong> - Vision Transformer for STR</li>
<li><strong>CRNN</strong> - CNN + RNN + CTC</li>
<li><strong>MASTER</strong> - Multi-Aspect Self-Attention</li>
</ul>
<h2 id="training">Training</h2>
<div class="code-block">
<span class="keyword">python</span> train/text_detection/train_detection.py \
--config configs/detection.yaml \
--epochs 100
</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>