2019-05-05 16:42:19 +02:00
|
|
|
def main():
|
|
|
|
import Augmentor
|
2019-05-05 16:56:09 +02:00
|
|
|
|
2019-05-05 16:42:19 +02:00
|
|
|
p = [Augmentor.Pipeline("Images/TrainingImages/glass"),
|
|
|
|
Augmentor.Pipeline("Images/TrainingImages/metal"),
|
|
|
|
Augmentor.Pipeline("Images/TrainingImages/paper"),
|
|
|
|
Augmentor.Pipeline("Images/TrainingImages/plastic")]
|
2019-05-05 16:56:09 +02:00
|
|
|
|
2019-05-05 16:42:19 +02:00
|
|
|
for i in range(len(p)):
|
2019-05-05 16:56:09 +02:00
|
|
|
# Setting the operations to perform on image set
|
2019-05-05 16:42:19 +02:00
|
|
|
p[i].rotate(probability=0.7, max_left_rotation=10, max_right_rotation=10)
|
|
|
|
p[i].zoom(probability=0.5, min_factor=1.1, max_factor=1.5)
|
2019-05-05 16:56:09 +02:00
|
|
|
p[i].flip_random(probability=0.6)
|
|
|
|
p[i].skew(probability=0.7, magnitude=0.7)
|
2019-05-05 16:42:19 +02:00
|
|
|
|
|
|
|
# Size of training sample
|
2019-05-05 16:56:09 +02:00
|
|
|
p[i].sample(2000)
|
2019-05-05 03:20:33 +02:00
|
|
|
|
2019-05-05 16:42:19 +02:00
|
|
|
p[i].process()
|
2019-05-05 03:20:33 +02:00
|
|
|
|
2019-05-05 16:42:19 +02:00
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|
2019-05-05 03:20:33 +02:00
|
|
|
|