https://github.com/davidsandberg/facenet/blob/master/src/align/detect_face.py
Please refer to this python code above.
I found the prototype of class Network function conv can NOT match with its calling part as
@layer
def conv(self,
inp,
k_h,
k_w,
c_o,
s_h,
s_w,
name,
relu=True,
padding='SAME',
group=1,
biased=True):
& calling conv by
class PNet(Network):
def setup(self):
(self.feed('data') #pylint: disable=no-value-for-parameter, no-member
.conv(3, 3, 10, 1, 1, padding='VALID', relu=False, name='conv1')
.prelu(name='PReLU1')
.max_pool(2, 2, 2, 2, name='pool1')
.conv(3, 3, 16, 1, 1, padding='VALID', relu=False, name='conv2')
.prelu(name='PReLU2')
.conv(3, 3, 32, 1, 1, padding='VALID', relu=False, name='conv3')
.prelu(name='PReLU3')
.conv(1, 1, 2, 1, 1, relu=False, name='conv4-1')
.softmax(3,name='prob1'))
(self.feed('PReLU3') #pylint: disable=no-value-for-parameter
.conv(1, 1, 4, 1, 1, relu=False, name='conv4-2'))
Notice that
- self
- inp --> where it comes from?
- ....
I know that self can be ignored; inp, k_h, k_w, c_o, s_h, s_w, can match with position by, ex: 3, 3, 10, 1, 1 and the other parameters are assigned by name.
However, I cannot figure out the way inp comes from?
It contradicts with my familiar programming language C & C++ a a lot..
Does any one can help on explaining it?
Thanks in advance.