1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
package com.iailab.netsdk.lib.enumeration;
 
/**
 * @author 260611
 * @description 特征建模失败错误码
 * @origin autoTool
 * @date 2023/06/28 14:07:32
 */
public enum EM_FEATURE_ERROR_CODE {
    /**
     * 成功
     */
    EM_FEATURE_ERROR_SUCCESS(0,"成功"),
    /**
     * 未知
     */
    EM_FEATURE_ERROR_UNKNOWN(1,"未知"),
    /**
     * 图片格式问题
     */
    EM_FEATURE_ERROR_IMAGE_FORMAT_ERROR(2,"图片格式问题"),
    /**
     * 无目标或不够清晰
     */
    EM_FEATURE_ERROR_NOFACE_OR_NOTCLEAR(3,"无目标或不够清晰"),
    /**
     * 多个目标
     */
    EM_FEATURE_ERROR_MULT_FACES(4,"多个目标"),
    /**
     * 图片解码失败
     */
    EM_FEATURE_ERROR_IMAGH_DECODE_FAILED(5,"图片解码失败"),
    /**
     * 不推荐入库
     */
    EM_FEATURE_ERROR_NOT_SUGGEST_STORAGE(6,"不推荐入库"),
    /**
     * 数据库操作失败
     */
    EM_FEATURE_ERROR_DATABASE_OPERATE_FAILED(7,"数据库操作失败"),
    /**
     * 获取图片失败
     */
    EM_FEATURE_ERROR_GET_IMAGE_FAILED(8,"获取图片失败"),
    /**
     * 系统异常(如Licence失效、建模分析器未启动导致的失败)
     */
    EM_FEATURE_ERROR_SYSTEM_EXCEPTION(9,"系统异常(如Licence失效、建模分析器未启动导致的失败)"),
    /**
     * 目标宽度过小
     */
    EM_FEATURE_ERROR_UNDERSIZED_WIDTH(10,"目标宽度过小"),
    /**
     * 目标眼瞳间距过小
     */
    EM_FEATURE_ERROR_UNDERSIZED_INTERPUPILLARY_DISTANCE(11,"目标眼瞳间距过小"),
    /**
     * 目标脸对齐分数过低
     */
    EM_FEATURE_ERROR_FACE_ALIGNMENT_SCORE_LOW(12,"目标脸对齐分数过低"),
    /**
     * 目标俯仰角过大
     */
    EM_FEATURE_ERROR_OVERSIZED_FACE_PITCH_ANGLE(13,"目标俯仰角过大"),
    /**
     * 目标偏航角过大
     */
    EM_FEATURE_ERROR_OVERSIZED_FACE_YAW_ANGLE(14,"目标偏航角过大"),
    /**
     * 目标滚转角过大
     */
    EM_FEATURE_ERROR_OVERSIZED_FACE_ROLL_ANGLE(15,"目标滚转角过大"),
    /**
     * 目标质量分过低
     */
    EM_FEATURE_ERROR_FACE_QUALITY_LOW(16,"目标质量分过低"),
    /**
     * 目标清晰度过低
     */
    EM_FEATURE_ERROR_FACE_DEFINITION_LOW(17,"目标清晰度过低"),
    /**
     * 目标眼部遮挡
     */
    EM_FEATURE_ERROR_EYE_OCCLUSION(18,"目标眼部遮挡"),
    /**
     * 目标额头遮挡
     */
    EM_FEATURE_ERROR_FOREHEAD_OCCLUSION(19,"目标额头遮挡"),
    /**
     * 目标嘴巴遮挡
     */
    EM_FEATURE_ERROR_MOUTH_OCCLUSION(20,"目标嘴巴遮挡"),
    /**
     * 目标不完整
     */
    EM_FEATURE_ERROR_INCOMPLETE_FACE(21,"目标不完整"),
    /**
     * 目标光照过曝或者欠曝
     */
    EM_FEATURE_ERROR_ABNORMAL_FACE_EXPOSURE(22,"目标光照过曝或者欠曝"),
    /**
     * 目标饱和度过低
     */
    EM_FEATURE_ERROR_FACE_SATURATION_LOW(23,"目标饱和度过低"),
    /**
     * 目标区域在图像中占比过大
     */
    EM_FEATURE_ERROR_FACE_AREA_OVER_PROPORTION(24,"目标区域在图像中占比过大"),
    /**
     * 图像中未检出目标
     */
    EM_FEATURE_ERROR_FACE_DETECTION_FAILE(25,"图像中未检出目标");
 
    private int value;
 
    private String note;
 
    public String getNote() {
        return note;
    }
 
    public int getValue() {
        return value;
    }
 
    EM_FEATURE_ERROR_CODE(int givenValue, String note) {
        this.value = givenValue;
        this.note = note;
    }
 
    public static String getNoteByValue(int givenValue) {
        for (EM_FEATURE_ERROR_CODE enumType : EM_FEATURE_ERROR_CODE.values()) {
            if (givenValue == enumType.getValue()) {
                return enumType.getNote();
            }
        }
        return null;
    }
 
    public static int getValueByNote(String givenNote) {
        for (EM_FEATURE_ERROR_CODE enumType : EM_FEATURE_ERROR_CODE.values()) {
            if (givenNote.equals(enumType.getNote())) {
                return enumType.getValue();
            }
        }
        return -1;
    }
 
    public static EM_FEATURE_ERROR_CODE getEnum(int value) {
        for (EM_FEATURE_ERROR_CODE e : EM_FEATURE_ERROR_CODE.values()) {
            if (e.getValue() == value) {
                return e;
            }
        }
        return EM_FEATURE_ERROR_CODE.EM_FEATURE_ERROR_SUCCESS;
    }
 
}