I am trying to use an img to ascii generator (python code) and I wanted to use a for loop to generate several outputs with different img resolution for a single input.
img_src = 'data/input/'
img_dest = 'data/output/'
for image in os.listdir(img_src):
for size in range(100,1000,100):
input_name = img_src + image
output_name = img_dest + image.split('.')[0] + '_out_' + str(size) + '.jpg'
%run img2img.py --input input_name --output output_name --num_cols size
I'm doing something like the code above in a jupyter notebook (maybe not best but I like it for experimenting). However I'm having doubts if I can really use %run in a for loop as it is made to call bash commands, but I also need to use the -- options.
Does anyone have a better solution? Thank you in advance :)