Skip to content

  • 体验新版
    • 正在加载...
  • 登录
  • PaddlePaddle
  • PaddleHub
  • Issue
  • #267

P
PaddleHub
  • 项目概览

PaddlePaddle / PaddleHub
大约 2 年 前同步成功

通知 285
Star 12117
Fork 2091
  • 代码
    • 文件
    • 提交
    • 分支
    • Tags
    • 贡献者
    • 分支图
    • Diff
  • Issue 200
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 4
  • Wiki 0
    • Wiki
  • 分析
    • 仓库
    • DevOps
  • 项目成员
  • Pages
P
PaddleHub
  • 项目概览
    • 项目概览
    • 详情
    • 发布
  • 仓库
    • 仓库
    • 文件
    • 提交
    • 分支
    • 标签
    • 贡献者
    • 分支图
    • 比较
  • Issue 200
    • Issue 200
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 4
    • 合并请求 4
  • Pages
  • 分析
    • 分析
    • 仓库分析
    • DevOps
  • Wiki 0
    • Wiki
  • 成员
    • 成员
  • 收起侧边栏
  • 动态
  • 分支图
  • 创建新Issue
  • 提交
  • Issue看板
已关闭
开放中
Opened 12月 19, 2019 by saxon_zh@saxon_zhGuest

pyramidbox_face_detection bigger input wrong bboxes coordinate

Created by: EthanZBY

!hub run pyramidbox_face_detection --input_path path_to_image

/home/aistudio/.paddlehub/modules/pyramidbox_face_detection/python/c0bea9f829808eae3a844e829d06a407.py

Bug 1st: When shrink is not equal to 1.0, then the coordinates of bboxes will be wrong fix: Should not should not be divided by shrink:

def postprocess(self, sign_name, data_out, data_info, **kwargs):
    self.build_config(**kwargs)
    self.visualization = True
    if sign_name == "face_detection":
        lod_tensor = data_out[0]
        lod = lod_tensor.lod()[0]
        results = np.array(data_out[0])
        output = []
        for index in range(len(lod) - 1):
            result_i = results[lod[index]:lod[index + 1]]
            shrink = data_info['image'][index]['shrink']
            output_i = {
                'path': data_info['image'][index]['path'],
                'data': []
            }
            w = data_info['image'][index]['width']
            h = data_info['image'][index]['height']
            if np.prod(result_i.shape) <= 1:
                print("No face detected in {}".format(data_info['image'][index]['path']))
            else:
                det_conf = result_i[:, 1]
                det_xmin = w * result_i[:, 2] #/ shrink
                det_ymin = h * result_i[:, 3] #/ shrink
                det_xmax = w * result_i[:, 4] #/ shrink
                det_ymax = h * result_i[:, 5] #/ shrink
                dets = np.column_stack((det_xmin, det_ymin, det_xmax, det_ymax, det_conf))
                keep_index = np.where(dets[:, 4] >= self.score_thresh)[0]
                dets = dets[keep_index, :]
                if dets.shape[0] != 0:
                    if self.visualization:
                        draw_bboxes(data_info['image'][index]['path'], dets[:, 0:4])
                for dt in result_i:
                    dt_i = {}
                    if dt[1] < self.score_thresh:
                        continue
                    dt_i['left'] = float(dt[2])
                    dt_i['right'] = float(dt[4])
                    dt_i['top'] = float(dt[3])
                    dt_i['bottom'] = float(dt[5])
                    dt_i['confidence'] = float(dt[1])
                    output_i['data'].append(dt_i)
                if len(output_i['data']) == 0:
                    print("No face detected in {}".format(data_info['image'][index]['path']))
            output.append(output_i)
        return output

Bug 2nd: Same as https://github.com/PaddlePaddle/models/issues/4082 fix: to add in get_shrink: elif max_shrink <= 0.1: max_shrink = 0.1

指派人
分配到
无
里程碑
无
分配里程碑
工时统计
无
截止日期
无
标识: paddlepaddle/PaddleHub#267
渝ICP备2023009037号

京公网安备11010502055752号

网络110报警服务 Powered by GitLab CE v13.7
开源知识
Git 入门 Pro Git 电子书 在线学 Git
Markdown 基础入门 IT 技术知识开源图谱
帮助
使用手册 反馈建议 博客
《GitCode 隐私声明》 《GitCode 服务条款》 关于GitCode
Powered by GitLab CE v13.7