コード例 #1
0
ファイル: auth.py プロジェクト: vvkpd/Hub
def login(username, password):
    """ Logs in to Snark AI"""
    token = ""
    if token:
        logger.info("Token login.")
        logger.degug("Getting the token...")
        token = click.prompt(
            "Please paste the authentication token from {}".format(
                config.GET_TOKEN_REST_SUFFIX, type=str, hide_input=True
            )
        )
        token = token.strip()
        AuthClient.check_token(token)
    else:
        logger.info(
            "Please log in using Snark AI credentials. You can register at https://app.activeloop.ai "
        )
        if not username:
            logger.debug("Prompting for username.")
            username = click.prompt("Username", type=str)
        username = username.strip()
        if not password:
            logger.debug("Prompting for password.")
            password = click.prompt("Password", type=str, hide_input=True)
        password = password.strip()
        token = AuthClient().get_access_token(username, password)
    TokenManager.set_token(token)
    HubControlClient().get_credentials()
    logger.info("Login Successful.")
コード例 #2
0
def main():
    t1 = time.time()
    parser = argparse.ArgumentParser()
    parser.add_argument(
        "dataset_path",
        metavar="P",
        type=str,
        help="Path to MPII Human Pose Dataset",
        default="./mpii_human_pose_v1",
    )
    parser.add_argument(
        "output_path",
        metavar="N",
        type=str,
        help="Dataset output path",
        default="MPII_human_pose_data",
    )

    args = parser.parse_args()
    ds = load_dataset(args)
    ds.store(f"{args.output_path}")
    t2 = time.time()
    logger.info(f"Pipeline took {(t2 - t1) / 60} minutes")