changeset 400:8973abe35a9d

Adding comments and fixing out of bounds index
author humel
date Wed, 28 Apr 2010 00:49:41 -0400
parents 99905d9bc9dd
children 86d5e583e278
files data_generation/amt/amt_generate.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/data_generation/amt/amt_generate.py	Wed Apr 28 00:38:31 2010 -0400
+++ b/data_generation/amt/amt_generate.py	Wed Apr 28 00:49:41 2010 -0400
@@ -32,7 +32,7 @@
     f.close();g.close()
 
     ds_size = len(test_data)
-    rand_seq = numpy.random.random_integers(ds_size, size=(NUM_BATCHES,BATCH_SIZE))
+    rand_seq = numpy.random.random_integers(ds_size-1, size=(NUM_BATCHES,BATCH_SIZE))
 
     for i in range(NUM_BATCHES):
        for j in range(BATCH_SIZE):
@@ -64,7 +64,7 @@
     white_space = numpy.asarray(numpy.zeros((IMGSHP[0],WHITE_SPACE_THICKNESS))+255.,dtype='uint8')
 
     for i in range(len(seq)):
-        all_images += [numpy.asarray(seq[i].reshape((IMGSHP))*255.,dtype='uint8')]
+        all_images += [numpy.asarray(seq[i].reshape((IMGSHP)),dtype='uint8')]
 
     all_images_stacked = numpy.hstack(numpy.asarray([numpy.hstack((image,white_space)) for image in all_images]))
     return Image.fromarray(all_images_stacked)