Re: cropping a random part of an image

2016-08-10 Thread drewes . mil
Ok, now it works for me! Thanks again! import random, os, time from PIL import Image INPATH = ('/home/.../Start/') OUTPATH = ('/home/.../Ziel/') dx = dy = 228 tilesPerImage = 25 files = os.listdir(INPATH) numOfImages = len(files) print(files) t = time.time() for file in files: im = Imag

Re: cropping a random part of an image

2016-08-10 Thread drewes . mil
Ok, did it :) import random, os, time from PIL import Image INPATH = ('/home/sdrewes/Desktop/Portaits/Bilder/Test/') OUTPATH = ('/home/sdrewes/Desktop/Portaits/Bilder/Gut_Crop/') dx = dy = 228 tilesPerImage = 100 files = os.listdir(INPATH) numOfImages = len(files) print(files) t = time.time() f

Re: cropping a random part of an image

2016-08-10 Thread drewes . mil
Hi Robin, I tried to understand and run your code, and I get the Error: "File "Rand_Crop.py", line 15, in with Image.open(os.path.join(INPATH, file)) as im: File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 528, in __getattr__ raise AttributeError(name) AttributeError: __exit_

Re: cropping a random part of an image

2016-08-10 Thread drewes . mil
Hi Peter, Hi Robin, thanks for your help, and especially for the code ;) @Peter: thanks for the links, I know, it is always better to write the code than to copy and paste! @Robin: the question, iḿ trying to answer is, if good pictures, in this case portraits, also have good "Parts", so if th

cropping a random part of an image

2016-08-09 Thread drewes . mil
Hi, I'm new to python and I have 30.000 pictures. I need to crop, let's say 100, parts of 256x256, randomly out of every picture. I cant find an answer in the net, would be nice if someone could help me out! Thanks! Steffen -- https://mail.python.org/mailman/listinfo/python-list

Saving Consol outputs in a python script

2016-05-03 Thread drewes . mil
Hello, I'm new to python and have a Question. I'm running a c++ file with a python script like: import os import subprocess subprocess.call(["~/caffe/build/examples/cpp_classification/classification", "deploy.prototxt", "this.caffemodel", "mean.binaryproto", "labels.txt", "Bild2.jpg"]) and i