TASK: 新增pose transfer模特姿势选项
This commit is contained in:
72
src/main/java/com/ai/da/common/enums/PoseEnum.java
Normal file
72
src/main/java/com/ai/da/common/enums/PoseEnum.java
Normal file
@@ -0,0 +1,72 @@
|
||||
package com.ai.da.common.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum PoseEnum {
|
||||
|
||||
POSE_1(1L, "aida-sys-image/pose/pose-1.mp4", "aida-sys-image/pose/pose-1.gif", "aida-sys-image/pose/pose-1-first_frame.jpeg", "AACT.8090e67b.-E3pujumEfCbDTI_rjSH-A.LwIlGT3j"),
|
||||
POSE_2(2L, "aida-sys-image/pose/pose-2.mp4", "aida-sys-image/pose/pose-2.gif", "aida-sys-image/pose/pose-2-first_frame.jpeg", "AACT.8090e67b.TwJLxEv3EfCbDTI_rjSH-A.IOQZCYhf"),
|
||||
POSE_3(3L, "aida-sys-image/pose/pose-3.mp4", "aida-sys-image/pose/pose-3.gif", "aida-sys-image/pose/pose-3-first_frame.jpeg", "AACT.8090e67b.gd3OCkv4EfCxyZo8eQGF2Q.qMm-a1XI"),
|
||||
POSE_4(4L, "aida-sys-image/pose/pose-4.mp4", "aida-sys-image/pose/pose-4.gif", "aida-sys-image/pose/pose-4-first_frame.jpeg", "AACT.8090e67b.AUDnuEwDEfCEHBaRJeW4dg.rlx36xEY"),
|
||||
POSE_5(5L, "aida-sys-image/pose/pose-5.mp4", "aida-sys-image/pose/pose-5.gif", "aida-sys-image/pose/pose-5-first_frame.jpeg", "AACT.8090e67b.G8BvkEwEEfCxyZo8eQGF2Q.fo4ryrgR"),
|
||||
POSE_6(6L, "aida-sys-image/pose/pose-6.mp4", "aida-sys-image/pose/pose-6.gif", "aida-sys-image/pose/pose-6-first_frame.jpeg", "AACT.8090e67b.yBIPnEwEEfCxyZo8eQGF2Q.boSFwTG9");
|
||||
|
||||
|
||||
private final Long id;
|
||||
|
||||
private final String videoPath;
|
||||
|
||||
private final String gifPath;
|
||||
|
||||
private final String firstFramePath;
|
||||
|
||||
private final String templateId;
|
||||
|
||||
private static final List<Map<String, String>> PROPERTY_LIST;
|
||||
|
||||
static {
|
||||
PROPERTY_LIST = Arrays.stream(values())
|
||||
.map(PoseEnum::toMap)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private static final Map<Long, PoseEnum> BY_ID = Arrays.stream(values())
|
||||
.collect(Collectors.toMap(PoseEnum::getId, Function.identity()));
|
||||
|
||||
private static final Map<String, PoseEnum> BY_VIDEO_PATH = Arrays.stream(values())
|
||||
.collect(Collectors.toMap(PoseEnum::getVideoPath, Function.identity()));
|
||||
|
||||
private static final List<String> VIDEO_PATH = Arrays.stream(values())
|
||||
.map(PoseEnum::getVideoPath).collect(Collectors.toList());
|
||||
|
||||
public static PoseEnum getById(Long id) {
|
||||
return BY_ID.get(id);
|
||||
}
|
||||
|
||||
public static PoseEnum getByVideoPath(String videoPath) {
|
||||
return BY_VIDEO_PATH.get(videoPath);
|
||||
}
|
||||
|
||||
private Map<String, String> toMap() {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("id", String.valueOf(id));
|
||||
map.put("gif", gifPath);
|
||||
map.put("firstFrame", firstFramePath);
|
||||
return map;
|
||||
}
|
||||
|
||||
public static List<Map<String, String>> getPropertyList() {
|
||||
return new ArrayList<>(PROPERTY_LIST); // 返回副本以保证不可变性
|
||||
}
|
||||
|
||||
public static List<String> getVideoList() {
|
||||
return new ArrayList<>(VIDEO_PATH); // 返回副本以保证不可变性
|
||||
}
|
||||
}
|
||||
@@ -498,8 +498,6 @@ public class RedisUtil {
|
||||
|
||||
public final static String STRIPE_EXCEPTION_LOG = "StripeException:";
|
||||
|
||||
public final static String ANIMATE_ANYONE_TEMPLATE_ID = "AnimateAnyoneTemplateId:";
|
||||
|
||||
public void batchDeleteKeysWithSamePrefix(String prefix){
|
||||
Set<String> keys = redisTemplate.keys(prefix + "*");
|
||||
assert keys != null;
|
||||
|
||||
Reference in New Issue
Block a user