资讯 社区 文档
技术能力
语音技术
文字识别
人脸与人体
图像技术
语言与知识
视频技术

接口说明(新版)

图像特效

黑白图像上色

SDK 调用示例

public void sample(AipImageProcess client) {
    // 传入可选参数调用接口
    HashMap<String, String> options = new HashMap<String, String>();
    
    // 参数为本地路径
    String image = "test.jpg";
    JSONObject res = client.colourize(image, options);
    System.out.println(res.toString(2));

    // 参数为二进制数组
    byte[] file = readFile("test.jpg");
    res = client.colourize(file, options);
    System.out.println(res.toString(2));
}

接口详情

可参考API文档:黑白图像上色

图像风格转换

SDK 调用示例

public void sample(AipImageProcess client) {
    // 传入可选参数调用接口
    HashMap<String, String> options = new HashMap<String, String>();
    
    """ 如果有可选参数 """
    options.put("option", "cartoon");

    // 参数为本地路径
    String image = "test.jpg";
    JSONObject res = client.styleTrans(image, options);
    System.out.println(res.toString(2));

    // 参数为二进制数组
    byte[] file = readFile("test.jpg");
    res = client.styleTrans(file, options);
    System.out.println(res.toString(2));
}

接口详情

可参考API文档:图像风格转换

人像动漫化

SDK 调用示例

public void sample(AipImageProcess client) {
    // 传入可选参数调用接口
    HashMap<String, String> options = new HashMap<String, String>();
    
    """ 如果有可选参数 """
    options.put("type", "anime");
    options.put("mask_id", 3);

    // 参数为本地路径
    String image = "test.jpg";
    JSONObject res = client.selfieAnime(image, options);
    System.out.println(res.toString(2));

    // 参数为二进制数组
    byte[] file = readFile("test.jpg");
    res = client.selfieAnime(file, options);
    System.out.println(res.toString(2));
}

接口详情

可参考API文档:人像动漫化

图像增强

图像去雾

SDK 调用示例

public void sample(AipImageProcess client) {
    // 传入可选参数调用接口
    HashMap<String, String> options = new HashMap<String, String>();
    
    // 参数为本地路径
    String image = "test.jpg";
    JSONObject res = client.dehaze(image, options);
    System.out.println(res.toString(2));

    // 参数为二进制数组
    byte[] file = readFile("test.jpg");
    res = client.dehaze(file, options);
    System.out.println(res.toString(2));
}

接口详情

可参考API文档:图像去雾

图像对比度增强

SDK 调用示例

public void sample(AipImageProcess client) {
    // 传入可选参数调用接口
    HashMap<String, String> options = new HashMap<String, String>();
    
    // 参数为本地路径
    String image = "test.jpg";
    JSONObject res = client.contrastEnhance(image, options);
    System.out.println(res.toString(2));

    // 参数为二进制数组
    byte[] file = readFile("test.jpg");
    res = client.contrastEnhance(file, options);
    System.out.println(res.toString(2));
}

接口详情

可参考API文档:图像对比度增强

图像无损放大

SDK 调用示例

public void sample(AipImageProcess client) {
    // 传入可选参数调用接口
    HashMap<String, String> options = new HashMap<String, String>();
    
    // 参数为本地路径
    String image = "test.jpg";
    JSONObject res = client.imageQualityEnhance(image, options);
    System.out.println(res.toString(2));

    // 参数为二进制数组
    byte[] file = readFile("test.jpg");
    res = client.imageQualityEnhance(file, options);
    System.out.println(res.toString(2));
}

接口详情

可参考API文档:图像无损放大

拉伸图像恢复

SDK 调用示例

public void sample(AipImageProcess client) {
    // 传入可选参数调用接口
    HashMap<String, String> options = new HashMap<String, String>();
    
    
    // 参数为本地路径
    String image = "test.jpg";
    JSONObject res = client.stretchRestore(image, options);
    System.out.println(res.toString(2));

    // 参数为二进制数组
    byte[] file = readFile("test.jpg");
    res = client.stretchRestore(file, options);
    System.out.println(res.toString(2));
}

接口详情

可参考API文档:拉伸图像恢复

图像修复

SDK 调用示例

 public void sample(AipImageProcess client) {
   // 传入可选参数调用接口
   HashMap<String, String> options = new HashMap<String, String>();
   // [{'width': 92, 'top': 25, 'height': 36, 'left': 543}]
   JSONObject jsonObject = new JSONObject();
   jsonObject.put("width",1);
   jsonObject.put("top",1);
   jsonObject.put("height",1);
   jsonObject.put("left",1);
   List<JSONObject> rectangle = new ArrayList<JSONObject>();
   rectangle.add(jsonObject);
   // 参数为本地路径
   String image = "test.jpg";
   JSONObject res = client.inpaintingByMask(image, rectangle, options);
   System.out.println(res.toString(2));

   // 参数为二进制数组
   byte[] file = readFile("test.jpg");
   res = client.inpaintingByMask(file, rectangle, options);
   System.out.println(res.toString(2));
}

接口详情

可参考API文档:图像修复

图像清晰度增强

SDK 调用示例

public void sample(AipImageProcess client) {
    // 传入可选参数调用接口
    HashMap<String, String> options = new HashMap<String, String>();
    
    // 参数为本地路径
    String image = "test.jpg";
    JSONObject res = client.imageDefinitionEnhance(image, options);
    System.out.println(res.toString(2));

    // 参数为二进制数组
    byte[] file = readFile("test.jpg");
    res = client.imageDefinitionEnhance(file, options);
    System.out.println(res.toString(2));
}

接口详情

可参考API文档:图像清晰度增强

图像色彩增强

SDK 调用示例

public void sample(AipImageProcess client) {
    // 传入可选参数调用接口
    HashMap<String, String> options = new HashMap<String, String>();

    // 参数为本地路径
    String image = "test.jpg";
    JSONObject res = client.colorEnhance(image, options);
    System.out.println(res.toString(2));

    // 参数为二进制数组
    byte[] file = readFile("test.jpg");
    res = client.colorEnhance(file, options);
    System.out.println(res.toString(2));
  
  	// 参数为url
    String url = "http://image";
    res = client.colorEnhanceUrl(url, options);
    System.out.println(res.toString(2));
}

接口详情

可参考API文档:图像色彩增强

历史版本

天空分割

SDK 调用示例

public void sample(AipImageProcess client) {
    // 传入可选参数调用接口
    HashMap<String, String> options = new HashMap<String, String>();
    
    // 参数为本地路径
    String image = "test.jpg";
    JSONObject res = client.skySeg(image, options);
    System.out.println(res.toString(2));

    // 参数为二进制数组
    byte[] file = readFile("test.jpg");
    res = client.skySeg(file, options);
    System.out.println(res.toString(2));
}

接口详情

可参考API文档:天空分割

上一篇
快速入门
下一篇
错误信息