How to config to merely show proper resulting windows?

114 views
Skip to first unread message

nguyenhu...@gmail.com

unread,
Aug 5, 2013, 4:46:53 AM8/5/13
to ebl...@googlegroups.com
I'm trying Face Detector of EBLearn. When I test EBlearn on nens.gif, it results in a lot of windows (below and above the 'threshold' variable in best_dir.conf file). Would you please help me to display merely windows whose confidences are larger than the 'threshold' variable in best_dir.conf?

OS: windows 7 (64bit)

Output image: http://www.mediafire.com/download/x91a4exsiu4hp2j/resulting_face.PNG

Hoang Nguyen

unread,
Aug 5, 2013, 5:55:00 AM8/5/13
to ebl...@googlegroups.com
This is my best_dir.conf file

################################################################################
# META_TRAINER CONFIGURATION
# Note: variables starting with "meta_" are reserved for meta configuration

# required variables
meta_command = objrec_train

# optional variables
meta_name = face
meta_max_cpus = 8
#meta_output_dir = /home/sermanet/texieradata/face/out
meta_output_dir = /home/sermanet/humairadata/face/out
meta_email = m...@mail.com
meta_email_period = 1 # send an email with plots after every n iterations
meta_gnuplot_params ="set grid ytics;set ytics 5;set mytics 5;set grid mytics;"

################################################################################
# LOCAL PROGRAM CONFIGURATION

# directories ##################################################################
#ebl= ${HOME}/eblpierre/ # eblearn root
ebl=E:/Source_code/EBLearn
#root=/home/sermanet/humairadata/face/ds
#root2=${HOME}/eblearn/demos/face/trained/
#root2=C:\Users\pierre\eblearn\demos\obj\face\trained\

# # network ######################################################################
# net_type=cscsc
# net_ih=32
# net_iw=32
# net_c1h=5
# net_c1w=5
# net_s1h=2
# net_s1w=2
# net_c2h=5
# net_c2w=5
# net_s2h=2
# net_s2w=2
# net_full=100
# absnorm=1
# color=0
# mirror=0
# use_tanh = 1

# network ######################################################################
net = cscsc # net archictecture
color = 0 # use color or not
manual_load = 0 # manually load weights for individual modules

arch = ${arch_${net}} # global architecture
mirror = 0 # mirror instead of zero-padding (default)
nonlin = tanh # stdsig # non-linearity module

# layers
c0 = conv0,addc0,${nonlin}0,abs0,wstd0
s1 = subs1,addc1,${nonlin}1
c2 = conv2,addc2,${nonlin}2,abs2,wstd2
s3 = subs3,addc3,${nonlin}3
c4 = conv4,addc4,${nonlin}4
f5 = linear5,addc5,${nonlin}5

# machines
arch_cscsc = ${pp_detect},${c0},${s1},${c2},${s3},${c4}
arch_cscscf = ${pp_detect},${c0},${s1},${c2},${s3},${c4},${f5}

answer = class_answer

background_name = bg

# preprocessing modules
pp_y = rgb_to_y0
pp_yuv = rgb_to_yuv0
pp_yp = rgb_to_yp0
pp_ypuv = rgb_to_ypuv0
rgb_to_ypuv0_kernel = 7x7
rgb_to_ypuv0_mirror = 1
rgb_to_yp0_kernel = 7x7
rgb_to_yp0_mirror = 1
#resizepp0_pp = rgb_to_ypuv0
resizepp0_pp = rgb_to_yp0
#resizepp0_fovea = ${fovea}
resizepp0_zpad = 
pp_train = #rgb_to_ypuv0 #mschan0
pp_detect = resizepp0

# modules parameters
inputh = 32 # input's height
inputw = 32 # input's width
conv0_kernel = 5x5 # convolution kernel
conv0_stride = 1x1 # convolution stride
conv0_table = #${table0_color${color}} # convolution table (optional)
conv0_table_in = 1 # conv input max, used if table file not defined
conv0_table_out = ${table0_max} # features max, used if table file not defined
wstd0_kernel = 5x5 # normalization kernel
wstd0_gaussian_coeff = 0 # normalization kernel coeffcient
subs1_kernel = 2x2 # subsampling kernel
subs1_stride = ${subs1_kernel} # subsampling stride
addc1_weights = # weights to be loaded if manual_load = 1
conv2_kernel = 5x5 # convolution kernel
conv2_stride = 1x1 # convolution stride
conv2_table = ${table1} # convolution table (optional)
conv2_table_in = thickness # use current thickness as max table input
conv2_table_out = ${table1_max} # features max, used if table file not defined
conv2_weights = #${wroot1}${sp0}${sp1}_layer1_convolution_kernel.mat
addc2_weights = #${wroot1}${sp0}${sp1}_layer2_bias_bias.mat
diag2_weights = #${wroot1}${sp0}${sp1}_layer4_diag_coeff.mat
wstd2_kernel = 5x5 # normalization kernel
wstd2_gaussian_coeff = 0 # normalization kernel coeffcient
subs3_kernel = 2x2 # subsampling kernel
subs3_stride = ${subs3_kernel} # subsampling stride
addc3_weights = # weights to be loaded if manual_load = 1
conv4_kernel = 5x5 # convolution kernel
conv4_stride = 1x1 # convolution stride
conv4_table_in = thickness # use current thickness as max table input
conv4_table_out = noutputs # use number of classes as max table output
linear5_in = 10 # linear module input features size
linear5_out = noutputs # use number of classes as max table output

# tables #######################################################################

tblroot = ${ebl}/tools/data/tables/ # location of table files

# # conv00
# table00 = ${tblroot}/table_2_6_connect_6_fanin_0_density_0.5_uv0_u3_v6.mat

# conv0
table0_max = 6 #64 # full table output max (overridden if table file defined)
# table0_color0 = # no color, use table0_max for full table
# table0_color1 = ${tblroot}/table_3_32_connect_32_fanin_0_density_0.33_yuv0_y26_u29_v32.mat

# # conv1
# tbl=3
# table1_max = 64 # 64 96 128 256
# tbl1_mr1 = ${tblroot}/table_32_64_connect_1664_fanin_26_density_0.81_random.mat
# tbl1_mr2 = ${tblroot}/table_32_64_connect_1664_fanin_26_density_0.81_random.mat
# tbl1_2 = ${tblroot}/table_32_96_connect_2496_fanin_26_density_0.81_random.mat
# tbl1_mr1c = ${tblroot}/table_38_68_connect_2040_fanin_30_density_0.79_random.mat
# tbl1_mr2c = ${tblroot}/table_38_68_connect_2040_fanin_30_density_0.79_random.mat

#tbl_mrc = ${tbl1_3}
#tbl_mr = ${tbl1_1}

table1 = ${tblroot}/table_6_16_connect_60.mat
#table1 = ${tbl1_${net}}

# training #####################################################################
ds=1
val_size=500
dsname=all_mean32x32_ker7_bg_20100223.002945.face_conf00_eta_.00001
train=all_mean32x32_ker7_bg_20100223.002945.face_conf00_eta_.00001_train_500_1
val=all_mean32x32_ker7_bg_20100223.002945.face_conf00_eta_.00001_val_500_1
eta=.000005
iterations=150

# retraining ###################################################################
retrain=1
job_name_retraining=20100223.002945.face_conf00_eta_.00001
fp_name=_20100223.002945.face_conf00_eta_.00001
#retrain_weights=/home/sermanet/eblearn/demos/objrec/face/trained//20100223.002945.face_conf00_eta_.00001_net029.mat
retrain_weights=${root2}/trained//20100223.002945.face_conf00_eta_.00001_net029.mat

# preprocessing ################################################################
resize=mean
normalization_size=7

# tracking ####################################################################
mainsleep = 5
smooth_factor = 1.0
# display tracking
tracking_display = 0

# detection ####################################################################
#weights=${root2}/trained/20100227.175046.face_conf05_eta_.000005_retrain_1_net044.mat
classes=${root2}/trained/20100227.175046.face_conf05_eta_.000005_retrain_1_classes.mat
weights=E:/Source_code/EBLearn/demos/face/net00030.mat
#classes=${val_classes}
#threshold=0.1
gain=1
#input_dir = ${root2}/../../data/face/
input_dir = imgs
input_list = nens.gif
#show_conf = 1
input_height=-1#120#480
input_width=-1#160#640
#input_min=100
input_max=800
# multi-scaling type. 0: manually set each scale sizes, 1: manually set each
# scale step, 2: number of scales between min and max, 3: step factor between
# min and max, 4: 1 scale, the original image size.
scaling_type = 3
# scaling ratio between scales
scaling = 1.3
# scale factor of maximum resolution of the original resolution
max_scale = 1.0
# scale factor of minimum resolution of the original resolution
min_scale = 1.0
# number of detection threads
nthreads = 1
# randomize image input list (only works for 'directory' camera).
input_random = 0
# number of passes on the image input list (only works for 'directory' camera).
input_npasses = 1
# height factor to apply to bounding boxes
bbhfactor = 1
# width factor to apply to bounding boxes
bbwfactor = 1
# prune overlapping bounding boxes or not
pruning = 1
# minimum height ratio with smallest bbox to declare overlap
bbh_overlap = .67
# minimum width ratio with smallest bbox to declare overlap
bbw_overlap = 0
hzpad = .5 # vertical zero padding on each side
wzpad = .5 # horizontal zero padding on each side
mem_optimization = 1
max_bb_overlap = .7 # minimum ratio with smallest bbox to declare overlap
min_hcenter_dist = .3 # centers closer than this ratio over height cancel out
min_wcenter_dist = .3 # centers closer than this ratio over width cancel out
confidence_type = 2 # 0: sqrdist 1: single output 2: max other (recommended)

# detection display ############################################################
# output saving and display
save_detections=0
# save each classified frame and make a video out of it
save_video=1
# fps at which video should be constructed
save_video_fps=1
# if loaded a video and equal to 1, reuse video's fps
use_original_fps=0
# enable or disable display
display = 1
display_threads = 0 # each thread displays on its own
# only show classified input
minimal_display = 0
silent = 0 # minimize outputs to be printed
sync_outputs = 1 # synchronize output between threads
# display internal states of network
display_states = 0
display_min = -1.7
display_max = 1.7
display_in_min = 0 # input image min display range
display_in_max = 255 # input image max display range
display_bb_transparency = 0 #0.3
display_sleep = 0 #100000 # sleep in milliseconds after displaying
no_gui_quit = 1
ninternals=1
# demo display variables
queue1 = 0
qstep1 = 1
qheight1 = 5
qwidth1 = 2
queue2 = 0
qstep2 = 50
qheight2 = 5
qwidth2 = 5
# pre-camera variables (used before regular camera)
precamera = 0
precamdir = ${root2}/

# camera options: v4l2 opencv shmem video directory
camera = directory # v4l2 #opencv # directory
device = /dev/video0
file_pattern = ".*[.](png|jpg|jpeg|PNG|JPG|JPEG|bmp|BMP|ppm|PPM|pnm|PNM|pgm|PGM|gif|GIF)"
# limit of input video duration in seconds, 0 means no limit
input_video_max_duration=0

# step between input frames in seconds, 0 means no step
input_video_sstep=1500

job_name=20100227.175046.face_conf05_eta_.000005_retrain_1 # variable added by meta_trainer

#threshold = -1 #1.7 #.9
threshold = 0.9
threshold2 = ${threshold} #10
nms = 0
cluster_nms = 1
scaler_mode = 0s
bbox_max_overlap = .2 #.3 .4 .5 .6 .7 .8 .9
bbox_max_overlap2 = ${bbox_max_overlap}
bbox_max_center_dist = .9 #10
bbox_max_center_dist2 = ${bbox_max_center_dist} #.08 #10
bbox_max_wcenter_dist = .5 #10
bbox_max_wcenter_dist2 = ${bbox_max_wcenter_dist} #.08 #10
#display_sleep = 10000000 # sleep in milliseconds after displaying
scaling = 1.4 #2.2 1.9 1.6 1.3 1.1
# multi-scaling type. 0: manually set each scale sizes, 1: manually set each
# scale step, 2: number of scales between min and max, 3: step factor between
# min and max, 4: 1 scale, the original image size.
scaling_type = 3
max_scale = 1
#input_max = 288
show_extracted = 2

# DEBUGGING
#bbox_decision = 1


Hoang Nguyen

unread,
Aug 7, 2013, 2:42:22 AM8/7/13
to ebl...@googlegroups.com
There are threshold and threshold2 variables in best_dir.conf. Are they different?
resulting_face.PNG

Hoang Nguyen

unread,
Aug 13, 2013, 11:59:17 PM8/13/13
to ebl...@googlegroups.com
@the_minion: Please help me on this. Is the purpose of 'threshold' variable to display only detected regions having confidence larger than it? I did follow every step of your tutorials.

Thank  you.

soumith

unread,
Aug 14, 2013, 5:43:06 PM8/14/13
to ebl...@googlegroups.com
Hoang,

Try increasing the "threshold" variable further, say for example 0.9999 or 0.99999


On Tue, Aug 13, 2013 at 11:59 PM, Hoang Nguyen <nguyenhu...@gmail.com> wrote:
@the_minion: Please help me on this. Is the purpose of 'threshold' variable to display only detected regions having confidence larger than it? I did follow every step of your tutorials.

Thank  you.

--
You received this message because you are subscribed to the Google Groups "eblearn" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eblearn+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Hoang Nguyen

unread,
Aug 14, 2013, 10:32:11 PM8/14/13
to ebl...@googlegroups.com
Hello the_minion,

Thanks for your response. I tried threshold = 0.99999, but the only resulting window shows just the same. There are very low-confidence faces which I underlined.
resulting_face_099999.PNG

Hoang Nguyen

unread,
Aug 14, 2013, 10:35:48 PM8/14/13
to ebl...@googlegroups.com
For the reason of readability, I show my conf file here:

threshold = 0.99999

soumith

unread,
Aug 14, 2013, 10:43:11 PM8/14/13
to ebl...@googlegroups.com
Hmm, that looks weird. Let me check and get back to you. 


Message has been deleted

Hoang Nguyen

unread,
Aug 14, 2013, 11:01:20 PM8/14/13
to ebl...@googlegroups.com
Thank you in advance.

soumith

unread,
Aug 15, 2013, 11:48:53 AM8/15/13
to ebl...@googlegroups.com
Hoang,

Please add two additional variables:
pre_threshold = ${threshold}
post_threshold = ${threshold}

I'll try update the tutorial soon.
--
S


Hoang Nguyen

unread,
Aug 15, 2013, 2:05:04 PM8/15/13
to ebl...@googlegroups.com
It really works. Thank you so much. You make my day.
What is the difference between pre_threshold and post_threshold btw?

Sincerely,
Hoang.

soumith

unread,
Aug 15, 2013, 2:09:49 PM8/15/13
to ebl...@googlegroups.com
pre_threshold is the threshold to discard bounding boxes before nms (non-maximal suppression), and post_theshold is for after nms.
Inline image 1
voting nms illustration.png

Hoang Nguyen

unread,
Aug 17, 2013, 10:58:37 AM8/17/13
to ebl...@googlegroups.com
It's so clear. Regular NMS looks more reliable than voting IMO.
Thank you so much.
Reply all
Reply to author
Forward
0 new messages