|
Algorithm 1 Face geometry representation using hierarchical shifted windows architecture |
-
Input:
P = {} where is the nth patch of image x.
= learned linear embedding matrix.
= positional encoding matrix.
MSA, SW-MSA = multiheaded self-attention and shifted window MSA.
MLP = multi-layer perceptron
LN = layer normalization
-
Output:
Face Representation Classification
-
1:
fordo ▹ For each patch
-
2:
flatten(p)
-
3:
-
4:
-
5:
end for
-
6:
X←P
-
7:
for block pair in transformer blocks do
-
8:
X← MSA(LN(X)) + X
-
9:
X← MLP(LN(X)) + X
-
10:
X← SW-MSA(LN(X)) + X
-
11:
X← MLP(LN(X)) + X
If at block pair 1, 2, 11:
-
12:
for do
-
13:
merge()
-
14:
end for
-
15:
end for
|