Model card: the apps show readings in katakana; the readers' classes stay hiragana
Browse files
README.md
CHANGED
|
@@ -135,8 +135,9 @@ model-index:
|
|
| 135 |
**To our knowledge, the first OCR for the Hunter × Hunter alphabet** (ハンター文字), the
|
| 136 |
invented script of the manga and anime, which is a one-to-one cipher for Japanese kana. This
|
| 137 |
repository holds a small model family: five sets, each a text-line detector and two CTC line
|
| 138 |
-
readers (horizontal lines and vertical columns).
|
| 139 |
-
|
|
|
|
| 140 |
also read digits and `! ? : / . -` written inline, and the v7 readers, which the demo runs, also
|
| 141 |
read the cross `×` that separates the words of the anime's episode titles ("A×ト×B"). Two more
|
| 142 |
folders each hold a single, much smaller reader made for the Nintendo DSi: `dsi_v1`, and
|
|
@@ -414,7 +415,12 @@ def read_line(path, H=48, W=768):
|
|
| 414 |
if i != prev and i != 0:
|
| 415 |
out.append(vocab[i - 1])
|
| 416 |
prev = i
|
| 417 |
-
return "".join(out)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 418 |
```
|
| 419 |
|
| 420 |
For the DSi reader use `onnx/dsi_v2/qat_dsi_v2h_32x512.onnx` with the same `vocab/v7.json` (or
|
|
@@ -510,8 +516,9 @@ exact int8 inference in the browser.
|
|
| 510 |
- The cross: the v7 readers (and `dsi_v2`) read about 2-3% of the long-vowel marks `ー` on blurry lines as `×`, and a
|
| 511 |
lone `×` such as an app's close button can come out as a line of its own. The vertical
|
| 512 |
readers have no cross (episode titles are horizontal).
|
| 513 |
-
- The script maps to kana sounds, so the output is phonetic
|
| 514 |
-
|
|
|
|
| 515 |
|
| 516 |
## Credit
|
| 517 |
|
|
|
|
| 135 |
**To our knowledge, the first OCR for the Hunter × Hunter alphabet** (ハンター文字), the
|
| 136 |
invented script of the manga and anime, which is a one-to-one cipher for Japanese kana. This
|
| 137 |
repository holds a small model family: five sets, each a text-line detector and two CTC line
|
| 138 |
+
readers (horizontal lines and vertical columns). The readers' classes are hiragana (the apps
|
| 139 |
+
show the reading in katakana); katakana and small kana come out as full-size kana, because the
|
| 140 |
+
glyphs do not tell them apart. The newer readers
|
| 141 |
also read digits and `! ? : / . -` written inline, and the v7 readers, which the demo runs, also
|
| 142 |
read the cross `×` that separates the words of the anime's episode titles ("A×ト×B"). Two more
|
| 143 |
folders each hold a single, much smaller reader made for the Nintendo DSi: `dsi_v1`, and
|
|
|
|
| 415 |
if i != prev and i != 0:
|
| 416 |
out.append(vocab[i - 1])
|
| 417 |
prev = i
|
| 418 |
+
return "".join(out) # hiragana: the model's classes are hiragana
|
| 419 |
+
|
| 420 |
+
def to_katakana(text): # what the apps show; ー, spaces, digits and × pass through
|
| 421 |
+
return "".join(chr(ord(c) + 0x60) if "ぁ" <= c <= "ゖ" else c for c in text)
|
| 422 |
+
|
| 423 |
+
# print(to_katakana(read_line("line.png"))) # e.g. ハンター
|
| 424 |
```
|
| 425 |
|
| 426 |
For the DSi reader use `onnx/dsi_v2/qat_dsi_v2h_32x512.onnx` with the same `vocab/v7.json` (or
|
|
|
|
| 516 |
- The cross: the v7 readers (and `dsi_v2`) read about 2-3% of the long-vowel marks `ー` on blurry lines as `×`, and a
|
| 517 |
lone `×` such as an app's close button can come out as a line of its own. The vertical
|
| 518 |
readers have no cross (episode titles are horizontal).
|
| 519 |
+
- The script maps to kana sounds, so the output is phonetic kana, not the original Japanese
|
| 520 |
+
spelling (no kanji). The classes are hiragana, so a reading does not say whether the
|
| 521 |
+
original used katakana; the apps show it in katakana, and small kana come out full size.
|
| 522 |
|
| 523 |
## Credit
|
| 524 |
|