Example #1
0
def train(data_path, labels, site_aware, tempdir):
    """ Retrain network from scratch.

        Train the weights from scratch using
        the provided data_path and labels.
    """
    click.echo(f"Using data_path:\t{data_path}")
    click.echo(f"Using labels:\t{labels}")
    click.echo(f"Using tempdir:\t{tempdir}")

    # Load the model into manager
    manager = ModelManager(model_path=default_model_dir,
                           model_class='cnnensemble',
                           tempdir=tempdir,
                           model_kwargs=dict(download_weights=False,
                                             site_aware=site_aware,
                                             raw_video_dir=data_path,
                                             labels_path=labels))

    # Make predictions, return a DataFrame
    manager.train()
Example #2
0
def test_train():
    manager = ModelManager(model_class='cnnensemble',
                           verbose=True,
                           model_kwargs=dict(download_weights=False))
    manager.train(config)