Skip to content

Commit

Permalink
edited cleaner
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavvz committed Jan 18, 2018
1 parent 150d99e commit 44ebbe0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion csv_img_to_tfrecord.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def create_tf_example(group, path, label_map_dict):
def main():
for directory in ['train','eval']:

image_path = os.path.join(os.getcwd(), 'data/{}/images'.format(directory))
image_path = os.path.join(os.getcwd(), 'data/{}'.format(directory))
csv_path = os.path.join(os.getcwd(), 'data/{}_labels.csv'.format(directory,directory))
output_path = os.path.join(os.getcwd(), 'data/{}.record'.format(directory))
label_map_dict = label_map_util.get_label_map_dict(os.path.join(os.getcwd(), 'data/label_map.pbtxt'))
Expand Down
4 changes: 4 additions & 0 deletions egohands_dataset_cleaner.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ def download_egohands_dataset(dataset_url, dataset_path):
rename_files("egohands/_LABELLED_SAMPLES/")

def final_finish():
f = open("data/label_map.pbtxt","w")
f.write("item {\n id: 1\n name: 'hand'\n}")
f.close()

sh.rmtree('egohands')
os.remove(EGO_HANDS_FILE)
print('> creating the dataset complete\n\
Expand Down
8 changes: 4 additions & 4 deletions howto_wiki
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim
# From the tensorflow/models/research directory
python object_detection/train.py \
--logtostderr \
--pipeline_config_path=/home/gustav/workspace/training_hands/model/ssd_mobilehandsnet.config \
--train_dir=/home/gustav/workspace/training_hands/model/train
--pipeline_config_path=/home/nvidia/workspace/deeptraining_hands/model/ssd_mobilehandsnet.config \
--train_dir=/home/nvidia/workspace/deeptraining_hands/model/train

## EVALUATION
# From the tensorflow/models/research directory
Expand Down Expand Up @@ -58,8 +58,8 @@ Train on a single GPU and eval on CPU, In object_detection/trainer.py
add after "session_config = tf.ConfigProto(allow_soft_placement=True, log_device_placement=False)" :

session_config.gpu_options.allow_growth = True
session_config.gpu_options.per_process_gpu_memory_fraction = 0.8 #optional
session_config.gpu_options.allocator_type ='BFC' # optional
session_config.gpu_options.per_process_gpu_memory_fraction = 0.9
session_config.gpu_options.allocator_type ='BFC'

For Evaluation Using only CPU: In object_detection/eval.py add behind "FLAGS = flags.FLAG" :

Expand Down
14 changes: 7 additions & 7 deletions model/ssd_mobilehandsnet.config
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ train_config: {
epsilon: 1.0
}
}
fine_tune_checkpoint: "/home/gustav/workspace/training_hands/model/ssd_mobilenet_checkpoints/model.ckpt"
fine_tune_checkpoint: "/home/nvidia/workspace/deeptraining_hands/model/ssd_mobilenet_checkpoints/model.ckpt"
from_detection_checkpoint: true
# Note: The below line limits the training process to 200K steps, which we
# empirically found to be sufficient enough to train the pets dataset. This
Expand All @@ -174,24 +174,24 @@ train_config: {

train_input_reader: {
tf_record_input_reader {
input_path: "/home/gustav/workspace/training_hands/data/train.record"
input_path: "/home/nvidia/workspace/deeptraining_hands/data/train.record"
}
label_map_path: "/home/gustav/workspace/training_hands/data/label_map.pbtxt"
label_map_path: "/home/nvidia/workspace/deeptraining_hands/data/label_map.pbtxt"
}

eval_config: {
num_examples: 1
num_visualizations: 1
num_examples: 400
num_visualizations: 3
# Note: The below line limits the evaluation process to 10 evaluations.
# Remove the below line to evaluate indefinitely.
max_evals: 10
}

eval_input_reader: {
tf_record_input_reader {
input_path: "/home/gustav/workspace/training_hands/data/eval.record"
input_path: "/home/nvidia/workspace/deeptraining_hands/data/eval.record"
}
label_map_path: "/home/gustav/workspace/training_hands/data/label_map.pbtxt"
label_map_path: "/home/nvidia/workspace/deeptraining_hands/data/label_map.pbtxt"
shuffle: false
num_readers: 1
num_epochs: 1
Expand Down

0 comments on commit 44ebbe0

Please sign in to comment.