使用 AWS Rekognition,我能够使用以下 nodejs 在 mp4 视频中检测到人脸,
var AWS = require("aws-sdk");
AWS.config.update({
region: "us-east-1"
});
var rekognition = new AWS.Rekognition();
var params = {
Video: { /* required */
S3Object: {
Bucket: 'videobucket',
Name: 'testvideo.mp4'
}
},
FaceAttributes: "ALL",
NotificationChannel: {
RoleArn: 'arn:aws:iam::xxx:role/xxx', /* required */
SNSTopicArn: 'arn:aws:sns:us-east-1:xxx:alerts' /* required */
}
};
rekognition.startFaceDetection(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
并且能够使用以下cli获得结果,
aws rekognition get-face-detection --job-id xxxxxxx
并以以下 json 格式输出人脸,
{
"Faces": [
{
"Timestamp": 0,
"Face": {
"BoundingBox": {
"Width": 0.029999999329447746,
"Top": 0.2588889002799988,
"Left": 0.29374998807907104,
"Height": 0.052222222089767456
},
"Landmarks": [
{
"Y": 0.28277161717414856,
"X": 0.3052537739276886,
"Type": "eyeLeft"
},
{
"Y": 0.27957838773727417,
"X": 0.3085327744483948,
"Type": "eyeRight"
如何将这些人脸提取为图像并将它们转储到 s3 存储桶中?
谢谢