mindee
Version:
Mindee Client Library for Node.js
28 lines (27 loc) • 1.24 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.MultiReceiptsDetectorV1 = void 0;
const common_1 = require("../../parsing/common");
const multiReceiptsDetectorV1Document_1 = require("./multiReceiptsDetectorV1Document");
/**
* Multi Receipts Detector API version 1 inference prediction.
*/
class MultiReceiptsDetectorV1 extends common_1.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_1.MultiReceiptsDetectorV1Document(rawPrediction["prediction"]);
rawPrediction["pages"].forEach((page) => {
if (page.prediction !== undefined && page.prediction !== null &&
Object.keys(page.prediction).length > 0) {
this.pages.push(new common_1.Page(multiReceiptsDetectorV1Document_1.MultiReceiptsDetectorV1Document, page, page["id"], page["orientation"]));
}
});
}
}
exports.MultiReceiptsDetectorV1 = MultiReceiptsDetectorV1;