FaceDetect / jointCascade_py

Joint Cascade Face Detection and Alignment
103 stars 59 forks source link

Running out of neg images #8

Open caxieyou opened 8 years ago

caxieyou commented 8 years ago

Thx for your sharing ,it helps a huge~ Here are two questions...

  1. According to the paper, there are 1080 weakCRNums for each stage I prepared like 3000 faces and 13000+ neg image.

BUT No matter of how many weakCRNums I set up. Only 20 will be reached int the 1st stage, then the neg images are not enough.

BTW, I found that in the cary.py

Line 249, 250, 251, 252 and line 293,294,295,296

should be += instead of =. point_a[0] = feaType[2]_imgW point_a[1] = feaType[3]_imgH point_b[0] = feaType[5]_imgW point_b[1] = feaType[6]_imgH

should be

point_a[0] += feaType[2]_imgW point_a[1] += feaType[3]_imgH point_b[0] += feaType[5]_imgW point_b[1] += feaType[6]_imgH

Am I right?

caxieyou commented 8 years ago

Btw in the split function

if self.depth<0 or len(posIdxs)<100 or \ (bIsCls and len(posIdxs)<100):

there are two "len(posIdxs)<100", is this right?

samuel1208 commented 8 years ago

@caxieyou

  1. = is right
  2. the split condition is not optimized. You can set it by youself. But two "len(posIdxs)<100" is right
caxieyou commented 8 years ago

The full code is as follow:

point_a = shape[feaType[1]] point_b = shape[feaType[4]]
point_a[0] = feaType[2]_imgW point_a[1] = feaType[3]_imgH point_b[0] = feaType[5]_imgW point_b[1] = feaType[6]_imgH

if point_a[0] = feaType[2]*imgW is right, then the first two lines: point_a = shape[feaType[1]] and point_b = shape[feaType[4]] should be useless cause they are overwritten.

According to your code, feaType[1] and feaType[4] are point index, and 2,3,5,6 are offset,

Kind of confusing

Thx

caxieyou commented 8 years ago

Also the running out of neg images questions. Any suggestion?

samuel1208 commented 8 years ago
  1. I'm sorry I made a mistake. You are right. It should be +=
  2. Actually the strategy of set recall is not optimized now. I suggest you refer to the soft cascade to set the recall dynamically