Mercurial > ift6266
comparison data_generation/pipeline/pipeline.py @ 183:992ca8035a4d
Adapted pipeline to new directory structure
author | boulanni <nicolas_boulanger@hotmail.com> |
---|---|
date | Sat, 27 Feb 2010 19:21:57 -0500 |
parents | 72eee6a9f43f |
children | dd2df78fcf47 |
comparison
equal
deleted
inserted
replaced
182:2b6a28e4cadc | 183:992ca8035a4d |
---|---|
6 # This is intended to be run as a GIMP script | 6 # This is intended to be run as a GIMP script |
7 #from gimpfu import * | 7 #from gimpfu import * |
8 | 8 |
9 import sys, os, getopt | 9 import sys, os, getopt |
10 import numpy | 10 import numpy |
11 import filetensor as ft | 11 import ift6266.data_generation.transformations.filetensor as ft |
12 import random | 12 import random |
13 | 13 |
14 # To debug locally, also call with -s 100 (to stop after ~100) | 14 # To debug locally, also call with -s 100 (to stop after ~100) |
15 # (otherwise we allocate all needed memory, might be loonnng and/or crash | 15 # (otherwise we allocate all needed memory, might be loonnng and/or crash |
16 # if, lucky like me, you have an age-old laptop creaking from everywhere) | 16 # if, lucky like me, you have an age-old laptop creaking from everywhere) |
78 | 78 |
79 if DEBUG_X: | 79 if DEBUG_X: |
80 import pylab | 80 import pylab |
81 pylab.ion() | 81 pylab.ion() |
82 | 82 |
83 from ift6266.data_generation.transformations import * | 83 from ift6266.data_generation.transformations.PoivreSel import PoivreSel |
84 | 84 from ift6266.data_generation.transformations.thick import Thick |
85 from PoivreSel import PoivreSel | 85 from ift6266.data_generation.transformations.BruitGauss import BruitGauss |
86 from thick import Thick | 86 from ift6266.data_generation.transformations.DistorsionGauss import DistorsionGauss |
87 from BruitGauss import BruitGauss | 87 from ift6266.data_generation.transformations.PermutPixel import PermutPixel |
88 from DistorsionGauss import DistorsionGauss | 88 from ift6266.data_generation.transformations.gimp_script import GIMP1 |
89 from PermutPixel import PermutPixel | 89 from ift6266.data_generation.transformations.Rature import Rature |
90 from gimp_script import GIMP1 | 90 from ift6266.data_generation.transformations.contrast import Contrast |
91 from Rature import Rature | 91 from ift6266.data_generation.transformations.local_elastic_distortions import LocalElasticDistorter |
92 from contrast import Contrast | 92 from ift6266.data_generation.transformations.slant import Slant |
93 from local_elastic_distortions import LocalElasticDistorter | 93 from ift6266.data_generation.transformations.Occlusion import Occlusion |
94 from slant import Slant | 94 from ift6266.data_generation.transformations.add_background_image import AddBackground |
95 from Occlusion import Occlusion | 95 from ift6266.data_generation.transformations.affine_transform import AffineTransformation |
96 from add_background_image import AddBackground | 96 from ift6266.data_generation.transformations.ttf2jpg import ttf2jpg |
97 from affine_transform import AffineTransformation | 97 from ift6266.data_generation.transformations.pycaptcha.Facade import generateCaptcha |
98 from ttf2jpg import ttf2jpg | |
99 from Facade import generateCaptcha | |
100 | 98 |
101 if DEBUG: | 99 if DEBUG: |
102 from visualizer import Visualizer | 100 from visualizer import Visualizer |
103 # Either put the visualizer as in the MODULES_INSTANCES list | 101 # Either put the visualizer as in the MODULES_INSTANCES list |
104 # after each module you want to visualize, or in the | 102 # after each module you want to visualize, or in the |
381 | 379 |
382 cpx_it = range_complexity_iterator(probability_zero, max_complexity) | 380 cpx_it = range_complexity_iterator(probability_zero, max_complexity) |
383 pl.run(img_it, cpx_it) | 381 pl.run(img_it, cpx_it) |
384 pl.write_output(output_file_path, params_output_file_path, labels_output_file_path) | 382 pl.write_output(output_file_path, params_output_file_path, labels_output_file_path) |
385 | 383 |
386 _main() | 384 try: |
385 _main() | |
386 except: | |
387 print "Unexpected error" | |
387 | 388 |
388 if DEBUG_X: | 389 if DEBUG_X: |
389 pylab.ioff() | 390 pylab.ioff() |
390 pylab.show() | 391 pylab.show() |
391 | 392 |