UNPKG

mindee

Version:

Mindee Client Library for Node.js

24 lines (23 loc) 1.01 kB
import { Inference, Page } from "../../../v1/parsing/common/index.js"; import { MultiReceiptsDetectorV1Document } from "./multiReceiptsDetectorV1Document.js"; /** * Multi Receipts Detector API version 1 inference prediction. */ export class MultiReceiptsDetectorV1 extends Inference { constructor(rawPrediction) { super(rawPrediction); /** The endpoint's name. */ this.endpointName = "multi_receipts_detector"; /** The endpoint's version. */ this.endpointVersion = "1"; /** The document's pages. */ this.pages = []; this.prediction = new MultiReceiptsDetectorV1Document(rawPrediction["prediction"]); rawPrediction["pages"].forEach((page) => { if (page.prediction !== undefined && page.prediction !== null && Object.keys(page.prediction).length > 0) { this.pages.push(new Page(MultiReceiptsDetectorV1Document, page, page["id"], page["orientation"])); } }); } }