Instructions to use minigu5/hwip-formulanet with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use minigu5/hwip-formulanet with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('image-to-text', 'minigu5/hwip-formulanet');
hwip-formulanet
ํฉ(Hwip)์ ์์ ์ด๋ฏธ์ง โ LaTeX ์ธ์ ๋ชจ๋ธ. alephpi/FormulaNet(PP-FormulaNet-S ๊ธฐ๋ฐ, 20M ํ๋ผ๋ฏธํฐ)์ AI ์ฑ๋ด ํ๋ฉด ์บก์ฒยทํ๋ ฌยทcasesยท๋คํฌ๋ชจ๋ ์ฉ๋๋ก ํ์ธํ๋ํ๊ณ , ๊ฐ์ค์น๋ง int8๋ก ์์ถํ๋ค(80MB โ 20MB, ์ฐ์ฐ์ fp32).
์ฌ์ฉ๋ฒ (transformers.js v3)
import { VisionEncoderDecoderModel, PreTrainedTokenizer } from '@huggingface/transformers';
const model = await VisionEncoderDecoderModel.from_pretrained('minigu5/hwip-formulanet', { dtype: 'fp32' });
const tokenizer = await PreTrainedTokenizer.from_pretrained('minigu5/hwip-formulanet');
// ์
๋ ฅ: UniMERNet ์ ์ฒ๋ฆฌ(๊ทธ๋ ์ด์ค์ผ์ผยท๋ฐ์ ยท์ฌ๋ฐฑ ํฌ๋กญยท384ร384 ์ค์ ํจ๋ฉยทmean 0.7931/std 0.1738)ํ
// 1์ฑ๋ ํ
์๋ฅผ 3์ฑ๋๋ก ๋ณต์ ํ [1, 3, 384, 384]
const out = await model.generate({ inputs: pixelValues });
const latex = tokenizer.batch_decode(out, { skip_special_tokens: true })[0];
์ ์ฒ๋ฆฌยทํ์ฒ๋ฆฌ ๊ตฌํ: minigu5/hwip (app.js์ preprocessImage, src/converter.js์ cleanOcr). ํ์ต ์คํฌ๋ฆฝํธ: tools/ocr-train/.
ํ์ต
- ๋ฐ์ดํฐ: UniMER-1M ์ฌ์ 10๋ง + KaTeX/MathJax ํฉ์ฑ 10๋ง(ํ๋ ฌยทcases ํฌํจ, ๋คํฌ๋ชจ๋ยท์ ํด์๋ ๋ณํ)
- ํ๋ ฌยทcases ๋ผ๋ฒจ์ UniMER ๊ท์ฝ(
\left ( \begin{array} โฆ)์ ๋ฐ๋ฅธ๋ค.
ํ๊ฐ (๋ธ๋ผ์ฐ์ , 508์ฅ: MathJax ๋ ๋ 312 + matplotlib 196, ๋ ๋ ๊ฒฐ๊ณผ ์ผ์น ๊ธฐ์ค)
| ๋ชจ๋ธ | ์์ถ๋ ฅ | + cleanOcr ํ์ฒ๋ฆฌ |
|---|---|---|
| alephpi/FormulaNet (int8) | 407 | 459 |
| hwip-formulanet | 433 | 475 |
๋ผ์ด์ ์ค
AGPL-3.0 (์ ๋ชจ๋ธ ๋ผ์ด์ ์ค ์น๊ณ).
- Downloads last month
- 63