gutenye / ocr

High accurate text detection (OCR) Javascript/Typescript library that runs on Node.js, Browser, React Native and C++. Based on PaddleOCR and ONNX runtime
https://gutenye-ocr.netlify.app/
MIT License
36 stars 6 forks source link

Getting a warning when running on multiple images at once #11

Closed ajitid closed 3 months ago

ajitid commented 3 months ago

Here's essentially what my code does:

const ocr = await Ocr.create()
const filePaths = ["path/to/image/1.png", "path/to/image/2.png"]
await Promise.all(filePaths.map(p => ocr.detect(p)))

I see this warning when I run the above code:

PS mycode> pnpm exec tsx --trace-warnings .\src\main.ts
Detection: 593.277ms
Detection: 1.098s
(node:11536) Warning: Label 'Recognition' already exists for console.time()
    at console.time (node:internal/console/constructor:410:15)
    at Recognition.run (C:\Users\ajits\ghq\github.com\ajitid\lookback\node_modules\.pnpm\@gutenye+ocr-common@1.4.1\node_modules\@gutenye\ocr-common\src\models\Recognition.ts:49:13)
    at Ocr.detect (C:\Users\ajits\ghq\github.com\ajitid\lookback\node_modules\.pnpm\@gutenye+ocr-common@1.4.1\node_modules\@gutenye\ocr-common\src\Ocr.ts:27:19)
    at async Promise.all (index 1)
    at main (C:\Users\ajit\mycode\main.ts:25:3)
Recognition: 5.139s
(node:11536) Warning: No such label 'Recognition' for console.timeEnd()
    at timeLogImpl (node:internal/console/constructor:629:13)
    at console.timeEnd (node:internal/console/constructor:420:19)
    at Recognition.run (C:\Users\ajits\ghq\github.com\ajitid\lookback\node_modules\.pnpm\@gutenye+ocr-common@1.4.1\node_modules\@gutenye\ocr-common\src\models\Recognition.ts:57:13)
    at Ocr.detect (C:\Users\ajits\ghq\github.com\ajitid\lookback\node_modules\.pnpm\@gutenye+ocr-common@1.4.1\node_modules\@gutenye\ocr-common\src\Ocr.ts:27:19)
    at async Promise.all (index 1)
    at main (C:\Users\ajit\mycode\main.ts:25:3)