tensorflow-MTCNN icon indicating copy to clipboard operation
tensorflow-MTCNN copied to clipboard

hard_example转换问题

Open djjandXMU opened this issue 6 years ago • 9 comments

请问楼主,你在util函数中,convert_to_square子函数转换为更大正方形极有可能超出图像索引,请问这样是否正确?

djjandXMU avatar Apr 21 '19 12:04 djjandXMU

Hi @djjandXMU 确实会有可能超出, https://github.com/LeslieZhoa/tensorflow-MTCNN/blob/d017494a63955cd68887f1d48e245ef78d6ff488/preprocess/gen_hard_example.py#L130 此处会去除掉超出的框

LeslieZhoa avatar Apr 21 '19 16:04 LeslieZhoa

你好!@djjandXMU问一下hard_example训练o_net网络时有没有出现以下报错?麻烦解答一下,谢谢。 lunar@lunar-virtual-machine:~/PycharmProjects/tensorflow_mtcnn/preprocess$ python gen_hard_example.py 24 2019-05-12 09:33:06.690596: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 载入数据 8247it [2:47:10, 1.26it/s]Traceback (most recent call last): File "gen_hard_example.py", line 193, in main(parse_arguments(sys.argv[1:])) File "gen_hard_example.py", line 70, in main detectors,_=mtcnn_detector.detect_face(test_data) File "../detection/MtcnnDetector.py", line 87, in detect_face boxes, boxes_c, landmark = self.detect_rnet(im, boxes_c) File "../detection/MtcnnDetector.py", line 181, in detect_rnet cls_scores, reg, _ = self.rnet_detector.predict(cropped_ims) File "../detection/detector.py", line 63, in predict return np.concatenate(cls_prob_list, axis=0), np.concatenate(bbox_pred_list, axis=0), np.concatenate(landmark_pred_list, axis=0) ValueError: need at least one array to concatenate

lunar-r avatar May 12 '19 12:05 lunar-r

你好,我没有出现这个问题。我是在ubuntu上运行的。直接在命令行输入作者给的代码即可

------------------ 原始邮件 ------------------ 发件人: "mmcgg"[email protected]; 发送时间: 2019年5月12日(星期天) 晚上8:59 收件人: "LeslieZhoa/tensorflow-MTCNN"[email protected]; 抄送: "沐雨弟"[email protected]; "Mention"[email protected]; 主题: Re: [LeslieZhoa/tensorflow-MTCNN] hard_example转换问题 (#9)

你好!@djjandXMU问一下hard_example训练o_net网络时有没有出现以下报错?麻烦解答一下,谢谢。 lunar@lunar-virtual-machine:~/PycharmProjects/tensorflow_mtcnn/preprocess$ python gen_hard_example.py 24 2019-05-12 09:33:06.690596: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 载入数据 8247it [2:47:10, 1.26it/s]Traceback (most recent call last): File "gen_hard_example.py", line 193, in main(parse_arguments(sys.argv[1:])) File "gen_hard_example.py", line 70, in main detectors,_=mtcnn_detector.detect_face(test_data) File "../detection/MtcnnDetector.py", line 87, in detect_face boxes, boxes_c, landmark = self.detect_rnet(im, boxes_c) File "../detection/MtcnnDetector.py", line 181, in detect_rnet cls_scores, reg, _ = self.rnet_detector.predict(cropped_ims) File "../detection/detector.py", line 63, in predict return np.concatenate(cls_prob_list, axis=0), np.concatenate(bbox_pred_list, axis=0), np.concatenate(landmark_pred_list, axis=0) ValueError: need at least one array to concatenate

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

djjandXMU avatar May 12 '19 14:05 djjandXMU

谢谢啦!我是在Ubuntu下pycharm环境下用命令运行的,p_net、r_net都可以正常生成数据

lunar-r avatar May 13 '19 01:05 lunar-r

array

我也遇到了同样的问题,请问您解决了吗?

lwihtittlee avatar Nov 20 '19 07:11 lwihtittlee

直接用即可,代码没有出错。

------------------ 原始邮件 ------------------ 发件人: "ZJUWLAN"<[email protected]>; 发送时间: 2019年11月20日(星期三) 下午3:04 收件人: "LeslieZhoa/tensorflow-MTCNN"<[email protected]>; 抄送: "沐雨弟"<[email protected]>; "Mention"<[email protected]>; 主题: Re: [LeslieZhoa/tensorflow-MTCNN] hard_example转换问题 (#9)

array

我也遇到了同样的问题,请问您解决了吗?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

djjandXMU avatar Nov 21 '19 01:11 djjandXMU

我也遇到同样的问题了,请问具体怎么解决的?

long2double avatar Dec 19 '19 02:12 long2double

没有问题,虽然是负的,最后通过max(x,0)操作就会归于零,注意看代码后面部分  

------------------ 原始邮件 ------------------ 发件人: "魇魇"<[email protected]>; 发送时间: 2019年12月19日(星期四) 上午10:48 收件人: "LeslieZhoa/tensorflow-MTCNN"<[email protected]>; 抄送: "沐雨弟"<[email protected]>;"Mention"<[email protected]>; 主题: Re: [LeslieZhoa/tensorflow-MTCNN] hard_example转换问题 (#9)

我也遇到同样的问题了,请问具体怎么解决的?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

djjandXMU avatar Dec 19 '19 13:12 djjandXMU

array

我也遇到了同样的问题,请问您解决了吗?

调试代码之后发现, num_boxes=np.sum(np.where((np.minimum(tmpw,tmph)>=delete_size),ones,zeros))这里返回的num_boxes为0,所以产生了上述错误。

这个感觉应该是好多在win10上跑的小伙伴才会有的问题吧,可以在添加在MtcnnDetector.py的detect_rnet(self,im,dets)里面,修改如下:

在上述代码(num_boxes=np.sum(np.where((np.minimum(tmpw,tmph)>=delete_size),ones,zeros)))下面增加一行 if num_boxes == 0: return None, None, None 即可。 希望可以帮到后续的同学

ztfmars avatar Apr 22 '20 16:04 ztfmars