@regolithco/ocr
v1.5.2
Published
OCR utilities using PaddleOCR
Readme
@regolithco/ocr
OCR utilities using PaddleOCR, designed for RegolithCo applications. This library provides OCR capabilities for parsing specific game assets like Mining Orders and Rocks, with support for Browser environments.
Installation
yarn add @regolithco/ocrUsage
This library exports specific parsers for game entities.
Parsing Shipping Orders
import { parseShipMiningOrder } from '@regolithco/ocr'
// In Node.js environment
const result = await parseShipMiningOrder('path/to/image.png')
console.log(result)Parsing Rocks
import { parseShipRock } from '@regolithco/ocr'
const result = await parseShipRock('path/to/image.png')
console.log(result)Development
Clone the repository and install dependencies:
yarn installScripts
yarn build: Compile TypeScript todist/.yarn test: Run unit tests using Jest.yarn debug: Run the PaddleOCR debug script on test images.yarn debug:choose: Run the debug script with an interactive file chooser.
Adding a new image
- add it to the appropriate folder.
- Run
yarn debug:chooseto see if it works. - If it doesn't, you can run
yarn debugto see the raw output and adjust the parser.
License
ISC
