开发者社区 > 视觉智能 > 正文

视觉智能平台视频人像增强的签名;这个参数在API文档中没找到,应该填什么日期的版本?

视觉智能平台视频人像增强的签名params.put("Version", "2019-09-30");这个参数在API文档中没找到,应该填什么日期的版本?

展开
收起
真的很搞笑 2023-06-11 19:54:43 97 0
2 条回答
写回答
取消 提交回答
  • 从事java行业9年至今,热爱技术,热爱以博文记录日常工作,csdn博主,座右铭是:让技术不再枯燥,让每一位技术人爱上技术

    您好,视觉智能开放平台人像增强的版本号建议可以填2020-03-20尝试,根据示例代码可以看出来

    // 引入依赖包
    // 最低SDK版本要求:videoenhan20200320的SDK版本需大于等于2.0.14。
    // 可以在此仓库地址中引用最新版本SDK:https://mvnrepository.com/artifact/com.aliyun/videoenhan20200320
    // <dependency>
    //       <groupId>com.aliyun</groupId>
    //       <artifactId>videoenhan20200320</artifactId>
    //       <version>${aliyun.videoenhan.version}</version>
    // </dependency>
    
    import com.aliyun.tea.TeaException;
    import com.aliyun.tea.TeaModel;
    import com.aliyun.videoenhan20200320.models.EnhancePortraitVideoResponse;
    
    public class EnhancePortraitVideo {
    
        public static com.aliyun.videoenhan20200320.Client createClient(String accessKeyId, String accessKeySecret) throws Exception {
            /*
              初始化配置对象com.aliyun.teaopenapi.models.Config
              Config对象存放 AccessKeyId、AccessKeySecret、endpoint等配置
             */
             com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config()
                    .setAccessKeyId(accessKeyId)
                    .setAccessKeySecret(accessKeySecret);
            // 访问的域名
            config.endpoint = "videoenhan.cn-shanghai.aliyuncs.com";
            return new com.aliyun.videoenhan20200320.Client(config);
        }
    
        public static void main(String[] args) throws Exception {
            // 创建AccessKey ID和AccessKey Secret,请参见:https://help.aliyun.com/document_detail/175144.html
            // 如果您使用的是RAM用户的AccessKey,还需要为子账号授予权限AliyunVIAPIFullAccess,请参见:https://help.aliyun.com/document_detail/145025.html
            // 从环境变量读取配置的AccessKey ID和AccessKey Secret。运行代码示例前必须先配置环境变量。
            String accessKeyId = System.getenv("ALIBABA_CLOUD_ACCESS_KEY_ID");
            String accessKeySecret = System.getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET"); 
            com.aliyun.videoenhan20200320.Client client = EnhancePortraitVideo.createClient(accessKeyId, accessKeySecret);
            com.aliyun.videoenhan20200320.models.EnhancePortraitVideoRequest enhancePortraitVideoRequest = new com.aliyun.videoenhan20200320.models.EnhancePortraitVideoRequest()
                    .setVideoUrl("http://viapi-test.oss-cn-shanghai.aliyuncs.com/viapi-3.0domepic/videoenhan/SuperResolveVideo/SuperResolveVideo5.mp4");
            com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
            try {
                // 复制代码运行请自行打印 API 的返回值
                EnhancePortraitVideoResponse response = client.enhancePortraitVideoWithOptions(enhancePortraitVideoRequest, runtime);
                System.out.println(com.aliyun.teautil.Common.toJSONString(TeaModel.buildMap(response)));
            } catch (TeaException error) {
                // 获取整体报错信息
                System.out.println(com.aliyun.teautil.Common.toJSONString(error));
                // 获取单个字段
                System.out.println(error.getCode());
            }
        }
    }
    
    2023-06-13 10:13:37
    赞同 展开评论 打赏
  • 723df616992fb91022881a4be3792353.png ,此回答整理自钉群“阿里云视觉智能开放平台咨询1群”

    2023-06-11 20:31:55
    赞同 展开评论 打赏

为开发者提供高易用、普惠的视觉API服务,帮助企业快速建立视觉智能技术应用能力的综合性视觉AI能力平台。适用于数字营销、互联网娱乐、安防、手机应用、泛金融身份认证等行业。

相关产品

  • 视觉智能开放平台
  • 热门讨论

    热门文章

    相关电子书

    更多
    Spring Boot2.0实战Redis分布式缓存 立即下载
    CUDA MATH API 立即下载
    API PLAYBOOK 立即下载