cysmith / neural-style-tf

TensorFlow (Python API) implementation of Neural Style
GNU General Public License v3.0
3.11k stars 828 forks source link

batch processing of all input images in one command #57

Open MehbubTgc opened 6 years ago

MehbubTgc commented 6 years ago

Hi, I followed and working fine . But, it's painful to do each image style transfers. Is there a way to batch process all images (input content_image) and styles_images by giving the directory of paths of the images folder. Then all images should be an output in one directory.

This will be very useful

Please help me out how can i achieve that?

cysmith commented 6 years ago

I use this to get all the file paths in a directory. from os import listdir from os.path import join, isfile, join img_paths = [join(img_dir, f) for f in listdir(img_dir) if isfile(join(img_dir, f))] Then just do for img_path in img_paths:

lele-lulu commented 6 years ago

Could you explain more please? what is following after for img_path in img_paths: and what about command line ? how could i run the code given as input a folder with many images and one image for style? Please help