阅读本文,您可以获取 Java SDK 离线画质评估的接口调用示例,实现快速开发。
调用接口前,请先完成 Java SDK 的安装及初始化操作。
本节为您介绍离线画质评估相关接口的功能和调用示例。
您可以调用 CreateImageAnalyzeTask 接口在指定服务下创建一条离线评估任务。详细的参数说明可参见 CreateImageAnalyzeTask 接口文档。
接口调用示例如下所示。
package com.volcengine.example.imagex.v2.api; import com.volcengine.model.imagex.v2.*; import com.volcengine.service.imagex.v2.ImagexService; public class CreateImageAnalyzeTaskExample { public static void main(String[] args) { ImagexService service = ImagexService.getInstance(); service.setAccessKey("ak"); service.setSecretKey("sk"); CreateImageAnalyzeTaskBody body = new CreateImageAnalyzeTaskBody(); try { CreateImageAnalyzeTaskRes resp = service.createImageAnalyzeTask(body); System.out.println(resp); } catch (Exception e) { e.printStackTrace(); } } }
您可以调用 UpdateImageAnalyzeTask 接口更新指定离线评估任务的配置。详细的参数说明可参见 UpdateImageAnalyzeTask 接口文档。
接口调用示例如下所示。
package com.volcengine.example.imagex.v2.api; import com.volcengine.model.imagex.v2.*; import com.volcengine.service.imagex.v2.ImagexService; public class UpdateImageAnalyzeTaskExample { public static void main(String[] args) { ImagexService service = ImagexService.getInstance(); service.setAccessKey("ak"); service.setSecretKey("sk"); UpdateImageAnalyzeTaskBody body = new UpdateImageAnalyzeTaskBody(); try { UpdateImageAnalyzeTaskRes resp = service.updateImageAnalyzeTask(body); System.out.println(resp); } catch (Exception e) { e.printStackTrace(); } } }
您可以调用 DeleteImageAnalyzeTask 接口删除一个指定的评估任务。详细的参数说明可参见 DeleteImageAnalyzeTask 接口文档。
接口调用示例如下所示。
package com.volcengine.example.imagex.v2.api; import com.volcengine.model.imagex.v2.*; import com.volcengine.service.imagex.v2.ImagexService; public class DeleteImageAnalyzeTaskExample { public static void main(String[] args) { ImagexService service = ImagexService.getInstance(); service.setAccessKey("ak"); service.setSecretKey("sk"); DeleteImageAnalyzeTaskBody body = new DeleteImageAnalyzeTaskBody(); try { DeleteImageAnalyzeTaskRes resp = service.deleteImageAnalyzeTask(body); System.out.println(resp); } catch (Exception e) { e.printStackTrace(); } } }
您可以调用 GetImageAnalyzeTasks 接口分页查询账号下已创建的所有离线评估任务列表。详细的参数说明可参见 GetImageAnalyzeTasks 接口文档。
接口调用示例如下所示。
package com.volcengine.example.imagex.v2.api; import com.volcengine.model.imagex.v2.*; import com.volcengine.service.imagex.v2.ImagexService; public class GetImageAnalyzeTasksExample { public static void main(String[] args) { ImagexService service = ImagexService.getInstance(); service.setAccessKey("ak"); service.setSecretKey("sk"); GetImageAnalyzeTasksQuery query = new GetImageAnalyzeTasksQuery(); try { GetImageAnalyzeTasksRes resp = service.getImageAnalyzeTasks(query); System.out.println(resp); } catch (Exception e) { e.printStackTrace(); } } }
您可以调用 DeleteImageAnalyzeTaskRun 接口删除指定离线评估任务的某条执行记录。详细的参数说明可参见 DeleteImageAnalyzeTaskRun 接口文档。
接口调用示例如下所示。
package com.volcengine.example.imagex.v2.api; import com.volcengine.model.imagex.v2.*; import com.volcengine.service.imagex.v2.ImagexService; public class DeleteImageAnalyzeTaskRunExample { public static void main(String[] args) { ImagexService service = ImagexService.getInstance(); service.setAccessKey("ak"); service.setSecretKey("sk"); DeleteImageAnalyzeTaskRunBody body = new DeleteImageAnalyzeTaskRunBody(); try { DeleteImageAnalyzeTaskRunRes resp = service.deleteImageAnalyzeTaskRun(body); System.out.println(resp); } catch (Exception e) { e.printStackTrace(); } } }
您可以调用 GetImageAnalyzeResult 接口获取指定离线评估任务结果。详细的参数说明可参见 GetImageAnalyzeResult 接口文档。
接口调用示例如下所示。
package com.volcengine.example.imagex.v2.api; import com.volcengine.model.imagex.v2.*; import com.volcengine.service.imagex.v2.ImagexService; public class GetImageAnalyzeResultExample { public static void main(String[] args) { ImagexService service = ImagexService.getInstance(); service.setAccessKey("ak"); service.setSecretKey("sk"); GetImageAnalyzeResultQuery query = new GetImageAnalyzeResultQuery(); try { GetImageAnalyzeResultRes resp = service.getImageAnalyzeResult(query); System.out.println(resp); } catch (Exception e) { e.printStackTrace(); } } }
您可以调用 UpdateImageAnalyzeTaskStatus 接口更新指定的离线画质任务状态。详细的参数说明可参见 UpdateImageAnalyzeTaskStatus 接口文档。
接口调用示例如下所示。
package com.volcengine.example.imagex.v2.api; import com.volcengine.model.imagex.v2.*; import com.volcengine.service.imagex.v2.ImagexService; public class UpdateImageAnalyzeTaskStatusExample { public static void main(String[] args) { ImagexService service = ImagexService.getInstance(); service.setAccessKey("ak"); service.setSecretKey("sk"); UpdateImageAnalyzeTaskStatusBody body = new UpdateImageAnalyzeTaskStatusBody(); try { UpdateImageAnalyzeTaskStatusRes resp = service.updateImageAnalyzeTaskStatus(body); System.out.println(resp); } catch (Exception e) { e.printStackTrace(); } } }