Mercurial > ift6266
annotate scripts/imgbg_test.py @ 415:1e9788ce1680
Added the parts concerning the transformations I'd announced I'd do: Local elastic deformations; occlusions; gimp transformations; salt and pepper noise; background images
author | fsavard |
---|---|
date | Thu, 29 Apr 2010 17:21:48 -0400 |
parents | bb26c12bb9f6 |
children |
rev | line source |
---|---|
142
bb26c12bb9f6
Added other auxiliary files corruption tests
boulanni <nicolas_boulanger@hotmail.com>
parents:
diff
changeset
|
1 #!/usr/bin/python |
bb26c12bb9f6
Added other auxiliary files corruption tests
boulanni <nicolas_boulanger@hotmail.com>
parents:
diff
changeset
|
2 |
bb26c12bb9f6
Added other auxiliary files corruption tests
boulanni <nicolas_boulanger@hotmail.com>
parents:
diff
changeset
|
3 import Image, cPickle |
bb26c12bb9f6
Added other auxiliary files corruption tests
boulanni <nicolas_boulanger@hotmail.com>
parents:
diff
changeset
|
4 |
bb26c12bb9f6
Added other auxiliary files corruption tests
boulanni <nicolas_boulanger@hotmail.com>
parents:
diff
changeset
|
5 f=open('/Tmp/image_net/filelist.pkl') |
bb26c12bb9f6
Added other auxiliary files corruption tests
boulanni <nicolas_boulanger@hotmail.com>
parents:
diff
changeset
|
6 image_files = cPickle.load(f) |
bb26c12bb9f6
Added other auxiliary files corruption tests
boulanni <nicolas_boulanger@hotmail.com>
parents:
diff
changeset
|
7 f.close() |
bb26c12bb9f6
Added other auxiliary files corruption tests
boulanni <nicolas_boulanger@hotmail.com>
parents:
diff
changeset
|
8 |
bb26c12bb9f6
Added other auxiliary files corruption tests
boulanni <nicolas_boulanger@hotmail.com>
parents:
diff
changeset
|
9 for i in range(len(image_files)): |
bb26c12bb9f6
Added other auxiliary files corruption tests
boulanni <nicolas_boulanger@hotmail.com>
parents:
diff
changeset
|
10 filename = '/Tmp/image_net/' + image_files[i] |
bb26c12bb9f6
Added other auxiliary files corruption tests
boulanni <nicolas_boulanger@hotmail.com>
parents:
diff
changeset
|
11 try: |
bb26c12bb9f6
Added other auxiliary files corruption tests
boulanni <nicolas_boulanger@hotmail.com>
parents:
diff
changeset
|
12 image = Image.open(filename).convert('L') |
bb26c12bb9f6
Added other auxiliary files corruption tests
boulanni <nicolas_boulanger@hotmail.com>
parents:
diff
changeset
|
13 except: |
bb26c12bb9f6
Added other auxiliary files corruption tests
boulanni <nicolas_boulanger@hotmail.com>
parents:
diff
changeset
|
14 print filename |
bb26c12bb9f6
Added other auxiliary files corruption tests
boulanni <nicolas_boulanger@hotmail.com>
parents:
diff
changeset
|
15 |