title: Argparse input and output directory
body: <p>So I am trying to use python's argparse to get images from a directory modify them and store them in a new directory but I'm having trouble. </p>
  
  <p>For example say I have a directory named classes which has 50 different classes each having 100 different images.</p>
  
  <pre><code>classes &gt; {A(50), B(50), ...N(50)}
  </code></pre>
  
  <p>Then I should so something with these images and save them into a new different directory classes_2 </p>
  
  <pre><code>classes2 &gt; {A'(200), B'(200),...N'(200)}
  </code></pre>
  
  <p>I want to be able to specify something </p>
  
  <pre><code>python filename.py --input classes/A --dest classes_2/A'
  </code></pre>
  
  <p>How can I use argparse in order to do this. Also I'm using scipy imsave however I have to change the path in my code every single time.</p>
  
  <p>Edited:</p>
  
  <p>Ok thank you @nosklo, Now the problem that I'm having is this I'm using imgaug library for image augmentation and my code is this:</p>
  
  <p>suppose I have all the imports needed, cv2, imgaug, argparse, os, sys, etc. </p>
  
  <pre><code>parser = argparse.ArgumentParser()
  parser.add_argument('--input', help = 'input directory', required = True)
  parser.add_argument('--dest', help = 'destination directory', required = True)
  args = ap.parse_args()
  
  for filename in files:
      images = []
      image = cv.imread(filename)
      image_rgb = cv.cvtColor(image, cv.COLOR_BRG2RGB)
      images.append(image_rgb)
  
      #imgaug built-in functions
      seq = iaa.Sequential([ ... ])
  
      num_augs_per_image = 10
  
      # save images in format 001_07 
      # where 001 is the second image in your original data set 
      # and 07 is the 8th version of the 2nd image
      for i, image in enumerate(images):
          image_augs = seq.augment_images([image] * n_augs_per_image)
          for j, image_aug in enumerate(image_augs):
              result = os.path.join(args.dest, "%03d_%02d.jpg" % (i, j))
              with open(result, 'wb') as f:
                  f.write(image_aug)
  </code></pre>
  
  <p>I've also tried for the last part:</p>
  
  <pre><code>for i, image in enumerate(images):
              image_augs = seq.augment_images([image] * n_augs_per_image)
                  for j, image_aug in enumerate(image_augs):
                      misc.imsave(os.path.join("%03d_%02d.jpg" % (i, j)), image_aug)
  </code></pre>
  
  <p>However when I call the file python filename.py --input /path/classes/A --dest /path/classes/B I do not get any of images saved in the new directory. </p>
  
  <p>Like for example if I had 5 images in directory A I was expecting to have 50 images in directory B since I have augmented each image 10 times and want to save all versions of my original images.</p>