Spaces:
Runtime error
Runtime error
Download node_app/pytesseractJsOCR.js from LukeDev/Pytesseract-PytesseractJs-LLM-OCR: direct link, hf CLI and curl.
- Browser
- Download file 444 Bytes
-
https://huggingface.co/spaces/LukeDev/Pytesseract-PytesseractJs-LLM-OCR/resolve/main/node_app/pytesseractJsOCR.js
- Command line
-
hf download hf://spaces/LukeDev/Pytesseract-PytesseractJs-LLM-OCR/node_app/pytesseractJsOCR.js
-
curl -L -o pytesseractJsOCR.js https://huggingface.co/spaces/LukeDev/Pytesseract-PytesseractJs-LLM-OCR/resolve/main/node_app/pytesseractJsOCR.js
444 Bytes
| const Tesseract = require('tesseract.js'); | |
| const fs = require('fs'); | |
| const image = process.argv[2]; | |
| const lang = process.argv[3]; | |
| const saveFilePath = process.argv[4]; | |
| Tesseract.recognize( | |
| image, | |
| lang, | |
| { | |
| logger: m => console.log(m) | |
| } | |
| ).then(({ data: { text } }) => { | |
| console.log(text); | |
| fs.writeFileSync(saveFilePath, text); | |
| }).catch(err => { | |
| console.error(err); | |
| fs.writeFileSync(saveFilePath, 'Error: ' + err.message); | |
| }); |