async load(fileOrDirname){
        if(this.type == "keras"){
            this.model = this.modelClass.load(fileOrDirname);
        }
        else{
            if(!fs.existsSync(fileOrDirname))
                throw "Model not exists";
                
            this.model = await tf.loadLayersModel(
                "file://" + fileOrDirname + "/model.json"
            );
    
            this.data.labels = await fse
                .readJson(path.join(fileOrDirname, "labels.json"))
                .then(obj => obj.Labels);
    
            this.currentModelPath = fileOrDirname;
        }
    }
/**
     * Function to load pre-trained model
     * 
     * @param string fileOrDirname
     * @return Promise
     */
Function to load pre-trained model

@param string fileOrDirname
@return Promise
Function to load pre - trained model @param string fileOrDirname @return Promise
async load(fileOrDirname){
        if(this.type == "keras"){
            this.model = this.modelClass.load(fileOrDirname);
        }
        else{
            if(!fs.existsSync(fileOrDirname))
                throw "Model not exists";
            this.model = await tf.loadLayersModel(
                "file://" + fileOrDirname + "/model.json"
            );
            this.data.labels = await fse
                .readJson(path.join(fileOrDirname, "labels.json"))
                .then(obj => obj.Labels);
            this.currentModelPath = fileOrDirname;
        }
    }
async load ( fileOrDirname ) { if ( this . type == "keras" ) { this . model = this . modelClass . load ( fileOrDirname ) ; } else { if ( ! fs . existsSync ( fileOrDirname ) ) throw "Model not exists" ; this . model = await tf . loadLayersModel ( "file://" + fileOrDirname + "/model.json" ) ; this . data . labels = await fse . readJson ( path . join ( fileOrDirname , "labels.json" ) ) . then ( obj => obj . Labels ) ; this . currentModelPath = fileOrDirname ; } }
Function to load pre-trained model
Function to load pre - trained model