From 545254d894d54b43ec25edb3a6003b8c63bbd00b Mon Sep 17 00:00:00 2001 From: GilLeviCV Date: Mon, 19 Oct 2015 17:43:18 +0300 Subject: [PATCH] added code for creating the data --- .../create_lmdb_test_fold_0.sh | 47 +++++ .../create_lmdb_test_fold_1.sh | 47 +++++ .../create_lmdb_test_fold_2.sh | 47 +++++ .../create_lmdb_test_fold_3.sh | 47 +++++ .../create_lmdb_test_fold_4.sh | 47 +++++ .../create_train_val_txt_files.py | 180 ++++++++++++++++++ .../make_mean_imag_test_fold_is_0.sh | 6 + .../make_mean_imag_test_fold_is_1.sh | 6 + .../make_mean_imag_test_fold_is_2.sh | 6 + .../make_mean_imag_test_fold_is_3.sh | 6 + .../make_mean_imag_test_fold_is_4.sh | 6 + 11 files changed, 445 insertions(+) create mode 100644 DataPreparationCode/create_lmdb_test_fold_0.sh create mode 100644 DataPreparationCode/create_lmdb_test_fold_1.sh create mode 100644 DataPreparationCode/create_lmdb_test_fold_2.sh create mode 100644 DataPreparationCode/create_lmdb_test_fold_3.sh create mode 100644 DataPreparationCode/create_lmdb_test_fold_4.sh create mode 100644 DataPreparationCode/create_train_val_txt_files.py create mode 100644 DataPreparationCode/make_mean_imag_test_fold_is_0.sh create mode 100644 DataPreparationCode/make_mean_imag_test_fold_is_1.sh create mode 100644 DataPreparationCode/make_mean_imag_test_fold_is_2.sh create mode 100644 DataPreparationCode/make_mean_imag_test_fold_is_3.sh create mode 100644 DataPreparationCode/make_mean_imag_test_fold_is_4.sh diff --git a/DataPreparationCode/create_lmdb_test_fold_0.sh b/DataPreparationCode/create_lmdb_test_fold_0.sh new file mode 100644 index 0000000..ebcb989 --- /dev/null +++ b/DataPreparationCode/create_lmdb_test_fold_0.sh @@ -0,0 +1,47 @@ +TOOLS=/home/ubuntu/repositories/caffe/build/tools +DATA=/home/ubuntu/AdienceFaces/DATA/aligned/ +DEF_FILES=/home/ubuntu/AdienceFaces/folds/train_val_txt_files_per_fold/test_fold_is_0 +OUT=/home/ubuntu/AdienceFaces/lmdb/Test_fold_is_0 + +# Set RESIZE=true to resize the images to 256x256. Leave as false if images have +# already been resized using another tool. +RESIZE=true +if $RESIZE; then + RESIZE_HEIGHT=256 + RESIZE_WIDTH=256 +else + RESIZE_HEIGHT=0 + RESIZE_WIDTH=0 +fi + +if [ ! -d "$DATA" ]; then + echo "Error: DATA is not a path to a directory: $DATA" + echo "Set the DATA variable in create_imagenet.sh to the path" \ + "where the ImageNet training data is stored." + exit 1 +fi + + + +echo "Creating train leveldb..." +GLOG_logtostderr=1 $TOOLS/convert_imageset.bin --resize_height=$RESIZE_HEIGHT --resize_width=$RESIZE_WIDTH --shuffle $DATA $DEF_FILES/age_train.txt $OUT/age_train_lmdb + +echo "Creating train subset leveldb..." +GLOG_logtostderr=1 $TOOLS/convert_imageset.bin --resize_height=$RESIZE_HEIGHT --resize_width=$RESIZE_WIDTH --shuffle $DATA $DEF_FILES/age_test.txt $OUT/age_test_lmdb + +echo "Creating val leveldb..." +GLOG_logtostderr=1 $TOOLS/convert_imageset.bin --resize_height=$RESIZE_HEIGHT --resize_width=$RESIZE_WIDTH --shuffle $DATA $DEF_FILES/age_val.txt $OUT/age_val_lmdb + + + +echo "Creating train leveldb..." +GLOG_logtostderr=1 $TOOLS/convert_imageset.bin --resize_height=$RESIZE_HEIGHT --resize_width=$RESIZE_WIDTH --shuffle $DATA $DEF_FILES/gender_train.txt $OUT/gender_train_lmdb + +echo "Creating train subset leveldb..." +GLOG_logtostderr=1 $TOOLS/convert_imageset.bin --resize_height=$RESIZE_HEIGHT --resize_width=$RESIZE_WIDTH --shuffle $DATA $DEF_FILES/gender_test.txt $OUT/gender_test_lmdb + +echo "Creating val leveldb..." +GLOG_logtostderr=1 $TOOLS/convert_imageset.bin --resize_height=$RESIZE_HEIGHT --resize_width=$RESIZE_WIDTH --shuffle $DATA $DEF_FILES/gender_val.txt $OUT/gender_val_lmdb + + + diff --git a/DataPreparationCode/create_lmdb_test_fold_1.sh b/DataPreparationCode/create_lmdb_test_fold_1.sh new file mode 100644 index 0000000..064b245 --- /dev/null +++ b/DataPreparationCode/create_lmdb_test_fold_1.sh @@ -0,0 +1,47 @@ +TOOLS=/home/ubuntu/repositories/caffe/build/tools +DATA=/home/ubuntu/AdienceFaces/DATA/aligned/ +DEF_FILES=/home/ubuntu/AdienceFaces/folds/train_val_txt_files_per_fold/test_fold_is_1 +OUT=/home/ubuntu/AdienceFaces/lmdb/Test_fold_is_1 + +# Set RESIZE=true to resize the images to 256x256. Leave as false if images have +# already been resized using another tool. +RESIZE=true +if $RESIZE; then + RESIZE_HEIGHT=256 + RESIZE_WIDTH=256 +else + RESIZE_HEIGHT=0 + RESIZE_WIDTH=0 +fi + +if [ ! -d "$DATA" ]; then + echo "Error: DATA is not a path to a directory: $DATA" + echo "Set the DATA variable in create_imagenet.sh to the path" \ + "where the ImageNet training data is stored." + exit 1 +fi + + + +echo "Creating train leveldb..." +GLOG_logtostderr=1 $TOOLS/convert_imageset.bin --resize_height=$RESIZE_HEIGHT --resize_width=$RESIZE_WIDTH --shuffle $DATA $DEF_FILES/age_train.txt $OUT/age_train_lmdb + +echo "Creating train subset leveldb..." +GLOG_logtostderr=1 $TOOLS/convert_imageset.bin --resize_height=$RESIZE_HEIGHT --resize_width=$RESIZE_WIDTH --shuffle $DATA $DEF_FILES/age_test.txt $OUT/age_test_lmdb + +echo "Creating val leveldb..." +GLOG_logtostderr=1 $TOOLS/convert_imageset.bin --resize_height=$RESIZE_HEIGHT --resize_width=$RESIZE_WIDTH --shuffle $DATA $DEF_FILES/age_val.txt $OUT/age_val_lmdb + + + +echo "Creating train leveldb..." +GLOG_logtostderr=1 $TOOLS/convert_imageset.bin --resize_height=$RESIZE_HEIGHT --resize_width=$RESIZE_WIDTH --shuffle $DATA $DEF_FILES/gender_train.txt $OUT/gender_train_lmdb + +echo "Creating train subset leveldb..." +GLOG_logtostderr=1 $TOOLS/convert_imageset.bin --resize_height=$RESIZE_HEIGHT --resize_width=$RESIZE_WIDTH --shuffle $DATA $DEF_FILES/gender_test.txt $OUT/gender_test_lmdb + +echo "Creating val leveldb..." +GLOG_logtostderr=1 $TOOLS/convert_imageset.bin --resize_height=$RESIZE_HEIGHT --resize_width=$RESIZE_WIDTH --shuffle $DATA $DEF_FILES/gender_val.txt $OUT/gender_val_lmdb + + + diff --git a/DataPreparationCode/create_lmdb_test_fold_2.sh b/DataPreparationCode/create_lmdb_test_fold_2.sh new file mode 100644 index 0000000..64038ae --- /dev/null +++ b/DataPreparationCode/create_lmdb_test_fold_2.sh @@ -0,0 +1,47 @@ +TOOLS=/home/ubuntu/repositories/caffe/build/tools +DATA=/home/ubuntu/AdienceFaces/DATA/aligned/ +DEF_FILES=/home/ubuntu/AdienceFaces/folds/train_val_txt_files_per_fold/test_fold_is_2 +OUT=/home/ubuntu/AdienceFaces/lmdb/Test_fold_is_2 + +# Set RESIZE=true to resize the images to 256x256. Leave as false if images have +# already been resized using another tool. +RESIZE=true +if $RESIZE; then + RESIZE_HEIGHT=256 + RESIZE_WIDTH=256 +else + RESIZE_HEIGHT=0 + RESIZE_WIDTH=0 +fi + +if [ ! -d "$DATA" ]; then + echo "Error: DATA is not a path to a directory: $DATA" + echo "Set the DATA variable in create_imagenet.sh to the path" \ + "where the ImageNet training data is stored." + exit 1 +fi + + + +echo "Creating train leveldb..." +GLOG_logtostderr=1 $TOOLS/convert_imageset.bin --resize_height=$RESIZE_HEIGHT --resize_width=$RESIZE_WIDTH --shuffle $DATA $DEF_FILES/age_train.txt $OUT/age_train_lmdb + +echo "Creating train subset leveldb..." +GLOG_logtostderr=1 $TOOLS/convert_imageset.bin --resize_height=$RESIZE_HEIGHT --resize_width=$RESIZE_WIDTH --shuffle $DATA $DEF_FILES/age_test.txt $OUT/age_test_lmdb + +echo "Creating val leveldb..." +GLOG_logtostderr=1 $TOOLS/convert_imageset.bin --resize_height=$RESIZE_HEIGHT --resize_width=$RESIZE_WIDTH --shuffle $DATA $DEF_FILES/age_val.txt $OUT/age_val_lmdb + + + +echo "Creating train leveldb..." +GLOG_logtostderr=1 $TOOLS/convert_imageset.bin --resize_height=$RESIZE_HEIGHT --resize_width=$RESIZE_WIDTH --shuffle $DATA $DEF_FILES/gender_train.txt $OUT/gender_train_lmdb + +echo "Creating train subset leveldb..." +GLOG_logtostderr=1 $TOOLS/convert_imageset.bin --resize_height=$RESIZE_HEIGHT --resize_width=$RESIZE_WIDTH --shuffle $DATA $DEF_FILES/gender_test.txt $OUT/gender_test_lmdb + +echo "Creating val leveldb..." +GLOG_logtostderr=1 $TOOLS/convert_imageset.bin --resize_height=$RESIZE_HEIGHT --resize_width=$RESIZE_WIDTH --shuffle $DATA $DEF_FILES/gender_val.txt $OUT/gender_val_lmdb + + + diff --git a/DataPreparationCode/create_lmdb_test_fold_3.sh b/DataPreparationCode/create_lmdb_test_fold_3.sh new file mode 100644 index 0000000..ecce061 --- /dev/null +++ b/DataPreparationCode/create_lmdb_test_fold_3.sh @@ -0,0 +1,47 @@ +TOOLS=/home/ubuntu/repositories/caffe/build/tools +DATA=/home/ubuntu/AdienceFaces/DATA/aligned/ +DEF_FILES=/home/ubuntu/AdienceFaces/folds/train_val_txt_files_per_fold/test_fold_is_3 +OUT=/home/ubuntu/AdienceFaces/lmdb/Test_fold_is_3 + +# Set RESIZE=true to resize the images to 256x256. Leave as false if images have +# already been resized using another tool. +RESIZE=true +if $RESIZE; then + RESIZE_HEIGHT=256 + RESIZE_WIDTH=256 +else + RESIZE_HEIGHT=0 + RESIZE_WIDTH=0 +fi + +if [ ! -d "$DATA" ]; then + echo "Error: DATA is not a path to a directory: $DATA" + echo "Set the DATA variable in create_imagenet.sh to the path" \ + "where the ImageNet training data is stored." + exit 1 +fi + + + +echo "Creating train leveldb..." +GLOG_logtostderr=1 $TOOLS/convert_imageset.bin --resize_height=$RESIZE_HEIGHT --resize_width=$RESIZE_WIDTH --shuffle $DATA $DEF_FILES/age_train.txt $OUT/age_train_lmdb + +echo "Creating train subset leveldb..." +GLOG_logtostderr=1 $TOOLS/convert_imageset.bin --resize_height=$RESIZE_HEIGHT --resize_width=$RESIZE_WIDTH --shuffle $DATA $DEF_FILES/age_test.txt $OUT/age_test_lmdb + +echo "Creating val leveldb..." +GLOG_logtostderr=1 $TOOLS/convert_imageset.bin --resize_height=$RESIZE_HEIGHT --resize_width=$RESIZE_WIDTH --shuffle $DATA $DEF_FILES/age_val.txt $OUT/age_val_lmdb + + + +echo "Creating train leveldb..." +GLOG_logtostderr=1 $TOOLS/convert_imageset.bin --resize_height=$RESIZE_HEIGHT --resize_width=$RESIZE_WIDTH --shuffle $DATA $DEF_FILES/gender_train.txt $OUT/gender_train_lmdb + +echo "Creating train subset leveldb..." +GLOG_logtostderr=1 $TOOLS/convert_imageset.bin --resize_height=$RESIZE_HEIGHT --resize_width=$RESIZE_WIDTH --shuffle $DATA $DEF_FILES/gender_test.txt $OUT/gender_test_lmdb + +echo "Creating val leveldb..." +GLOG_logtostderr=1 $TOOLS/convert_imageset.bin --resize_height=$RESIZE_HEIGHT --resize_width=$RESIZE_WIDTH --shuffle $DATA $DEF_FILES/gender_val.txt $OUT/gender_val_lmdb + + + diff --git a/DataPreparationCode/create_lmdb_test_fold_4.sh b/DataPreparationCode/create_lmdb_test_fold_4.sh new file mode 100644 index 0000000..941f1b7 --- /dev/null +++ b/DataPreparationCode/create_lmdb_test_fold_4.sh @@ -0,0 +1,47 @@ +TOOLS=/home/ubuntu/repositories/caffe/build/tools +DATA=/home/ubuntu/AdienceFaces/DATA/aligned/ +DEF_FILES=/home/ubuntu/AdienceFaces/folds/train_val_txt_files_per_fold/test_fold_is_4 +OUT=/home/ubuntu/AdienceFaces/lmdb/Test_fold_is_4 + +# Set RESIZE=true to resize the images to 256x256. Leave as false if images have +# already been resized using another tool. +RESIZE=true +if $RESIZE; then + RESIZE_HEIGHT=256 + RESIZE_WIDTH=256 +else + RESIZE_HEIGHT=0 + RESIZE_WIDTH=0 +fi + +if [ ! -d "$DATA" ]; then + echo "Error: DATA is not a path to a directory: $DATA" + echo "Set the DATA variable in create_imagenet.sh to the path" \ + "where the ImageNet training data is stored." + exit 1 +fi + + + +echo "Creating train leveldb..." +GLOG_logtostderr=1 $TOOLS/convert_imageset.bin --resize_height=$RESIZE_HEIGHT --resize_width=$RESIZE_WIDTH --shuffle $DATA $DEF_FILES/age_train.txt $OUT/age_train_lmdb + +echo "Creating train subset leveldb..." +GLOG_logtostderr=1 $TOOLS/convert_imageset.bin --resize_height=$RESIZE_HEIGHT --resize_width=$RESIZE_WIDTH --shuffle $DATA $DEF_FILES/age_test.txt $OUT/age_test_lmdb + +echo "Creating val leveldb..." +GLOG_logtostderr=1 $TOOLS/convert_imageset.bin --resize_height=$RESIZE_HEIGHT --resize_width=$RESIZE_WIDTH --shuffle $DATA $DEF_FILES/age_val.txt $OUT/age_val_lmdb + + + +echo "Creating train leveldb..." +GLOG_logtostderr=1 $TOOLS/convert_imageset.bin --resize_height=$RESIZE_HEIGHT --resize_width=$RESIZE_WIDTH --shuffle $DATA $DEF_FILES/gender_train.txt $OUT/gender_train_lmdb + +echo "Creating train subset leveldb..." +GLOG_logtostderr=1 $TOOLS/convert_imageset.bin --resize_height=$RESIZE_HEIGHT --resize_width=$RESIZE_WIDTH --shuffle $DATA $DEF_FILES/gender_test.txt $OUT/gender_test_lmdb + +echo "Creating val leveldb..." +GLOG_logtostderr=1 $TOOLS/convert_imageset.bin --resize_height=$RESIZE_HEIGHT --resize_width=$RESIZE_WIDTH --shuffle $DATA $DEF_FILES/gender_val.txt $OUT/gender_val_lmdb + + + diff --git a/DataPreparationCode/create_train_val_txt_files.py b/DataPreparationCode/create_train_val_txt_files.py new file mode 100644 index 0000000..c7f4b20 --- /dev/null +++ b/DataPreparationCode/create_train_val_txt_files.py @@ -0,0 +1,180 @@ +import os +import random +DATA_DIR='/home/ubuntu/AdienceFaces/DATA/aligned' +original_folds_dir='/home/ubuntu/AdienceFaces/folds/original_txt_files' +out_files_dir='/home/ubuntu/AdienceFaces/folds/train_val_txt_files_per_fold' + +age_list=['(0, 2)','(4, 6)','(8, 12)','(15, 20)','(25, 32)','(38, 43)','(48, 53)','(60, 100)'] +gender_list=['m','f'] +#note that since there's a bug in the txt files - (25 32) == (25 23) + + +for cur_test_fold_ind in range(5): + cur_fold_out_foldername='test_fold_is_{0}'.format(cur_test_fold_ind) + cur_fold_out_foldername=os.path.join(out_files_dir,cur_fold_out_foldername) + + if not os.path.exists(cur_fold_out_foldername): + os.mkdir(cur_fold_out_foldername) + + + #test files + cur_test_fold_filename='fold_{0}_data.txt'.format(cur_test_fold_ind) + cur_test_fold_filename=os.path.join(original_folds_dir,cur_test_fold_filename) + + with open(cur_test_fold_filename) as f: + def_lines=f.readlines() + + def_lines.pop(0) + + full_test_list=[] + for def_line in def_lines: + def_dic={} + + subject_dir=def_line.split('\t')[0] + image_subject=def_line.split('\t')[2] + + image_name='landmark_aligned_face.{0}.{1}'.format(image_subject,def_line.split('\t')[1]) + + image_age=def_line.split('\t')[3] + + + if image_age=='(25 23)': + image_age='(25 32)' + + + image_gender=def_line.split('\t')[4] + + + def_dic['subject_dir']=subject_dir + def_dic['image_name']=image_name + def_dic['image_subject']=image_subject + def_dic['image_age']=image_age + def_dic['image_gender']=image_gender + + full_test_list.append(def_dic) + + + images_num=len(full_test_list) + indices=random.sample(set(range(0,images_num)), images_num) + + + #creating text.txt file + age_test_txt_filename=os.path.join(cur_fold_out_foldername,'age_test.txt') + gender_test_txt_filename=os.path.join(cur_fold_out_foldername,'gender_test.txt') + + for f in [age_test_txt_filename,gender_test_txt_filename]: + if os.path.exists(f): + os.remove(f) + + age_test_txt_file=open(age_test_txt_filename,'w+') + gender_test_txt_file=open(gender_test_txt_filename,'w+') + + + for ind in indices: + subject_dir=full_test_list[ind]['subject_dir'] + image_name=full_test_list[ind]['image_name'] + image_age=full_test_list[ind]['image_age'] + image_gender=full_test_list[ind]['image_gender'] + image_subject=full_test_list[ind]['image_subject'] + + if image_age in age_list: + image_age_index=age_list.index(image_age) + s='{0}/{1} {2}\n'.format(subject_dir,image_name,image_age_index) + age_test_txt_file.write(s) + + if image_gender in gender_list: + image_gender_index=gender_list.index(image_gender) + s='{0}/{1} {2}\n'.format(subject_dir,image_name,image_gender_index) + gender_test_txt_file.write(s) + + + for f in [age_test_txt_file,gender_test_txt_file]: + f.close() + + + + full_train_list=[] + train_folds_indices=list(set(range(5)) - set([cur_test_fold_ind])) + + for train_fold_ind in train_folds_indices: + + #test files + cur_train_fold_filename='fold_{0}_data.txt'.format(train_fold_ind) + cur_train_fold_filename=os.path.join(original_folds_dir,cur_train_fold_filename) + + with open(cur_train_fold_filename) as f: + def_lines=f.readlines() + + def_lines.pop(0) + + for def_line in def_lines: + def_dic={} + + subject_dir=def_line.split('\t')[0] + image_subject=def_line.split('\t')[2] + image_name='landmark_aligned_face.{0}.{1}'.format(image_subject,def_line.split('\t')[1]) + + image_age=def_line.split('\t')[3] + + if image_age=='(25 23)': + image_age='(25 32)' + + + image_gender=def_line.split('\t')[4] + + + def_dic['subject_dir']=subject_dir + def_dic['image_name']=image_name + def_dic['image_subject']=image_subject + def_dic['image_age']=image_age + def_dic['image_gender']=image_gender + + full_train_list.append(def_dic) + + + + images_num=len(full_train_list) + indices=random.sample(set(range(0,images_num)), images_num) + + val_indices=indices[:images_num/10] + train_indices=indices[(images_num/10) + 1:] + train_subset_indices=indices[(images_num/10) + 1: 2* (images_num/10)] + #train files + + cases=['val','train','train_subset'] + + for case,indices in zip(cases,[val_indices,train_indices,train_subset_indices]): + + age_txt_filename=os.path.join(cur_fold_out_foldername,'age_{0}.txt'.format(case)) + gender_txt_filename=os.path.join(cur_fold_out_foldername,'gender_{0}.txt'.format(case)) + + for f in [age_txt_filename,gender_txt_filename]: + if os.path.exists(f): + os.remove(f) + + age_txt_file=open(age_txt_filename,'w+') + gender_txt_file=open(gender_txt_filename,'w+') + + + + for ind in indices: + subject_dir=full_train_list[ind]['subject_dir'] + image_name=full_train_list[ind]['image_name'] + image_age=full_train_list[ind]['image_age'] + image_gender=full_train_list[ind]['image_gender'] + image_subject=full_train_list[ind]['image_subject'] + if image_age in age_list: + image_age_index=age_list.index(image_age) + s='{0}/{1} {2}\n'.format(subject_dir,image_name,image_age_index) + age_txt_file.write(s) + + if image_gender in gender_list: + image_gender_index=gender_list.index(image_gender) + s='{0}/{1} {2}\n'.format(subject_dir,image_name,image_gender_index) + gender_txt_file.write(s) + + + for f in [age_txt_file,gender_txt_file]: + f.close() + + diff --git a/DataPreparationCode/make_mean_imag_test_fold_is_0.sh b/DataPreparationCode/make_mean_imag_test_fold_is_0.sh new file mode 100644 index 0000000..19d0949 --- /dev/null +++ b/DataPreparationCode/make_mean_imag_test_fold_is_0.sh @@ -0,0 +1,6 @@ +TOOLS=/home/ubuntu/repositories/caffe/build/tools +DATA=/home/ubuntu/AdienceFaces/lmdb/Test_fold_is_0/gender_train_lmdb +OUT=/home/ubuntu/AdienceFaces/mean_image/Test_folder_is_0 + +$TOOLS/compute_image_mean.bin $DATA $OUT/mean.binaryproto + diff --git a/DataPreparationCode/make_mean_imag_test_fold_is_1.sh b/DataPreparationCode/make_mean_imag_test_fold_is_1.sh new file mode 100644 index 0000000..4188bc1 --- /dev/null +++ b/DataPreparationCode/make_mean_imag_test_fold_is_1.sh @@ -0,0 +1,6 @@ +TOOLS=/home/ubuntu/repositories/caffe/build/tools +DATA=/home/ubuntu/AdienceFaces/lmdb/Test_fold_is_1/gender_train_lmdb +OUT=/home/ubuntu/AdienceFaces/mean_image/Test_folder_is_1 + +$TOOLS/compute_image_mean.bin $DATA $OUT/mean.binaryproto + diff --git a/DataPreparationCode/make_mean_imag_test_fold_is_2.sh b/DataPreparationCode/make_mean_imag_test_fold_is_2.sh new file mode 100644 index 0000000..1c8a1b9 --- /dev/null +++ b/DataPreparationCode/make_mean_imag_test_fold_is_2.sh @@ -0,0 +1,6 @@ +TOOLS=/home/ubuntu/repositories/caffe/build/tools +DATA=/home/ubuntu/AdienceFaces/lmdb/Test_fold_is_2/gender_train_lmdb +OUT=/home/ubuntu/AdienceFaces/mean_image/Test_folder_is_2 + +$TOOLS/compute_image_mean.bin $DATA $OUT/mean.binaryproto + diff --git a/DataPreparationCode/make_mean_imag_test_fold_is_3.sh b/DataPreparationCode/make_mean_imag_test_fold_is_3.sh new file mode 100644 index 0000000..5efb489 --- /dev/null +++ b/DataPreparationCode/make_mean_imag_test_fold_is_3.sh @@ -0,0 +1,6 @@ +TOOLS=/home/ubuntu/repositories/caffe/build/tools +DATA=/home/ubuntu/AdienceFaces/lmdb/Test_fold_is_3/gender_train_lmdb +OUT=/home/ubuntu/AdienceFaces/mean_image/Test_folder_is_3 + +$TOOLS/compute_image_mean.bin $DATA $OUT/mean.binaryproto + diff --git a/DataPreparationCode/make_mean_imag_test_fold_is_4.sh b/DataPreparationCode/make_mean_imag_test_fold_is_4.sh new file mode 100644 index 0000000..994e7ce --- /dev/null +++ b/DataPreparationCode/make_mean_imag_test_fold_is_4.sh @@ -0,0 +1,6 @@ +TOOLS=/home/ubuntu/repositories/caffe/build/tools +DATA=/home/ubuntu/AdienceFaces/lmdb/Test_fold_is_4/gender_train_lmdb +OUT=/home/ubuntu/AdienceFaces/mean_image/Test_folder_is_4 + +$TOOLS/compute_image_mean.bin $DATA $OUT/mean.binaryproto +