YonghaoHe / LFFD-A-Light-and-Fast-Face-Detector-for-Edge-Devices

A light and fast one class detection framework for edge devices. We provide face detector, head detector, pedestrian detector, vehicle detector......
MIT License
1.32k stars 329 forks source link

the face scale #46

Closed GRAYKEY closed 3 years ago

GRAYKEY commented 5 years ago

你好,请问下论文中的continuous face scale是怎么推出来的?为什么loss branch1的face scale是10-15?感谢。

YonghaoHe commented 5 years ago

@GRAYKEY 目前版本里面这些主要是依靠经验进行设定的,和任务特点,有效感受野有关系. 下一个版本我们将给出一个更加有理论根据的设置方式.

GRAYKEY commented 5 years ago

感谢你的回复。另外对于下面branch的样本采样代码,特别是if random.random() > 0.9:和if scale_idx == self.num_output_scales:条件下的处理方法,这个scale缩放大小也是根据经验设置的吗

target_bbox = bboxes[bbox_idx, :]
longer_side = max(target_bbox[2:])
if longer_side <= self.bbox_small_list[0]:
    scale_idx = 0
elif longer_side <= self.bbox_small_list[1]:
    scale_idx = random.randint(0, 1)
elif longer_side <= self.bbox_small_list[2]:
    scale_idx = random.randint(0, 2)
else:
    if random.random() > 0.9:
        scale_idx = random.randint(0, self.num_output_scales)
    else:
        scale_idx = random.randint(0, self.num_output_scales - 1)

# choose a side length in the selected scale
if scale_idx == self.num_output_scales:
    scale_idx -= 1
    side_length = self.bbox_large_list[-1] + random.randint(0, self.bbox_large_list[-1] * 0.5)
else:
    side_length = self.bbox_small_list[scale_idx] + \
    random.randint(0, self.bbox_large_list[scale_idx] - self.bbox_small_list[scale_idx])
target_scale = float(side_length) / longer_side