title: Why do I get 'numpy.ndarray' object has no attribute 'convert'?
body: <p>I currently working on a machine learning project, and I implemented data augmentation by myself for some reason. </p>
  
  <p>The type of image is </p>
  
  <blockquote>
    <p>'PIL.JpegImagePlugin.JpegImageFile'</p>
  </blockquote>
  
  <p>And I'd like to append my image to list called images.</p>
  
  <pre><code>#method "scale_augmentation" is self defined function. Return image.
  f_processed = self.scale_augmentation(image = f) 
  
  #error occurs here                
  self.images.append(Image.fromarray(f_processed.convert('RGB'), dtype=np.float32) / 255.)
  </code></pre>
  
  <p>I'm stuck with this error for so long and I've gone through many stack overflow questions regarding to this error. 
  Thanks in advance.</p>
  
  <hr>
  
  <p>Scale_augmentation function looks like this</p>
  
  <pre><code>def scale_augmentation(image, scale_range=(256, 400), crop_size=224):
  scale_size = np.random.randint(*scale_range)
  image = imresize(image, (scale_size, scale_size))
  image = random_crop(image, (crop_size, crop_size))
  return image
  </code></pre>
  
  <hr>
  
  <p>Also error looks like this</p>
  
  <pre><code>--&gt; 100 self.images.append(Image.fromarray(f_processed.convert('RGB'), dtype=np.float32) / 255.)
  AttributeError: 'numpy.ndarray' object has no attribute 'convert'
  </code></pre>