Skip to content

Commit

Permalink
Make more general to support all net training
Browse files Browse the repository at this point in the history
  • Loading branch information
anson0910 committed Nov 28, 2015
1 parent dcbd24b commit 6493c1b
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions face_preprocess_10kUS/shuffle_write_negatives.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,31 @@
import os
import random

trainingNet = 12

data_base_dir = "/home/anson/face_pictures/negatives" # directory containing files of positives
start_neg_dir = 98
end_neg_dir = 98
file_list = [] # list to save image names

# load and open files to read and write
write_file_name = '/home/anson/caffe-master/data/face/all_negatives_48c.txt'
if trainingNet == 12:
start_neg_dir = 1
end_neg_dir = 33
# load and open files to read and write
write_file_name = '/home/anson/caffe-master/data/face/all_negatives.txt'
elif trainingNet == 24:
start_neg_dir = 98
end_neg_dir = 98
# load and open files to read and write
write_file_name = '/home/anson/caffe-master/data/face/all_negatives_24c.txt'
elif trainingNet == 48:
start_neg_dir = 99
end_neg_dir = 99
# load and open files to read and write
write_file_name = '/home/anson/caffe-master/data/face/all_negatives_48c.txt'


write_file = open(write_file_name, "w")

file_list = [] # list to save image names

for current_neg_dir in range(start_neg_dir, end_neg_dir + 1):
current_dir = data_base_dir + '/negative_' + str(current_neg_dir).zfill(2)

Expand Down

0 comments on commit 6493c1b

Please sign in to comment.