expression-lab-classroom 1.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- expression_lab/__init__.py +13 -0
- expression_lab/__main__.py +17 -0
- expression_lab/api.py +192 -0
- expression_lab/backend.py +166 -0
- expression_lab/bootstrap.py +36 -0
- expression_lab/cameras.py +172 -0
- expression_lab/core.py +259 -0
- expression_lab/data/images/01_neutral.png +0 -0
- expression_lab/data/images/provenance.json +23 -0
- expression_lab/data/licenses/LibreFace-USC.txt +14 -0
- expression_lab/data/licenses/MediaPipe-Apache-2.0.txt +218 -0
- expression_lab/data/licenses/README.md +10 -0
- expression_lab/data/model_manifest.json +37 -0
- expression_lab/download_models.py +132 -0
- expression_lab/resources.py +40 -0
- expression_lab/ui.py +528 -0
- expression_lab/worker.py +206 -0
- expression_lab_classroom-1.3.0.dist-info/METADATA +80 -0
- expression_lab_classroom-1.3.0.dist-info/RECORD +23 -0
- expression_lab_classroom-1.3.0.dist-info/WHEEL +4 -0
- expression_lab_classroom-1.3.0.dist-info/entry_points.txt +3 -0
- expression_lab_classroom-1.3.0.dist-info/licenses/licenses/LibreFace-USC.txt +14 -0
- expression_lab_classroom-1.3.0.dist-info/licenses/licenses/MediaPipe-Apache-2.0.txt +218 -0
expression_lab/core.py
ADDED
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
"""与界面和模型无关的 AU 定义、尺度归一化与中性基准。"""
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
|
|
5
|
+
import numpy as np
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@dataclass(frozen=True)
|
|
9
|
+
class ActionUnit:
|
|
10
|
+
number: int
|
|
11
|
+
name: str
|
|
12
|
+
points: tuple[int, ...]
|
|
13
|
+
directions: tuple[tuple[float, float], ...]
|
|
14
|
+
measurement: str
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# 点位是用于课堂观察的几何代理,不等于 AU 模型的全部输入特征。
|
|
18
|
+
AUS = (
|
|
19
|
+
ActionUnit(1, "内眉上提", (107, 336), ((0, -1),) * 2, "两侧内眉向上"),
|
|
20
|
+
ActionUnit(2, "外眉上提", (70, 300), ((0, -1),) * 2, "两侧外眉向上"),
|
|
21
|
+
ActionUnit(4, "眉毛下压", (107, 336), ((0, 1),) * 2, "两侧内眉向下"),
|
|
22
|
+
ActionUnit(5, "上眼睑提升", (159, 386), ((0, -1),) * 2, "两侧上眼睑向上"),
|
|
23
|
+
ActionUnit(6, "面颊上提", (50, 280), ((0, -1),) * 2, "两侧面颊代表点向上"),
|
|
24
|
+
ActionUnit(9, "皱鼻", (98, 327), ((0, -1),) * 2, "鼻翼代表点向上(几何代理)"),
|
|
25
|
+
ActionUnit(12, "嘴角上提", (61, 291), ((0, -1),) * 2, "两侧嘴角向上"),
|
|
26
|
+
ActionUnit(15, "嘴角下拉", (61, 291), ((0, 1),) * 2, "两侧嘴角向下"),
|
|
27
|
+
ActionUnit(17, "下巴上提", (17,), ((0, -1),), "下唇下方代表点向上"),
|
|
28
|
+
ActionUnit(20, "嘴唇横向拉伸", (61, 291), ((-1, 0), (1, 0)), "两侧嘴角向外"),
|
|
29
|
+
ActionUnit(25, "嘴唇分开", (13, 14), ((0, -1), (0, 1)), "上下内唇各自向外,取均值"),
|
|
30
|
+
ActionUnit(26, "下颌下降", (152,), ((0, 1),), "下巴代表点向下"),
|
|
31
|
+
)
|
|
32
|
+
AU_IDS = tuple(au.number for au in AUS)
|
|
33
|
+
AU_BY_ID = {au.number: au for au in AUS}
|
|
34
|
+
|
|
35
|
+
# f 编号属于课堂特征,AU 编号属于 FACS,两者不混用。
|
|
36
|
+
# f1 固定为 AU12,f2 为 AU6,f3 为 AU26;默认0–20分来自几何强度。
|
|
37
|
+
FEATURE_AUS = (12, 6, 26, 4, 1, 2, 5, 9, 15, 17, 20, 25)
|
|
38
|
+
FEATURE_BY_AU = {number: index for index, number in enumerate(FEATURE_AUS, 1)}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def feature_values(intensities):
|
|
42
|
+
"""0–1强度 ×20 取整;默认输入几何η,教师也可用于独立模型值。"""
|
|
43
|
+
return {FEATURE_BY_AU[number]: int(np.floor(np.clip(value, 0, 1) * 20 + 0.5))
|
|
44
|
+
for number, value in intensities.items() if number in FEATURE_BY_AU}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def movement_grids(motion):
|
|
48
|
+
"""另行记录几何位移:1 格 = 当前外眼角眼距的 1/100,正负均四舍五入。"""
|
|
49
|
+
return {number: int(np.copysign(np.floor(abs(value.relative) + 0.5), value.relative))
|
|
50
|
+
for number, value in motion.items()}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def decode_intensities(output):
|
|
54
|
+
"""LibreFace 2.0.0 NuGet:原始 12 维值直接裁剪到 [0,1]。"""
|
|
55
|
+
values = np.asarray(output, dtype=float).reshape(-1)
|
|
56
|
+
if values.size != len(AU_IDS) or not np.isfinite(values).all():
|
|
57
|
+
raise ValueError("AU 模型输出应为 12 个有限数值")
|
|
58
|
+
return dict(zip(AU_IDS, np.clip(values, 0, 1).tolist(), strict=True))
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def face_coordinates(points):
|
|
62
|
+
"""像素点→眼角坐标系;消除二维平移、统一缩放和面内旋转。"""
|
|
63
|
+
points = np.asarray(points, dtype=float)
|
|
64
|
+
if points.shape != (478, 2) or not np.isfinite(points).all():
|
|
65
|
+
raise ValueError("需要 478 个有效二维人脸点")
|
|
66
|
+
rightward = points[263] - points[33]
|
|
67
|
+
eye_distance = np.linalg.norm(rightward)
|
|
68
|
+
if eye_distance < 1e-6:
|
|
69
|
+
raise ValueError("双眼外眼角距离过小")
|
|
70
|
+
rightward /= eye_distance
|
|
71
|
+
downward = np.array([-rightward[1], rightward[0]])
|
|
72
|
+
origin = (points[33] + points[263]) / 2
|
|
73
|
+
return (points - origin) @ np.column_stack((rightward, downward)) / eye_distance
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def to_pixels(coordinates, points):
|
|
77
|
+
"""把中性基准投回当前画面,供箭头起点使用。"""
|
|
78
|
+
rightward = points[263] - points[33]
|
|
79
|
+
downward = np.array([-rightward[1], rightward[0]])
|
|
80
|
+
origin = (points[33] + points[263]) / 2
|
|
81
|
+
return np.asarray(coordinates) @ np.row_stack((rightward, downward)) + origin
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
@dataclass(frozen=True)
|
|
85
|
+
class Movement:
|
|
86
|
+
relative: float
|
|
87
|
+
magnitude: float
|
|
88
|
+
dx: float
|
|
89
|
+
dy: float
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def movements(current, baseline):
|
|
93
|
+
"""有方向投影、平均移动长度和 dx/dy,单位均为外眼角距离的 %。"""
|
|
94
|
+
delta = (np.asarray(current) - np.asarray(baseline)) * 100
|
|
95
|
+
result = {}
|
|
96
|
+
for au in AUS:
|
|
97
|
+
selected = delta[list(au.points)]
|
|
98
|
+
result[au.number] = Movement(
|
|
99
|
+
relative=float(np.mean(np.sum(selected * au.directions, axis=1))),
|
|
100
|
+
magnitude=float(np.mean(np.linalg.norm(selected, axis=1))),
|
|
101
|
+
dx=float(np.mean(selected[:, 0])),
|
|
102
|
+
dy=float(np.mean(selected[:, 1])),
|
|
103
|
+
)
|
|
104
|
+
return result
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
class Calibration:
|
|
108
|
+
def __init__(self, required_frames=20):
|
|
109
|
+
if required_frames < 1:
|
|
110
|
+
raise ValueError("校准帧数需大于零")
|
|
111
|
+
self.required_frames = required_frames
|
|
112
|
+
self.baseline = None
|
|
113
|
+
self.collecting = False
|
|
114
|
+
self._samples = []
|
|
115
|
+
self._standard_samples = []
|
|
116
|
+
self.standard_baseline = None
|
|
117
|
+
|
|
118
|
+
@property
|
|
119
|
+
def count(self):
|
|
120
|
+
return len(self._samples)
|
|
121
|
+
|
|
122
|
+
def start(self):
|
|
123
|
+
self.interrupt()
|
|
124
|
+
self.baseline = None
|
|
125
|
+
self.standard_baseline = None
|
|
126
|
+
self.collecting = True
|
|
127
|
+
|
|
128
|
+
def feed(self, coordinates, standard_points=None):
|
|
129
|
+
if not self.collecting:
|
|
130
|
+
return False
|
|
131
|
+
self._samples.append(np.array(coordinates, copy=True))
|
|
132
|
+
if standard_points is not None:
|
|
133
|
+
self._standard_samples.append(np.array(standard_points, copy=True))
|
|
134
|
+
if self.count < self.required_frames:
|
|
135
|
+
return False
|
|
136
|
+
self.baseline = np.median(self._samples, axis=0)
|
|
137
|
+
if len(self._standard_samples) == self.count:
|
|
138
|
+
self.standard_baseline = np.median(self._standard_samples, axis=0)
|
|
139
|
+
self.collecting = False
|
|
140
|
+
self.interrupt()
|
|
141
|
+
return True
|
|
142
|
+
|
|
143
|
+
def interrupt(self):
|
|
144
|
+
self._samples.clear()
|
|
145
|
+
self._standard_samples.clear()
|
|
146
|
+
|
|
147
|
+
def reset(self):
|
|
148
|
+
self.interrupt()
|
|
149
|
+
self.baseline = None
|
|
150
|
+
self.standard_baseline = None
|
|
151
|
+
self.collecting = False
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
@dataclass(frozen=True)
|
|
155
|
+
class GeometryParameter:
|
|
156
|
+
k: float
|
|
157
|
+
source: str = 'Lien1998_Table5'
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
# AU6 未列在表5,AU17 明确未测量;二者是可调课堂近似,不能冒称论文参数。
|
|
161
|
+
GEOMETRY_PARAMETERS = {
|
|
162
|
+
1: GeometryParameter(7), 2: GeometryParameter(7), 4: GeometryParameter(4),
|
|
163
|
+
5: GeometryParameter(2), 6: GeometryParameter(5, 'classroom_proxy'),
|
|
164
|
+
9: GeometryParameter(5), 12: GeometryParameter(6), 15: GeometryParameter(3),
|
|
165
|
+
17: GeometryParameter(5, 'classroom_proxy'), 20: GeometryParameter(6),
|
|
166
|
+
25: GeometryParameter(20), 26: GeometryParameter(20),
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
@dataclass(frozen=True)
|
|
171
|
+
class GeometricIntensity:
|
|
172
|
+
displacement: float
|
|
173
|
+
intensity: float
|
|
174
|
+
k: float
|
|
175
|
+
source: str
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
def lien_coordinates(points):
|
|
179
|
+
"""Lien §2.4 的尺度:内眼角宽50、眼线至人中顶部高75标准像素。
|
|
180
|
+
|
|
181
|
+
MediaPipe p133/p362 近似内眼角,p2 近似人中顶端;移除面内转动,
|
|
182
|
+
分别归一化横纵尺度。模型坐标为385×417,原点/旋转中心在人中(192,230)。
|
|
183
|
+
不消除真实三维侧转,也不把外轮廓宽度当成稳定锚点。
|
|
184
|
+
"""
|
|
185
|
+
points = np.asarray(points, dtype=float)
|
|
186
|
+
if points.shape != (478, 2) or not np.isfinite(points).all():
|
|
187
|
+
raise ValueError('需要478个有效二维人脸点')
|
|
188
|
+
axis = points[362] - points[133]
|
|
189
|
+
width = float(np.linalg.norm(axis))
|
|
190
|
+
if width < 1e-6:
|
|
191
|
+
raise ValueError('内眼角距离过小')
|
|
192
|
+
rightward = axis / width
|
|
193
|
+
downward = np.array([-rightward[1], rightward[0]])
|
|
194
|
+
eye_center = (points[133] + points[362]) / 2
|
|
195
|
+
height = float((points[2] - eye_center) @ downward)
|
|
196
|
+
if height < width * .1:
|
|
197
|
+
raise ValueError('人中锚点无效,请正对摄像头')
|
|
198
|
+
local = (points - points[2]) @ np.column_stack((rightward, downward))
|
|
199
|
+
return local * (50 / width, 75 / height) + (192, 230)
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
def geometric_intensities(current, baseline):
|
|
203
|
+
"""标准像素位移→η=d/hypot(d,k)。双侧先按方向门控再平均位移。
|
|
204
|
+
|
|
205
|
+
AU4 的下压/内收取较大值是本应用融合约定;AU25/26共用论文25~27
|
|
206
|
+
唇中点开合代理,不据此区分下颌与唇部肌肉。AU6/17为课堂扩展。
|
|
207
|
+
"""
|
|
208
|
+
current, baseline = np.asarray(current, dtype=float), np.asarray(baseline, dtype=float)
|
|
209
|
+
if (current.shape != (478, 2) or baseline.shape != (478, 2)
|
|
210
|
+
or not np.isfinite(current).all() or not np.isfinite(baseline).all()):
|
|
211
|
+
raise ValueError('强度计算需要有效的标准坐标和基准')
|
|
212
|
+
delta = current - baseline
|
|
213
|
+
|
|
214
|
+
def vertical(indices, sign):
|
|
215
|
+
return float(np.maximum(sign * delta[list(indices), 1], 0).mean())
|
|
216
|
+
|
|
217
|
+
mouth = delta[[61, 291]]
|
|
218
|
+
# 用基准中嘴角的左右位置确定“向外”,不依赖镜像后的显示。
|
|
219
|
+
sides = np.where(baseline[[61, 291], 0] < baseline[[61, 291], 0].mean(), -1, 1)
|
|
220
|
+
outward = mouth[:, 0] * sides
|
|
221
|
+
|
|
222
|
+
def directed_length(vertical_sign, low, high):
|
|
223
|
+
vertical_delta = mouth[:, 1] * vertical_sign
|
|
224
|
+
angles = np.degrees(np.arctan2(vertical_delta, outward))
|
|
225
|
+
allowed = (angles >= low - 1e-9) & (angles <= high + 1e-9)
|
|
226
|
+
return float(np.where(allowed, np.linalg.norm(mouth, axis=1), 0).mean())
|
|
227
|
+
|
|
228
|
+
brow_closure = abs(baseline[336, 0] - baseline[107, 0]) - abs(current[336, 0] - current[107, 0])
|
|
229
|
+
gap_change = (current[14, 1] - current[13, 1]) - (baseline[14, 1] - baseline[13, 1])
|
|
230
|
+
displacements = {
|
|
231
|
+
1: vertical((107, 336), -1), 2: vertical((70, 300), -1),
|
|
232
|
+
4: max(vertical((107, 336), 1), float(brow_closure), 0),
|
|
233
|
+
5: vertical((159, 386), -1), 6: vertical((50, 280), -1),
|
|
234
|
+
9: vertical((98, 327), -1), 12: directed_length(-1, 10, 80),
|
|
235
|
+
15: directed_length(1, 10, 90), 17: vertical((17,), -1),
|
|
236
|
+
20: directed_length(-1, -10, 10), 25: max(float(gap_change), 0),
|
|
237
|
+
26: max(float(gap_change), 0),
|
|
238
|
+
}
|
|
239
|
+
return {number: GeometricIntensity(
|
|
240
|
+
displacement=d, intensity=float(d / np.hypot(d, GEOMETRY_PARAMETERS[number].k)),
|
|
241
|
+
k=GEOMETRY_PARAMETERS[number].k, source=GEOMETRY_PARAMETERS[number].source,
|
|
242
|
+
) for number, d in displacements.items()}
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
def standard_pixel_values(geometry):
|
|
246
|
+
"""标准坐标中沿指定动作约束测得的非负位移,显示为整数像素。"""
|
|
247
|
+
return {number: int(np.floor(value.displacement + .5)) for number, value in geometry.items()}
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
def lien_to_pixels(coordinates, points):
|
|
251
|
+
"""把标准像素基准投回当前画面,与几何强度使用相同的对齐坐标。"""
|
|
252
|
+
points = np.asarray(points, dtype=float)
|
|
253
|
+
axis = points[362] - points[133]
|
|
254
|
+
width = np.linalg.norm(axis)
|
|
255
|
+
rightward = axis / width
|
|
256
|
+
downward = np.array([-rightward[1], rightward[0]])
|
|
257
|
+
height = (points[2] - (points[133] + points[362]) / 2) @ downward
|
|
258
|
+
local = (np.asarray(coordinates) - (192, 230)) * (width / 50, height / 75)
|
|
259
|
+
return local @ np.row_stack((rightward, downward)) + points[2]
|
|
Binary file
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"date": "2026-11-15",
|
|
3
|
+
"method": "image2 via built-in image generation, same fictional adult identity, reference-image edits",
|
|
4
|
+
"kind": "synthetic generated verification images; not photographs of a real participant",
|
|
5
|
+
"cases": [
|
|
6
|
+
{
|
|
7
|
+
"file": "01_neutral.png",
|
|
8
|
+
"requested_action": "自然表情"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"file": "02_smile.png",
|
|
12
|
+
"requested_action": "嘴角上提、面颊上提"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"file": "03_open_mouth.png",
|
|
16
|
+
"requested_action": "张嘴、下颌下降"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"file": "04_brow_frown.png",
|
|
20
|
+
"requested_action": "眉毛下压"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
This software is Copyright © 2020 The University of Southern California. All Rights Reserved.
|
|
2
|
+
|
|
3
|
+
Permission to use, copy, modify, and distribute this software and its documentation for educational, research and non-profit purposes, without fee, and without a written agreement is hereby granted, provided that the above copyright notice, this paragraph and the following three paragraphs appear in all copies.
|
|
4
|
+
|
|
5
|
+
Permission to make commercial use of this software may be obtained by contacting:
|
|
6
|
+
USC Stevens Center for Innovation
|
|
7
|
+
University of Southern California
|
|
8
|
+
1150 S. Olive Street, Suite 2300
|
|
9
|
+
Los Angeles, CA 90115, USA
|
|
10
|
+
Email: accounting@stevens.usc.edu
|
|
11
|
+
|
|
12
|
+
This software program and documentation are copyrighted by The University of Southern California. The software program and documentation are supplied "as is", without any accompanying services from USC. USC does not warrant that the operation of the program will be uninterrupted or error-free. The end-user understands that the program was developed for research purposes and is advised not to rely exclusively on the program for any reason.
|
|
13
|
+
|
|
14
|
+
IN NO EVENT SHALL THE UNIVERSITY OF SOUTHERN CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF SOUTHERN CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF SOUTHERN CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF SOUTHERN CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
202
|
+
|
|
203
|
+
===========================================================================
|
|
204
|
+
For files under tasks/cc/text/language_detector/custom_ops/utils/utf/
|
|
205
|
+
===========================================================================
|
|
206
|
+
/*
|
|
207
|
+
* The authors of this software are Rob Pike and Ken Thompson.
|
|
208
|
+
* Copyright (c) 2002 by Lucent Technologies.
|
|
209
|
+
* Permission to use, copy, modify, and distribute this software for any
|
|
210
|
+
* purpose without fee is hereby granted, provided that this entire notice
|
|
211
|
+
* is included in all copies of any software which is or includes a copy
|
|
212
|
+
* or modification of this software and in all copies of the supporting
|
|
213
|
+
* documentation for such software.
|
|
214
|
+
* THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
|
|
215
|
+
* WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE ANY
|
|
216
|
+
* REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
|
|
217
|
+
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
|
|
218
|
+
*/
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# 第三方资料与许可证
|
|
2
|
+
|
|
3
|
+
- `LibreFace-USC.txt`:官方 NuGet LibreFace 2.0.0 随附许可证;编码器、强度模型及参考的对齐/预处理约定来自 LibreFace / OpenSense。
|
|
4
|
+
- `MediaPipe-Apache-2.0.txt`:MediaPipe 官方 Apache 2.0 许可证。
|
|
5
|
+
- `offline/windows_cp312/*.whl` 内含各依赖自身的 LICENSE / NOTICE;未删除或改写。
|
|
6
|
+
- Python、VC++ 安装器包含各自的许可与安装界面。
|
|
7
|
+
- `samples/portrait.jpg` 来自 Google MediaPipe 公开示例资源 `https://storage.googleapis.com/mediapipe-assets/portrait.jpg`,仅用于真实照片路径回归。默认离线样例使用本项目 image2 生成的人脸图。
|
|
8
|
+
- `validation/images/*.png` 是本次用户要求生成的虚构成年人图片;生成说明在同目录 provenance.json。
|
|
9
|
+
|
|
10
|
+
本文件不替代各许可证全文。
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"libreface_nuget_version": "2.0.0",
|
|
4
|
+
"au_ids": [
|
|
5
|
+
1,
|
|
6
|
+
2,
|
|
7
|
+
4,
|
|
8
|
+
5,
|
|
9
|
+
6,
|
|
10
|
+
9,
|
|
11
|
+
12,
|
|
12
|
+
15,
|
|
13
|
+
17,
|
|
14
|
+
20,
|
|
15
|
+
25,
|
|
16
|
+
26
|
|
17
|
+
],
|
|
18
|
+
"output_scale": "ONNX native 0–1, clip to [0,1] without division by 5",
|
|
19
|
+
"source_commit": "0b2e9f7f933f6430ff887de2034dc8f2bc7ded25",
|
|
20
|
+
"files": {
|
|
21
|
+
"face_landmarker.task": {
|
|
22
|
+
"bytes": 3758596,
|
|
23
|
+
"sha256": "64184e229b263107bc2b804c6625db1341ff2bb731874b0bcc2fe6544e0bc9ff",
|
|
24
|
+
"source": "https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/1/face_landmarker.task"
|
|
25
|
+
},
|
|
26
|
+
"LibreFace_AU_Encoder.onnx": {
|
|
27
|
+
"bytes": 44883922,
|
|
28
|
+
"sha256": "2eaf01eb6dffe3b6f50f8e84eb1ecf315e332c972fd77e12187a7bb956575d8c",
|
|
29
|
+
"source": "https://api.nuget.org/v3-flatcontainer/libreface/2.0.0/libreface.2.0.0.nupkg"
|
|
30
|
+
},
|
|
31
|
+
"LibreFace_AU_Intensity.onnx": {
|
|
32
|
+
"bytes": 289061,
|
|
33
|
+
"sha256": "9c0c23a826e326ff6a5c9545e9792ec1624d0254588e5f3ab3bfef0e270dc374",
|
|
34
|
+
"source": "https://api.nuget.org/v3-flatcontainer/libreface/2.0.0/libreface.2.0.0.nupkg"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|