ainrichman / Peppa-Facial-Landmark-PyTorch

Facial Landmark Detection based on PyTorch
Apache License 2.0
213 stars 56 forks source link

lmk smooth 问题? #13

Open Dian-Yi opened 4 years ago

Dian-Yi commented 4 years ago

使用光流追踪时,人脸速度移动过快,关键的位置会偏移预处的正确位置很多?

Dian-Yi commented 4 years ago

我简单研究了下track.py里面的one euro filter算法:

def __call__(self, x, x_prev):
       if x_prev is None:
            return x
        t_e = 1
        a_d = smoothing_factor(t_e, self.d_cutoff)
        dx = (x - x_prev) / t_e
        dx_hat = exponential_smoothing(a_d, dx, self.dx_prev)
        cutoff = self.min_cutoff + self.beta * abs(dx_hat)
        a = smoothing_factor(t_e, cutoff)
        x_hat = exponential_smoothing(a, x, x_prev)
        self.dx_prev = dx_hat
        return x_hat

其中 dx_hat = exponential_smoothing(a_d, dx, self.dx_prev) 中的参数:self.dx_prev每个lmk点都使用的是上一个点的求出来的x_prev?这样做是否正确?