async predict(buffer){
        if(this.type == "keras"){
            await this.model.ready();

            return await this.model.predict({
                input_1: new Float32Array(buffer)
            });
        }
        else{
            let bufferImage = await this.data.__bufferToTensor(buffer);
            let { values, indices } = this.model.predict(bufferImage).topk();
            
            return {
                label: this.data.labels[indices.dataSync()[0]],
                confidence: values.dataSync()[0]
            };
        }
    }
/**
     * Buffer prediction function
     * 
     * @param string filename
     * @return Promise
     */
Buffer prediction function

@param string filename
@return Promise
Buffer prediction function @param string filename @return Promise
async predict(buffer){
        if(this.type == "keras"){
            await this.model.ready();
            return await this.model.predict({
                input_1: new Float32Array(buffer)
            });
        }
        else{
            let bufferImage = await this.data.__bufferToTensor(buffer);
            let { values, indices } = this.model.predict(bufferImage).topk();
            return {
                label: this.data.labels[indices.dataSync()[0]],
                confidence: values.dataSync()[0]
            };
        }
    }
async predict ( buffer ) { if ( this . type == "keras" ) { await this . model . ready ( ) ; return await this . model . predict ( { input_1 : new Float32Array ( buffer ) } ) ; } else { let bufferImage = await this . data . __bufferToTensor ( buffer ) ; let { values , indices } = this . model . predict ( bufferImage ) . topk ( ) ; return { label : this . data . labels [ indices . dataSync ( ) [ 0 ] ] , confidence : values . dataSync ( ) [ 0 ] } ; } }
Buffer prediction function
Buffer prediction function