AWS SDK を使用して Lookout for Vision データセットを記述する - AWSSDK コードサンプル

AWSDocAWS SDKGitHub サンプルリポジトリには、さらに多くの SDK サンプルがあります

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

AWS SDK を使用して Lookout for Vision データセットを記述する

次のコード例は、Lookout for Vision データセットを記述する方法を示しています。

詳細については、「データセットを表示する」を参照してください。

Python
SDK for Python (Boto3)
注記

他にもありますGitHub。用例一覧を検索し、AWS コード例リポジトリでの設定と実行の方法を確認してください。

class Datasets: @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.")
  • API の詳細については、「AWSSDK for Python (Boto3) API リファレンス」のを参照してくださいDescribeDataset