Skip to content

Commit

Permalink
structure updates
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavz committed Jan 22, 2018
1 parent 213a7a0 commit 5965a02
Show file tree
Hide file tree
Showing 4 changed files with 150 additions and 4 deletions.
2 changes: 1 addition & 1 deletion csv_img_to_tfrecord.py → csv_to_tfrecord.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,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/{}'.format(directory))
image_path = os.path.join(os.getcwd(), 'data/{}/image's.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
5 changes: 2 additions & 3 deletions csv_to_yolo_txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,9 @@ def main():
CWD = os.getcwd()

for directory in ['train','eval']:

txt_path = 'data/{}/annotations/txt'.format(directory)
csv_path = 'data/{}_labels.csv'.format(directory)
img_path = CWD + '/data/{}/'.format(directory)
img_path = CWD + '/data/{}/images/'.format(directory)

if not os.path.exists(txt_path):
os.makedirs(txt_path)
Expand All @@ -104,4 +103,4 @@ def main():

if __name__ == '__main__':
main()


8 changes: 8 additions & 0 deletions egohands_dataset_cleaner.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,14 @@ def final_finish():
f = open("data/label_map.pbtxt","w")
f.write("item {\n id: 1\n name: 'hand'\n}")
f.close()
cwd = os.getcwd()
for directory in ['train','eval']:
src_dir = cwd+'/data/{}'.format(directory)
drc_dir = cwd+'/data/{}/images'.format(directory)
create_directory(drc_dir)
for file in os.listdir(src_dir):
if file.endswith(".jpg"):
sh.move(src_dir+'/'+file,drc_dir+'/'+file)

sh.rmtree('egohands')
#os.remove(EGO_HANDS_FILE)
Expand Down
139 changes: 139 additions & 0 deletions model/tiny-yolo-handsnet.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
[net]
# Training
# batch=64
# subdivisions=2
# Testing
batch=64
subdivisions=8
width=416
height=416
channels=3
momentum=0.9
decay=0.0005
angle=0
saturation = 1.5
exposure = 1.5
hue=.1

learning_rate=0.001
burn_in=1000
max_batches = 500200
policy=steps
steps=400000,450000
scales=.1,.1

[convolutional]
batch_normalize=1
filters=16
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=32
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=64
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=128
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=256
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=512
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=1

[convolutional]
batch_normalize=1
filters=1024
size=3
stride=1
pad=1
activation=leaky

###########

[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=30
activation=leaky

[convolutional]
size=1
stride=1
pad=1
filters=425
activation=linear

[region]
anchors = 0.57273, 0.677385, 1.87446, 2.06253, 3.33843, 5.47434, 7.88282, 3.52778, 9.77052, 9.16828
bias_match=1
classes=1
coords=4
num=5
softmax=1
jitter=.2
rescore=0

object_scale=5
noobject_scale=1
class_scale=1
coord_scale=1

absolute=1
thresh = .6
random=1

0 comments on commit 5965a02

Please sign in to comment.