From 2590db882be89c43eb6bb11288a8201ac553ab3a Mon Sep 17 00:00:00 2001 From: sdk-team Date: Tue, 14 Nov 2023 06:38:34 +0000 Subject: [PATCH] Release DeepfakeFace. --- aliyun-java-sdk-facebody/ChangeLog.txt | 3 + aliyun-java-sdk-facebody/pom.xml | 2 +- .../model/v20191230/DeepfakeFaceRequest.java | 83 ++++++++ .../model/v20191230/DeepfakeFaceResponse.java | 199 ++++++++++++++++++ .../DeepfakeFaceResponseUnmarshaller.java | 68 ++++++ 5 files changed, 354 insertions(+), 1 deletion(-) create mode 100644 aliyun-java-sdk-facebody/src/main/java/com/aliyuncs/facebody/model/v20191230/DeepfakeFaceRequest.java create mode 100644 aliyun-java-sdk-facebody/src/main/java/com/aliyuncs/facebody/model/v20191230/DeepfakeFaceResponse.java create mode 100644 aliyun-java-sdk-facebody/src/main/java/com/aliyuncs/facebody/transform/v20191230/DeepfakeFaceResponseUnmarshaller.java diff --git a/aliyun-java-sdk-facebody/ChangeLog.txt b/aliyun-java-sdk-facebody/ChangeLog.txt index fca841ff05..ace0fb933e 100644 --- a/aliyun-java-sdk-facebody/ChangeLog.txt +++ b/aliyun-java-sdk-facebody/ChangeLog.txt @@ -1,3 +1,6 @@ +2023-11-14 Version: 2.0.12 +- Release DeepfakeFace. + 2023-10-10 Version: 2.0.11 - Update MergeImageFace. diff --git a/aliyun-java-sdk-facebody/pom.xml b/aliyun-java-sdk-facebody/pom.xml index 88ee5d1f22..bd1e225a39 100644 --- a/aliyun-java-sdk-facebody/pom.xml +++ b/aliyun-java-sdk-facebody/pom.xml @@ -4,7 +4,7 @@ com.aliyun aliyun-java-sdk-facebody jar - 2.0.11 + 2.0.12 aliyun-java-sdk-facebody http://www.aliyun.com Aliyun Open API SDK for Java diff --git a/aliyun-java-sdk-facebody/src/main/java/com/aliyuncs/facebody/model/v20191230/DeepfakeFaceRequest.java b/aliyun-java-sdk-facebody/src/main/java/com/aliyuncs/facebody/model/v20191230/DeepfakeFaceRequest.java new file mode 100644 index 0000000000..53fb45b234 --- /dev/null +++ b/aliyun-java-sdk-facebody/src/main/java/com/aliyuncs/facebody/model/v20191230/DeepfakeFaceRequest.java @@ -0,0 +1,83 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.aliyuncs.facebody.model.v20191230; + +import com.aliyuncs.RpcAcsRequest; +import java.util.List; +import com.aliyuncs.http.ProtocolType; +import com.aliyuncs.http.MethodType; +import com.aliyuncs.facebody.Endpoint; + +/** + * @author auto create + * @version + */ +public class DeepfakeFaceRequest extends RpcAcsRequest { + + + private List taskss; + public DeepfakeFaceRequest() { + super("facebody", "2019-12-30", "DeepfakeFace", "facebody"); + setProtocol(ProtocolType.HTTPS); + setMethod(MethodType.POST); + try { + com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); + com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); + } catch (Exception e) {} + } + + public List getTaskss() { + return this.taskss; + } + + public void setTaskss(List taskss) { + this.taskss = taskss; + if (taskss != null) { + for (int depth1 = 0; depth1 < taskss.size(); depth1++) { + putBodyParameter("Tasks." + (depth1 + 1) + ".ImageURL" , taskss.get(depth1).getImageURL()); + putBodyParameter("Tasks." + (depth1 + 1) + ".ImageData" , taskss.get(depth1).getImageData()); + } + } + } + + public static class Tasks { + + private String imageURL; + + private String imageData; + + public String getImageURL() { + return this.imageURL; + } + + public void setImageURL(String imageURL) { + this.imageURL = imageURL; + } + + public String getImageData() { + return this.imageData; + } + + public void setImageData(String imageData) { + this.imageData = imageData; + } + } + + @Override + public Class getResponseClass() { + return DeepfakeFaceResponse.class; + } + +} diff --git a/aliyun-java-sdk-facebody/src/main/java/com/aliyuncs/facebody/model/v20191230/DeepfakeFaceResponse.java b/aliyun-java-sdk-facebody/src/main/java/com/aliyuncs/facebody/model/v20191230/DeepfakeFaceResponse.java new file mode 100644 index 0000000000..49b0b29b7e --- /dev/null +++ b/aliyun-java-sdk-facebody/src/main/java/com/aliyuncs/facebody/model/v20191230/DeepfakeFaceResponse.java @@ -0,0 +1,199 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.aliyuncs.facebody.model.v20191230; + +import java.util.List; +import com.aliyuncs.AcsResponse; +import com.aliyuncs.facebody.transform.v20191230.DeepfakeFaceResponseUnmarshaller; +import com.aliyuncs.transform.UnmarshallerContext; + +/** + * @author auto create + * @version + */ +public class DeepfakeFaceResponse extends AcsResponse { + + private String requestId; + + private Data data; + + public String getRequestId() { + return this.requestId; + } + + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public Data getData() { + return this.data; + } + + public void setData(Data data) { + this.data = data; + } + + public static class Data { + + private List elements; + + public List getElements() { + return this.elements; + } + + public void setElements(List elements) { + this.elements = elements; + } + + public static class Element { + + private String imageURL; + + private String taskId; + + private Long faceNumber; + + private List results; + + public String getImageURL() { + return this.imageURL; + } + + public void setImageURL(String imageURL) { + this.imageURL = imageURL; + } + + public String getTaskId() { + return this.taskId; + } + + public void setTaskId(String taskId) { + this.taskId = taskId; + } + + public Long getFaceNumber() { + return this.faceNumber; + } + + public void setFaceNumber(Long faceNumber) { + this.faceNumber = faceNumber; + } + + public List getResults() { + return this.results; + } + + public void setResults(List results) { + this.results = results; + } + + public static class Result { + + private String label; + + private Float confidence; + + private String messageTips; + + private Rect rect; + + public String getLabel() { + return this.label; + } + + public void setLabel(String label) { + this.label = label; + } + + public Float getConfidence() { + return this.confidence; + } + + public void setConfidence(Float confidence) { + this.confidence = confidence; + } + + public String getMessageTips() { + return this.messageTips; + } + + public void setMessageTips(String messageTips) { + this.messageTips = messageTips; + } + + public Rect getRect() { + return this.rect; + } + + public void setRect(Rect rect) { + this.rect = rect; + } + + public static class Rect { + + private Long left; + + private Long top; + + private Long width; + + private Long height; + + public Long getLeft() { + return this.left; + } + + public void setLeft(Long left) { + this.left = left; + } + + public Long getTop() { + return this.top; + } + + public void setTop(Long top) { + this.top = top; + } + + public Long getWidth() { + return this.width; + } + + public void setWidth(Long width) { + this.width = width; + } + + public Long getHeight() { + return this.height; + } + + public void setHeight(Long height) { + this.height = height; + } + } + } + } + } + + @Override + public DeepfakeFaceResponse getInstance(UnmarshallerContext context) { + return DeepfakeFaceResponseUnmarshaller.unmarshall(this, context); + } + + @Override + public boolean checkShowJsonItemName() { + return false; + } +} diff --git a/aliyun-java-sdk-facebody/src/main/java/com/aliyuncs/facebody/transform/v20191230/DeepfakeFaceResponseUnmarshaller.java b/aliyun-java-sdk-facebody/src/main/java/com/aliyuncs/facebody/transform/v20191230/DeepfakeFaceResponseUnmarshaller.java new file mode 100644 index 0000000000..5314c30fdb --- /dev/null +++ b/aliyun-java-sdk-facebody/src/main/java/com/aliyuncs/facebody/transform/v20191230/DeepfakeFaceResponseUnmarshaller.java @@ -0,0 +1,68 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.aliyuncs.facebody.transform.v20191230; + +import java.util.ArrayList; +import java.util.List; + +import com.aliyuncs.facebody.model.v20191230.DeepfakeFaceResponse; +import com.aliyuncs.facebody.model.v20191230.DeepfakeFaceResponse.Data; +import com.aliyuncs.facebody.model.v20191230.DeepfakeFaceResponse.Data.Element; +import com.aliyuncs.facebody.model.v20191230.DeepfakeFaceResponse.Data.Element.Result; +import com.aliyuncs.facebody.model.v20191230.DeepfakeFaceResponse.Data.Element.Result.Rect; +import com.aliyuncs.transform.UnmarshallerContext; + + +public class DeepfakeFaceResponseUnmarshaller { + + public static DeepfakeFaceResponse unmarshall(DeepfakeFaceResponse deepfakeFaceResponse, UnmarshallerContext _ctx) { + + deepfakeFaceResponse.setRequestId(_ctx.stringValue("DeepfakeFaceResponse.RequestId")); + + Data data = new Data(); + + List elements = new ArrayList(); + for (int i = 0; i < _ctx.lengthValue("DeepfakeFaceResponse.Data.Elements.Length"); i++) { + Element element = new Element(); + element.setImageURL(_ctx.stringValue("DeepfakeFaceResponse.Data.Elements["+ i +"].ImageURL")); + element.setTaskId(_ctx.stringValue("DeepfakeFaceResponse.Data.Elements["+ i +"].TaskId")); + element.setFaceNumber(_ctx.longValue("DeepfakeFaceResponse.Data.Elements["+ i +"].FaceNumber")); + + List results = new ArrayList(); + for (int j = 0; j < _ctx.lengthValue("DeepfakeFaceResponse.Data.Elements["+ i +"].Results.Length"); j++) { + Result result = new Result(); + result.setLabel(_ctx.stringValue("DeepfakeFaceResponse.Data.Elements["+ i +"].Results["+ j +"].Label")); + result.setConfidence(_ctx.floatValue("DeepfakeFaceResponse.Data.Elements["+ i +"].Results["+ j +"].Confidence")); + result.setMessageTips(_ctx.stringValue("DeepfakeFaceResponse.Data.Elements["+ i +"].Results["+ j +"].MessageTips")); + + Rect rect = new Rect(); + rect.setLeft(_ctx.longValue("DeepfakeFaceResponse.Data.Elements["+ i +"].Results["+ j +"].Rect.Left")); + rect.setTop(_ctx.longValue("DeepfakeFaceResponse.Data.Elements["+ i +"].Results["+ j +"].Rect.Top")); + rect.setWidth(_ctx.longValue("DeepfakeFaceResponse.Data.Elements["+ i +"].Results["+ j +"].Rect.Width")); + rect.setHeight(_ctx.longValue("DeepfakeFaceResponse.Data.Elements["+ i +"].Results["+ j +"].Rect.Height")); + result.setRect(rect); + + results.add(result); + } + element.setResults(results); + + elements.add(element); + } + data.setElements(elements); + deepfakeFaceResponse.setData(data); + + return deepfakeFaceResponse; + } +} \ No newline at end of file