Skip to content

Commit

Permalink
Release DeepfakeFace.
Browse files Browse the repository at this point in the history
  • Loading branch information
sdk-team committed Nov 14, 2023
1 parent d08680c commit 2590db8
Show file tree
Hide file tree
Showing 5 changed files with 354 additions and 1 deletion.
3 changes: 3 additions & 0 deletions aliyun-java-sdk-facebody/ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2023-11-14 Version: 2.0.12
- Release DeepfakeFace.

2023-10-10 Version: 2.0.11
- Update MergeImageFace.

Expand Down
2 changes: 1 addition & 1 deletion aliyun-java-sdk-facebody/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-facebody</artifactId>
<packaging>jar</packaging>
<version>2.0.11</version>
<version>2.0.12</version>
<name>aliyun-java-sdk-facebody</name>
<url>http://www.aliyun.com</url>
<description>Aliyun Open API SDK for Java
Expand Down
Original file line number Diff line number Diff line change
@@ -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<DeepfakeFaceResponse> {


private List<Tasks> 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<Tasks> getTaskss() {
return this.taskss;
}

public void setTaskss(List<Tasks> 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<DeepfakeFaceResponse> getResponseClass() {
return DeepfakeFaceResponse.class;
}

}
Original file line number Diff line number Diff line change
@@ -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<Element> elements;

public List<Element> getElements() {
return this.elements;
}

public void setElements(List<Element> elements) {
this.elements = elements;
}

public static class Element {

private String imageURL;

private String taskId;

private Long faceNumber;

private List<Result> 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<Result> getResults() {
return this.results;
}

public void setResults(List<Result> 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;
}
}
Original file line number Diff line number Diff line change
@@ -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<Element> elements = new ArrayList<Element>();
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<Result> results = new ArrayList<Result>();
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;
}
}

0 comments on commit 2590db8

Please sign in to comment.