データセットの表示 - Amazon Lookout for Vision

データセットの表示

プロジェクトには、モデルのトレーニングとテストに使用する単一のデータセットを使用できます。または、個別のトレーニングデータセットとテストデータセットを使用することもできます。コンソールを使用して、検証テストを表示できます。また、DescribeDataset オペレーション を使用してデータセットに関する情報を取得することができます (トレーニングまたはテスト)。

プロジェクト内のデータセットの表示 (コンソール)

次の手順のステップを実行し、コンソールでプロジェクトのデータセットを表示します。

データセットを表示するには (コンソール)
  1. https://console.aws.amazon.com/lookoutvision/ で Amazon Lookout for Vision コンソールを開きます。

  2. [開始する] を選択します。

  3. 左側のナビゲーションペインで、[プロジェクト] を選択します。

  4. プロジェクト」ページで、表示したいデータセットを含むプロジェクトを選択します。

  5. 左のナビゲーションペインで [データセット] を選択して、データセットの詳細を表示します。トレーニングデータセットとテストデータセットがある場合は、各データセットのタブが表示されます。

プロジェクト内のデータセットの表示 (SDK)

DescribeDataset オペレーションを使って背景、プロジェクトに関連するトレーニングまたはテストデータセットについての情報を取得できます。

データセット (SDK) を表示するには
  1. まだの場合は、AWS CLI と AWS SDK をインストールして構成します。詳細については、「ステップ 4: AWS CLI と AWS SDK をセットアップする」を参照してください。

  2. 次のサンプルコードを使用して、データセットを表示します。

    CLI

    以下の値を変更します。

    • project-name に表示したいモデルを含むプロジェクト名を入力します。

    • dataset-type を表示したいデータセットの種類に合わせます。(train または test)

    aws lookoutvision describe-dataset --project-name project name\ --dataset-type train or test \ --profile lookoutvision-access
    Python

    このコードは、AWS ドキュメント SDK の例 GitHub リポジトリから引用されたものです。詳しい事例はこちらです。

    @staticmethod def describe_dataset(lookoutvision_client, project_name, dataset_type): """ Gets information about a Lookout for Vision dataset. :param lookoutvision_client: A Boto3 Lookout for Vision client. :param project_name: The name of the project that contains the dataset that you want to describe. :param dataset_type: The type (train or test) of the dataset that you want to describe. """ try: response = lookoutvision_client.describe_dataset( ProjectName=project_name, DatasetType=dataset_type ) print(f"Name: {response['DatasetDescription']['ProjectName']}") print(f"Type: {response['DatasetDescription']['DatasetType']}") print(f"Status: {response['DatasetDescription']['Status']}") print(f"Message: {response['DatasetDescription']['StatusMessage']}") print(f"Images: {response['DatasetDescription']['ImageStats']['Total']}") print(f"Labeled: {response['DatasetDescription']['ImageStats']['Labeled']}") print(f"Normal: {response['DatasetDescription']['ImageStats']['Normal']}") print(f"Anomaly: {response['DatasetDescription']['ImageStats']['Anomaly']}") except ClientError: logger.exception("Service error: problem listing datasets.") raise print("Done.")
    Java V2

    このコードは、AWS ドキュメント SDK の例 GitHub リポジトリから引用されたものです。詳しい事例はこちらです。

    /** * Gets the description for a Amazon Lookout for Vision dataset. * * @param lfvClient An Amazon Lookout for Vision client. * @param projectName The name of the project in which you want to describe a * dataset. * @param datasetType The type of the dataset that you want to describe (train * or test). * @return DatasetDescription A description of the dataset. */ public static DatasetDescription describeDataset(LookoutVisionClient lfvClient, String projectName, String datasetType) throws LookoutVisionException { logger.log(Level.INFO, "Describing {0} dataset for project {1}", new Object[] { datasetType, projectName }); DescribeDatasetRequest describeDatasetRequest = DescribeDatasetRequest.builder() .projectName(projectName) .datasetType(datasetType) .build(); DescribeDatasetResponse describeDatasetResponse = lfvClient.describeDataset(describeDatasetRequest); DatasetDescription datasetDescription = describeDatasetResponse.datasetDescription(); logger.log(Level.INFO, "Project: {0}\n" + "Created: {1}\n" + "Type: {2}\n" + "Total: {3}\n" + "Labeled: {4}\n" + "Normal: {5}\n" + "Anomalous: {6}\n", new Object[] { datasetDescription.projectName(), datasetDescription.creationTimestamp(), datasetDescription.datasetType(), datasetDescription.imageStats().total().toString(), datasetDescription.imageStats().labeled().toString(), datasetDescription.imageStats().normal().toString(), datasetDescription.imageStats().anomaly().toString(), }); return datasetDescription; }