better logs
This commit is contained in:
parent
ffedf2e961
commit
60e81e9e84
|
@ -78,6 +78,9 @@ class TesseractService implements TextDetectionService {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (imageHeight > TESSERACT_MAX_IMAGE_DIMENSION) {
|
if (imageHeight > TESSERACT_MAX_IMAGE_DIMENSION) {
|
||||||
|
console.log(
|
||||||
|
`original dimension (${imageBitmap.width}px,${imageBitmap.height}px)`
|
||||||
|
);
|
||||||
imageBitmap = resizeToSquare(
|
imageBitmap = resizeToSquare(
|
||||||
imageBitmap,
|
imageBitmap,
|
||||||
TESSERACT_MAX_IMAGE_DIMENSION
|
TESSERACT_MAX_IMAGE_DIMENSION
|
||||||
|
@ -103,6 +106,9 @@ class TesseractService implements TextDetectionService {
|
||||||
|
|
||||||
const tesseractWorker = await this.getTesseractWorker();
|
const tesseractWorker = await this.getTesseractWorker();
|
||||||
const id = makeID(6);
|
const id = makeID(6);
|
||||||
|
console.log(
|
||||||
|
`detecting text (${imageBitmap.width}px,${imageBitmap.height}px) fileType=${fileTypeInfo.exactType}`
|
||||||
|
);
|
||||||
console.time('detecting text ' + id);
|
console.time('detecting text ' + id);
|
||||||
|
|
||||||
const detections = await tesseractWorker.recognize(file);
|
const detections = await tesseractWorker.recognize(file);
|
||||||
|
|
Loading…
Reference in a new issue