How to use the deepforest.utilities.use_release function in deepforest

To help you get started, we’ve selected a few deepforest examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github weecology / DeepForest / tests / test_deepforest.py View on Github external
def download_release():
    print("running fixtures")
    utilities.use_release()    
github weecology / DeepForest / tests / test_utilities.py View on Github external
def test_use_release():
    #Download latest model from github release
    release_tag, weights = utilities.use_release()
    assert os.path.exists(get_data("NEON.h5"))
github weecology / DeepForest / deepforest / deepforest.py View on Github external
def use_release(self):
        '''Use the latest DeepForest model release from github and load model. Optionally download if release doesn't exist
        
        Returns:
            model (object): A trained keras model
        '''        
        #Download latest model from github release
        release_tag, self.weights = utilities.use_release()  
        
        #load saved model and tag release
        self.__release_version__ = release_tag
        print("Loading pre-built model: {}".format(release_tag))
        
        with warnings.catch_warnings():
            #Suppress compilte warning, not relevant here
            warnings.filterwarnings("ignore",category=UserWarning)          
            self.model = utilities.read_model(self.weights, self.config)
        
        #Convert model
        self.prediction_model = convert_model(self.model)
        
        #add to config
        self.config["weights"] = self.weights