Constructors

Methods

  • Converts an image to text using Tesseract on Golem.

    Parameters

    • sourcePath: string

      The file path of the source image.

    Returns Promise<undefined | string>

    A promise that resolves to the resulting text if successful, or undefined if there was an error.

    Error an error if the Tesseract On Golem is not initialized yet, or if the source image file does not exist, or if the OCR on Golem fails.

  • Initializes Tesseract On Golem.

    It's important to run this before your first request to the OCR.

    Returns Promise<void>

    A promise that resolves when the initialization is complete.

  • Stops the Tesseract service gracefully by shutting down the Golem

    It's important to run this so that all OCR requests are gracefully completed and all payoffs on the Golem Network are completed.

    Returns Promise<void>

    A Promise that resolves once the shutdown process is complete.