Mercurial > ift6266
diff transformations/pipeline.py @ 109:9c45e0071b52
Adapté le générateur d'images de fontes pour utiliser en amont du pipeline
author | boulanni <nicolas_boulanger@hotmail.com> |
---|---|
date | Tue, 16 Feb 2010 13:10:06 -0500 |
parents | a7cd8dd3221c |
children | b84a0d009af8 |
line wrap: on
line diff
--- a/transformations/pipeline.py Mon Feb 15 16:17:48 2010 -0500 +++ b/transformations/pipeline.py Tue Feb 16 13:10:06 2010 -0500 @@ -54,6 +54,7 @@ from Occlusion import Occlusion from add_background_image import AddBackground from affine_transform import AffineTransformation +from ttf2jpg import ttf2jpg if DEBUG: from visualizer import Visualizer @@ -211,11 +212,12 @@ if prob_ocr: ocr_img = ft.read(nist.ocr_data) ocr_labels = ft.read(nist.ocr_labels) + ttf = ttf2jpg() for i in xrange(num_img): r = numpy.random.rand() if r <= prob_font: - pass #get font + yield ttf.generate_image() elif r <= prob_font + prob_captcha: pass #get captcha elif r <= prob_font + prob_captcha + prob_ocr: