AITTSMD / MTCNN-Tensorflow

Reproduce MTCNN using Tensorflow
1.51k stars 713 forks source link

generate tfrecord four times #3

Open pribadihcr opened 7 years ago

pribadihcr commented 7 years ago

Hi @AITTSMD,

in step 10, run the scripts 4 times. it means just run it 4 times or change something in the script?

Thanks.

AITTSMD commented 7 years ago

@pribadihcr hi, run the scripts 4 times to generate tfrecords respectively. You should change variable item(keep the path of data(pos,neg,part or landmark)) in the get_dataset function.

T-mac93 commented 7 years ago

@AITTSMD But why we should do it four times ?why not do it just like PNet? I'm sorry that i can't get the point. can u explain to me briefly? thx!

AITTSMD commented 7 years ago

@T-mac93 Please refer the first item in Some Details in README

Zumbalamambo commented 7 years ago

@AITTSMD why do we need positive, negative, part face?

flankechen commented 7 years ago

change item in get_dataset function and also return values to pos_landmark.tfrecord in _get_output_filename function

houzidexiaoloulou commented 6 years ago

@AITTSMD 你好,请问如果运行gen_RNet_tfrecords.py4次,为什么仍然需要执行gen_imglist_rnet.py呢?我的理解是运行了gen_imglist_pnet.py中生成的将几种图(pos,neg,part or landmark)合在了一个txt中?那是否不需要再执行Run中的9和13呢?望赐教

AITTSMD commented 6 years ago

@houzidexiaoloulou gen_RNet_tfrecords.py只是用来产生tfrecord文件,并没有写在txt中~

kevinchang50105 commented 6 years ago

@AITTSMD 你好,你在README中寫了""RNet和ONet的各自需要生成4个tfrecord(pos,neg,part,landmark),因为要控制各部分的样本比例(1:3:1:1)"",跟PAPER上不太一樣,是因為實驗結果比較好嗎? 若是這樣,為什麼不在gen_imglist_rnet.py和gen_imglist_onet.py的時候就把比例設好,這樣就不用跑四次了,感謝回答!

T-mac93 commented 6 years ago

@kevinchang50105, 我就是这样做的,然后改了生成tfrecord的代码,我觉得这样做的结果也还是挺好的。

tpys commented 6 years ago

@AITTSMD @pribadihcr I have same question? why the ratio is different from the paper, which is 3:1:1:2 neg/pos/part/landmark ?

AITTSMD commented 6 years ago

@tpys Just follow the original paper~

tpys commented 6 years ago

@AITTSMD ok, thanks u

liyiming09 commented 6 years ago

@AITTSMD 你好,请问你说的修改get_dataset函数并运行四次指的是分别读取之前生成的neg part pos.txt,然后修改tfrecord文件名,分别保存四次对吗,所以get_dataset函数里并不应该读取之前代码里写的aug.txt,对吧?

rashmisgh commented 6 years ago

@AITTSMD sorry but I am not getting what changes we have to make in gen_RNet_tfrecords.py in step 10 to run it 4 times. what are the changes we have to make each time??

MrLeeBin93 commented 6 years ago

@rashmisgh def _get_output_filename(output_dir, item, name, net): ----# item = 'lamdmark', 'pos', 'part' or 'neg' ----return '%s/%s_landmark.tfrecord' % (output_dir, item) def get_dataset(dir, item, net='PNet'): ----if item == 'landmark': --------item = '%s/%s__%saug.txt' % (net, item, net) ----else: --------item = '%s/%s%s.txt' % (net, item, net) these two functions should be changed, you can change by youself

TINGCHEUNG commented 6 years ago

@MrLeeBin93 The code you write is different from the original in gen_RNet_tfrecord.py, is it need to be modified according to yours?

Huanyongji commented 6 years ago

@SavannahZhang Just like this: def get_dataset(dir, net):

item = 'imglists/PNet/train_%s_raw.txt' % net

#item = 'imglists/PNet/train_%s_landmark.txt' % net
#------uncomment below four line to generate four tfrecords for training RNet---------
#item = '%s/landmark_%s_aug.txt' % (net,net)        #if you want to generate landmark_landmark tfrecord,uncomment this line.
#item = '%s/pos_%s.txt' % (net,net)                  #if you want to generate pos_landmark tfrecord,uncomment this line.
#item = '%s/neg_%s.txt' % (net,net)                  #if you want to generate neg_landmark tfrecord,uncomment this line.
item = '%s/part_%s.txt' % (net,net)                  #if you want to generate part_landmark tfrecord,uncomment this line.

def _get_output_filename(output_dir, name, net):

st = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())

#return '%s/%s_%s_%s.tfrecord' % (output_dir, name, net, st)
#return '%s/train_PNet_landmark.tfrecord' % (output_dir)

#------uncomment below four line to generate four tfrecords for training RNet---------
#return '%s/landmark_landmark.tfrecord' % (output_dir)      #if you want to generate landmark_landmark tfrecord,uncomment this line.
#return '%s/pos_landmark.tfrecord' % (output_dir)         #if you want to generate pos_landmark tfrecord,uncomment this line.
#return '%s/neg_landmark.tfrecord' % (output_dir)         #if you want to generate neg_landmark tfrecord,uncomment this line.
return '%s/part_landmark.tfrecord' % (output_dir)         #if you want to generate part_landmark tfrecord,uncomment this line.
TINGCHEUNG commented 6 years ago

@Huanyongji Thanks a lot! It really helped!!

cw-plus commented 6 years ago

在第14步的时候,

  1. Run gen_ONet_tfrecords.py to generate tfrecords for ONet.(you should run this script four times to generate tfrecords of neg,pos,part and landmark respectively) 但代码里并没有像10步那样的代码呀怎么改啊?谢谢大家了~~