Azzindani commited on
Commit
5aa7ee3
Β·
verified Β·
1 Parent(s): a16f280

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +161 -0
README.md ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ ---
4
+ ---
5
+
6
+ # πŸ“„ Invoice Image Dataset (N8N-Friendly Streaming Format)
7
+
8
+ This repository contains a large-scale collection of invoice images stored in a **simple, sequential, machine-friendly structure** designed specifically for workflow automation tools such as **n8n**, Airflow, Make.com, and other ETL/automation systems.
9
+
10
+ The dataset is formatted to allow **easy, reliable, and high-performance pulling of individual invoice files one-by-one**, without needing to download the entire dataset.
11
+
12
+ ---
13
+
14
+ ## πŸ“ Directory Structure
15
+
16
+ All invoice images are stored inside a single directory:
17
+
18
+ ```
19
+ images/
20
+ β”‚
21
+ β”œβ”€β”€ invoice_00000001.png
22
+ β”œβ”€β”€ invoice_00000002.png
23
+ β”œβ”€β”€ invoice_00000003.png
24
+ β”œβ”€β”€ invoice_00000004.png
25
+ └── ...
26
+ ```
27
+
28
+ ### βœ… Naming Format
29
+
30
+ Each invoice follows a **fixed-length 8-digit numbering scheme**:
31
+
32
+ ```
33
+ invoice_00000000.format
34
+ ```
35
+
36
+ * Zero-padded (`06d` or more) numbering supports **millions of invoices** without renaming.
37
+ * `format` can be `.png`, `.jpg`, `.jpeg`, `.webp`, depending on original source.
38
+ * Each file is **independent** and can be downloaded individually.
39
+
40
+ ---
41
+
42
+ ## 🎯 Purpose of This Dataset
43
+
44
+ This dataset acts as a **normalized, unified output repository** for invoice images collected and standardized from multiple sources:
45
+
46
+ * Other Hugging Face datasets
47
+ * GitHub repositories
48
+ * Parquet datasets containing embedded images
49
+ * Third-party OCR datasets
50
+ * Custom pipelines
51
+
52
+ Each invoice is extracted, normalized, renamed, and uploaded in a consistent structure.
53
+
54
+ ---
55
+
56
+ ## πŸ”Œ Why This Format Is Perfect for n8n Workflows
57
+
58
+ Most automation tools (including **n8n**) struggle with:
59
+
60
+ * datasets stored in large compressed files (ZIPs, JSONL, Parquet)
61
+ * datasets where images must be decoded from arrays/blobs
62
+ * datasets requiring full-dataset downloads
63
+
64
+ This repo is intentionally built to support **file-by-file streaming**, so n8n can:
65
+
66
+ ### βœ” Pull one file at a time
67
+
68
+ Example URL:
69
+
70
+ ```
71
+ https://huggingface.co/datasets/<USER>/<REPO>/resolve/main/images/invoice_00000042.png
72
+ ```
73
+
74
+ ### βœ” Process invoices sequentially
75
+
76
+ You can loop:
77
+
78
+ 1 β†’ 2 β†’ 3 β†’ 4 β†’ ...
79
+
80
+ As long as the file exists, n8n continues; when it fails (404), it stops β€” perfect for paginated workflows.
81
+
82
+ ### βœ” Avoid handling large downloads
83
+
84
+ Each invoice is an independent file.
85
+
86
+ ### βœ” Use lightweight logic
87
+
88
+ You only need a simple incrementing counter in n8n.
89
+
90
+ ---
91
+
92
+ ## 🧩 Example n8n Workflow Logic
93
+
94
+ 1. Start with variable:
95
+
96
+ ```
97
+ index = 1
98
+ ```
99
+
100
+ 2. Construct file URL:
101
+
102
+ ```
103
+ url = https://huggingface.co/datasets/<USER>/<REPO>/resolve/main/images/invoice_<index padded>.png
104
+ ```
105
+
106
+ 3. HTTP GET β†’ process invoice
107
+
108
+ 4. Increment index
109
+
110
+ 5. Repeat until HTTP GET returns 404
111
+
112
+ 6. Stop workflow automatically
113
+
114
+ This allows n8n to **stream** invoices from Hugging Face like a controlled queue.
115
+
116
+ ---
117
+
118
+ ## πŸ“¦ What This Dataset Contains
119
+
120
+ * Only raw invoice images
121
+ * No labels
122
+ * No associated OCR text
123
+ * No metadata
124
+
125
+ This repository is intended specifically as an **output target** for standardized invoices β€” not as an annotated machine learning dataset.
126
+
127
+ ---
128
+
129
+ ## βš™οΈ How It Was Generated
130
+
131
+ A controlled pipeline:
132
+
133
+ 1. Loads invoices from multiple formats (HF dataset, Parquet, GitHub, OCR outputs, etc.)
134
+ 2. Extracts image data
135
+ 3. Converts and normalizes to `.png` or `.jpg`
136
+ 4. Saves to `images/invoice_XXXXXXXX.format`
137
+ 5. Uploads each file individually using the Hugging Face API
138
+ 6. Logs progress so the job can resume at any index
139
+
140
+ Designed with:
141
+
142
+ * Kaggle execution compatibility
143
+ * Resume-safe operation
144
+ * Support for millions of invoices
145
+ * No Git requirements (uploads via HF API)
146
+
147
+ ---
148
+
149
+ ## πŸ“¬ Contact / Usage Notes
150
+
151
+ This dataset is meant for:
152
+
153
+ * ETL automation
154
+ * Synthetic invoice processing pipelines
155
+ * AI model pre-processing
156
+ * OCR experiments
157
+ * Workflow system testing (n8n, make.com)
158
+
159
+ If you use this dataset in your workflow, feel free to reference or credit the repo.
160
+
161
+ ---