我的模型定义中包含以下代码
......
const bucketName = "myBucket";
const baseObject = "uploads/";
let defaults = {
// Your SECRET ACCESS KEY from AWS should go here,
// Never share it!
// Setup Env Variable, e.g: process.env.SECRET_ACCESS_KEY
secretAccessKey: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
// Not working key, Your ACCESS KEY ID from AWS should go here,
// Never share it!
// Setup Env Variable, e.g: process.env.ACCESS_KEY_ID
accessKeyId: "xxxxxxxxxxxxxxxx",
region: "us-east-1", // region of your bucket
// region: "us-west-2", // region of your bucket
Bucket: bucketName,
};
let settings = Object.assign({}, defaults, options); // values in options override values in defaults
// console.log(settings); // Object {key1: "value1", key2: "default2", key3: "defaults3"}
aws.config.update(settings);
// Create name for uploaded object key
var keyName =`${baseObject}${options.keyName}${Date.now().toString()}`;
const base64StringData = options.body;
let imageBody = base64StringData.replace(/^data:image\/\w+;base64,/, "");
// Getting the file type, ie: jpeg, png or gif
const type = base64StringData.split(";")[0].split("/")[1];
let buffer = new Buffer(imageBody, "base64");
let objectParams = {
Bucket: bucketName,
Key: `${keyName}.${type}`,
ACL: "public-read",
Body: buffer,
ContentEncoding: "base64",
ContentType: `image/${type}`,
ContentLength: buffer.length,
};
console.log(objectParams);
const s3 = new aws.S3();
await s3.putObject(objectParams)
......
在模型摘要中,它被视为
$sth->bindValue(':veh_model', $model2, **PDO::PARAM_INT**);
是否可以为该层命名而不是# (None, 6) -> (None, 8)
def affine_to_projective(x):
y = tf.pad(x,
paddings=tf.constant([[0, 0], [0, 2]]),
mode='CONSTANT',
constant_values=0
)
return y
projective_transform = Lambda(affine_to_projective)(affine_transform)
?
答案 0 :(得分:1)
projective_transform = Lambda(affine_to_projective, name='lambda_name')(affine_transform)