reports/sep/code/mec.deepmech.js
/**
         * Detect constraints on prepared crops.
         * @param {object} image (tensor) which contains the image on the canvas.
         * @returns {object} Predicted constraints on crops.
         *                   Constraints are only predicted if they point from upper left to bottom right
         */
Detect constraints on prepared crops.
@param {object} image (tensor) which contains the image on the canvas.
@returns {object} Predicted constraints on crops.
Constraints are only predicted if they point from upper left to bottom right
Detect constraints on prepared crops . @param { object } image ( tensor ) which contains the image on the canvas . @returns { object } Predicted constraints on crops . Constraints are only predicted if they point from upper left to bottom right
async detectConstraints(crops) {
            const constraintDetector = await this.constraintDetector;
            return constraintDetector.predict(crops, { batch_size: crops.shape[0] })
                .arraySync()
                .map(c => c.indexOf(Math.max(...c)));
        }
async detectConstraints ( crops ) { const constraintDetector = await this . constraintDetector ; return constraintDetector . predict ( crops , { batch_size : crops . shape [ 0 ] } ) . arraySync ( ) . map ( c => c . indexOf ( Math . max ( ... c ) ) ) ; }
Detect constraints on prepared crops.
Detect constraints on prepared crops .