title: OpenCv wont't save the image after modification
body: <p>Simply I am feeding the model the image and then putting a text on the image of the class the image belongs to, but the images are not showing up in my directory.</p>
  <p>My code:</p>
  <pre><code>import cv2
  import os
  from tensorflow.keras.models import load_model
  import numpy as np
  
  
  roi_path = 'other/DetectedFaces/'
  output_path = 'other/output/'
  model = load_model('weights/my_model')
  text = ''
  font = cv2.FONT_HERSHEY_SIMPLEX
  
  
  for index, image in enumerate(os.listdir(roi_path)):
      img = cv2.imread(os.path.join(roi_path, image))
      img = np.expand_dims(img, 0)
      
  
      try:
          prediction = np.argmax(model.predict(img))
          
          if prediction == 0:
              text = 'confused'
          elif prediction == 1:
              text = 'happy'
          elif prediction == 2:
              text = 'neutral'
          elif prediction == 3:
              text = 'none'
          elif prediction == 4:
              text = 'sad'
          elif prediction == 5:
              text = 'yawn'
              
      except: 
          print('Model prediction failed!')
          continue
              
      cv2.putText(img, text, (24, 85), font, 0.3, (0,255,0))
      cv2.imwrite(os.path.join(output_path,str(index)+'.jpg'), img)
      
      print('Successfully Predicted!'
  </code></pre>
  <p>The output:</p>
  <pre><code>Successfully Predicted!
  Successfully Predicted!
  Successfully Predicted!
  Successfully Predicted!
  Successfully Predicted!
  Successfully Predicted!
  Successfully Predicted!
  Successfully Predicted!
  Successfully Predicted!
  Successfully Predicted!
  Successfully Predicted!
  Successfully Predicted!
  </code></pre>
  <p>And this is what I get in my output directory</p>
  <p><a href="https://i.stack.imgur.com/MGAaa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MGAaa.png" alt="enter image description here" /></a></p>
  <p>After processing thousands of images all I get is one '.jpg' file that I can't even open.</p>
  <p>I am running on Ubuntu 20.04.</p>