• 团队冲刺第二阶段8


    今天我们进行相同图的比较

    同样出了岔子,每走一步都出岔子

    public static String SelfieAnime(byte[] file,String savePath,String suffixName) {
    // 请求url
    String url = "https://aip.baidubce.com/rest/2.0/image-process/v1/selfie_anime";
    try {
    byte[] imgData = file;
    String imgStr = Base64Util.encode(imgData);
    String imgParam = URLEncoder.encode(imgStr, "UTF-8");
    
    String param = "image=" + imgParam;
    
    
    String accessToken = AuthService.getAuth("uRN0ZNQEXgoKHOEIWGDX1IQb","yeFNnQlK6RVKGcNXb0RaaCeZVGL63DBo");
    
    JSONObject jsonObject=JSON.parseObject(HttpUtil.post(url, accessToken, param));
    String result=jsonObject.getString("image");
    if (result.equals("")){
    return "result is null";
    }
    BASE64Decoder decoder = new BASE64Decoder();
    OutputStream out = new FileOutputStream(savePath+jsonObject.getString("log_id")+"."+suffixName);
    out.write(Base64Util.decode(decoder.decodeBuffer(result)));
    out.flush();
    out.close();
    return jsonObject.getString("log_id");
    
    } catch (Exception e) {
    e.printStackTrace();
    return "error:e.printStackTrace()";
    }
    }
  • 相关阅读:
    org-mode
    MediaWiki
    Creole
    AsciiDoc
    markdown
    图像对比度调整的simulink仿真总结
    Altera的几个常用的Synthesis attributes(转载)
    红外发送接收电路(转载)
    使用反相器的rc振荡电路
    两个小电路
  • 原文地址:https://www.cnblogs.com/ltw222/p/14916095.html
Copyright © 2020-2023  润新知