Rename Files: Dataset preparation

If you need to rename your dataset, like I did, here there is my code

import os
import glob
#change IMG with the name of your current file
files = glob.glob('IMG*.jpg')
for file in files:
    # instead of cube use your new name
    os.rename(file, 'cube_{}'.format(file.split('_')[1]))


I hope it can be useful