-
Notifications
You must be signed in to change notification settings - Fork 20
/
distribute_training_data.py
50 lines (45 loc) · 1.17 KB
/
distribute_training_data.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
"""Rotate and flip training data so that there is a good distribution of orientations"""
from __future__ import print_function
import argparse
import training_data
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--output', '-o', default='outdata.csv', help="Set the output file name")
parser.add_argument('input', help="Specify input file name")
args = parser.parse_args()
data = training_data.training_data()
data.import_csv(args.input)
a, e = data.split()
a, c = a.split()
a, b = a.split()
c, d = c.split()
e, g = e.split()
e, f = e.split()
g, h = g.split()
print(a.size())
print(b.size())
print(c.size())
print(d.size())
print(e.size())
print(f.size())
print(g.size())
print(h.size())
b.hflip()
d.hflip()
f.hflip()
c.rotate(1)
d.rotate(1)
e.rotate(2)
f.rotate(2)
g.rotate(3)
h.rotate(3)
collect = training_data.training_data()
collect.merge(a)
collect.merge(b)
collect.merge(c)
collect.merge(d)
collect.merge(e)
collect.merge(f)
collect.merge(g)
collect.merge(h)
collect.export_csv(args.output)