WARAJA commited on
Commit
2f57df8
·
verified ·
1 Parent(s): 2c52c58

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +72 -71
README.md CHANGED
@@ -1,71 +1,72 @@
1
- ---
2
- title: Tzefa
3
- emoji: "\U0001F40D"
4
- colorFrom: green
5
- colorTo: blue
6
- sdk: gradio
7
- sdk_version: "5.8.0"
8
- app_file: app.py
9
- pinned: true
10
- license: cc-by-nc-3.0
11
- pipeline_tag: image-to-text
12
- tags:
13
- - vision
14
- - ocr
15
- - document-processing
16
- - binarization
17
- - yolo
18
- - trocr
19
- - handwriting-recognition
20
- - programming-language
21
- - compiler
22
- thumbnail: >-
23
- https://cdn-uploads.huggingface.co/production/uploads/6645e2ce9c6ed6c615e56bf0/eTdBX9sR1-qzBuEPVWwZA.jpeg
24
- ---
25
-
26
- # Tzefa - Handwritten Code to Execution
27
-
28
- **Tzefa** is an end-to-end system that photographs handwritten code on a whiteboard,
29
- recognizes it via a custom OCR pipeline, compiles it through a custom programming language,
30
- and executes it -- all from a single image upload.
31
-
32
- ## Pipeline
33
- ```
34
- Image Upload
35
- |-- Stage 1: Binarization -- HighResMAnet (mit_b5), tiled 640x640
36
- |-- Stage 2: Line Segmentation -- YOLO11x-OBB, oriented bounding boxes
37
- |-- Stage 3: Word Segmentation -- Morphological dilation (exactly 3 words/line)
38
- |-- Stage 4: Word OCR -- Fine-tuned TrOCR
39
- |-- Stage 5: Error Correction -- Edit-distance matching against Tzefa vocabulary
40
- |-- Stage 6: Compilation -- Tzefa instructions -> Python code
41
- '-- Stage 7: Execution -- Subprocess with 15s timeout
42
- ```
43
-
44
- ## Modular Design
45
- All models load from their own HuggingFace repos. Push new weights to any repo
46
- and this Space picks them up on next run.
47
-
48
- | Component | Model Repo |
49
- |-----------|-----------|
50
- | Binarization (b3) | [WARAJA/Model](https://huggingface.co/spaces/WARAJA/Model) |
51
- | Binarization (b5) | [WARAJA/b5_model](https://huggingface.co/WARAJA/b5_model) |
52
- | Line Segmentation | [WARAJA/Tzefa-Line-Segmentation-YOLO](https://huggingface.co/WARAJA/Tzefa-Line-Segmentation-YOLO) |
53
- | Word OCR | [WARAJA/Tzefa-Word-OCR-TrOCR](https://huggingface.co/WARAJA/Tzefa-Word-OCR-TrOCR) |
54
-
55
- ## Tzefa Language
56
- Every instruction is exactly 3 tokens: `COMMAND ARG1 ARG2`
57
-
58
- ```
59
- MAKEINTEGER NUMY FIVE -- create integer NUMY = 5
60
- MULTIPLY RESULT BIGLY -- RESULT = RESULT * BIGLY
61
- PRINTINTEGER TEMPORARY BREAK -- print TEMPORARY with newline
62
- ```
63
-
64
- Numbers are written as words (ZERO through ONEHUNDRED) to maximize OCR error correction.
65
-
66
- ## Related
67
- - [Binarization Demo](https://huggingface.co/spaces/WARAJA/Tzefa-Binarization)
68
- - [Binarization Dataset](https://huggingface.co/datasets/WARAJA/Tzefa-Binarization-Dataset)
69
- - [Line Segmentation Dataset](https://huggingface.co/datasets/WARAJA/Tzefa-Line-Segmentation-Dataset)
70
- - [Word OCR Dataset](https://huggingface.co/datasets/WARAJA/Tzefa-Word-OCR-Dataset)
71
-
 
 
1
+ ---
2
+ title: Tzefa
3
+ emoji: 🚀
4
+ colorFrom: blue
5
+ colorTo: green
6
+ sdk: gradio
7
+ sdk_version: 5.9.0
8
+ python_version: 3.11
9
+ app_file: app.py
10
+ pinned: false
11
+ license: cc-by-nc-3.0
12
+ pipeline_tag: image-to-text
13
+ tags:
14
+ - vision
15
+ - ocr
16
+ - document-processing
17
+ - binarization
18
+ - yolo
19
+ - trocr
20
+ - handwriting-recognition
21
+ - programming-language
22
+ - compiler
23
+ thumbnail: >-
24
+ https://cdn-uploads.huggingface.co/production/uploads/6645e2ce9c6ed6c615e56bf0/eTdBX9sR1-qzBuEPVWwZA.jpeg
25
+ ---
26
+
27
+ # Tzefa - Handwritten Code to Execution
28
+
29
+ **Tzefa** is an end-to-end system that photographs handwritten code on a whiteboard,
30
+ recognizes it via a custom OCR pipeline, compiles it through a custom programming language,
31
+ and executes it -- all from a single image upload.
32
+
33
+ ## Pipeline
34
+ ```
35
+ Image Upload
36
+ |-- Stage 1: Binarization -- HighResMAnet (mit_b5), tiled 640x640
37
+ |-- Stage 2: Line Segmentation -- YOLO11x-OBB, oriented bounding boxes
38
+ |-- Stage 3: Word Segmentation -- Morphological dilation (exactly 3 words/line)
39
+ |-- Stage 4: Word OCR -- Fine-tuned TrOCR
40
+ |-- Stage 5: Error Correction -- Edit-distance matching against Tzefa vocabulary
41
+ |-- Stage 6: Compilation -- Tzefa instructions -> Python code
42
+ '-- Stage 7: Execution -- Subprocess with 15s timeout
43
+ ```
44
+
45
+ ## Modular Design
46
+ All models load from their own HuggingFace repos. Push new weights to any repo
47
+ and this Space picks them up on next run.
48
+
49
+ | Component | Model Repo |
50
+ |-----------|-----------|
51
+ | Binarization (b3) | [WARAJA/Model](https://huggingface.co/spaces/WARAJA/Model) |
52
+ | Binarization (b5) | [WARAJA/b5_model](https://huggingface.co/WARAJA/b5_model) |
53
+ | Line Segmentation | [WARAJA/Tzefa-Line-Segmentation-YOLO](https://huggingface.co/WARAJA/Tzefa-Line-Segmentation-YOLO) |
54
+ | Word OCR | [WARAJA/Tzefa-Word-OCR-TrOCR](https://huggingface.co/WARAJA/Tzefa-Word-OCR-TrOCR) |
55
+
56
+ ## Tzefa Language
57
+ Every instruction is exactly 3 tokens: `COMMAND ARG1 ARG2`
58
+
59
+ ```
60
+ MAKEINTEGER NUMY FIVE -- create integer NUMY = 5
61
+ MULTIPLY RESULT BIGLY -- RESULT = RESULT * BIGLY
62
+ PRINTINTEGER TEMPORARY BREAK -- print TEMPORARY with newline
63
+ ```
64
+
65
+ Numbers are written as words (ZERO through ONEHUNDRED) to maximize OCR error correction.
66
+
67
+ ## Related
68
+ - [Binarization Demo](https://huggingface.co/spaces/WARAJA/Tzefa-Binarization)
69
+ - [Binarization Dataset](https://huggingface.co/datasets/WARAJA/Tzefa-Binarization-Dataset)
70
+ - [Line Segmentation Dataset](https://huggingface.co/datasets/WARAJA/Tzefa-Line-Segmentation-Dataset)
71
+ - [Word OCR Dataset](https://huggingface.co/datasets/WARAJA/Tzefa-Word-OCR-Dataset)
72
+