Amazon Rekognition Video Analyzer 项目教程
1. 项目目录结构及介绍
amazon-rekognition-video-analyzer/
├── aws-infra/
├── client/
├── config/
├── doc/
├── lambda/
├── third-party/
├── web-ui/
├── .gitignore
├── LICENSE.TXT
├── NOTICE.txt
├── README.md
├── build.py
目录结构介绍
- aws-infra/: 包含与AWS基础设施相关的配置和脚本。
- client/: 包含视频捕捉客户端的代码。
- config/: 包含项目的配置文件。
- doc/: 包含项目的文档文件。
- lambda/: 包含AWS Lambda函数的代码。
- third-party/: 包含第三方依赖库。
- web-ui/: 包含Web用户界面的代码。
- .gitignore: Git忽略文件。
- LICENSE.TXT: 项目许可证文件。
- NOTICE.txt: 项目通知文件。
- README.md: 项目介绍和使用说明。
- build.py: 项目构建脚本。
2. 项目启动文件介绍
build.py
build.py
是项目的构建脚本,用于自动化项目的构建和部署过程。它负责配置AWS资源、打包Lambda函数、部署Web UI等任务。
启动步骤
- 配置AWS CLI: 确保AWS CLI已安装并配置好。
- 激活虚拟环境: 使用
virtualenv
创建并激活Python虚拟环境。 - 运行构建脚本: 在项目根目录下运行
python build.py
。
3. 项目配置文件介绍
config/global-params.json
{
"StackName": "video-analyzer-stack"
}
参数介绍
- StackName: 指定在AWS账户中创建的CloudFormation堆栈的名称。
config/cfn-params.json
{
"SourceS3BucketParameter": "<NO-DEFAULT>",
"ImageProcessorSourceS3KeyParameter": "src/lambda_imageprocessor.zip",
"FrameFetcherSourceS3KeyParameter": "src/lambda_framefetcher.zip",
"FrameS3BucketNameParameter": "<NO-DEFAULT>",
"FrameFetcherApiResourcePathPart": "enrichedframe",
"ApiGatewayRestApiNameParameter": "VidAnalyzerRestApi",
"ApiGatewayStageNameParameter": "development",
"ApiGatewayUsagePlanNameParameter": "development-plan"
}
参数介绍
- SourceS3BucketParameter: 指定用于存储Lambda函数包的S3桶名称。
- ImageProcessorSourceS3KeyParameter: 指定Image Processor Lambda函数包的S3键。
- FrameFetcherSourceS3KeyParameter: 指定Frame Fetcher Lambda函数包的S3键。
- FrameS3BucketNameParameter: 指定用于存储视频帧图像的S3桶名称。
- FrameFetcherApiResourcePathPart: 指定Frame Fetcher API资源路径部分。
- ApiGatewayRestApiNameParameter: 指定要创建的API Gateway REST API的名称。
- ApiGatewayStageNameParameter: 指定API Gateway阶段名称。
- ApiGatewayUsagePlanNameParameter: 指定API Gateway使用计划名称。
通过以上配置文件和启动文件的介绍,您可以更好地理解和使用Amazon Rekognition Video Analyzer项目。