Created
February 17, 2018 20:46
-
-
Save audstanley/39d5e1ab576a0b4f54c4cd09dd66a46c to your computer and use it in GitHub Desktop.
Rename images for object Detection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from glob import glob | |
| from os import rename | |
| prefix = "tball" | |
| count = 0 | |
| for f in glob("*.jpg"): | |
| # remove .jpg at the end of the filename | |
| newFname = prefix + "_" + str(count).zfill(5) + ".jpg" | |
| print(newFname) | |
| rename(f, newFname) | |
| count += 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment