Solved by ptrblck in post #4 
              
              
                I think the face cascade doesn’t find any faces and this loop: 
for (x, y, w, h) in faces:
    image_as_arr = np.array(frame)[y:y + w, x:x + h]
    return Image.fromarray(image_as_arr.astype('uint8'), 'RGB')

will be empty. 
Since you don’t have any other return statement, your transformation will r…