檢視資料集 - Amazon Lookout for Vision

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

檢視資料集

專案可以有用於訓練和測試模型的單一資料集。或者,您可以有單獨的訓練和測試資料集。您可以使用主控台來檢視資料集。您也可以使用此DescribeDataset作業取得資料集 (訓練或測試) 的相關資訊。

檢視專案中的資料集 (主控台)

執行下列程序中的步驟,在主控台中檢視專案的資料集。

若要檢視資料集 (主控台)
  1. 打開亞馬遜 Lookout for Vision 控制台 https://console.aws.amazon.com/lookoutvision/.

  2. 選擇 Get started (開始使用)。

  3. 在左側導覽窗格中,選擇 [專案]。

  4. 在 [專案] 頁面上,選取包含您要檢視之資料集的專案。

  5. 在左側導覽窗格中,選擇 [資料集] 以檢視資料集詳細資料。如果您有訓練和測試資料集,則會顯示每個資料集的索引標籤。

檢視專案中的資料集 (SDK)

您可以使用此DescribeDataset作業取得與專案相關聯之訓練或測試資料集的相關資訊。

若要檢視您的資料集 (SDK)
  1. 如果您尚未這樣做,請安裝並設定AWS CLI和 AWS SDK。如需詳細資訊,請參閱步驟 4:設定 AWS CLI 以及 AWS SDKs

  2. 使用下列範例程式碼來檢視資料集。

    CLI

    變更下列值:

    • project-name至包含您要檢視之模型的專案名稱。

    • dataset-type到您要查看的數據集類型(traintest)。

    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; }