# -*- coding:utf-8 -*-
# author = sw

import os

base_dir = '../pear_dataset/images/'

imgs_index = sorted([int(x.split('.')[0]) for x in os.listdir(base_dir)])
for i,j in enumerate(imgs_index) :
    os.rename(base_dir + str(j) + '.jpg',base_dir + str(i) + '.jpg')
79e33aff2f5e6d1563e27ce7c82c953b1914a481
<mask token>

<mask token>
for i, j in enumerate(imgs_index):
    os.rename(base_dir + str(j) + '.jpg', base_dir + str(i) + '.jpg')

<mask token>
base_dir = '../pear_dataset/images/'
imgs_index = sorted([int(x.split('.')[0]) for x in os.listdir(base_dir)])
for i, j in enumerate(imgs_index):
    os.rename(base_dir + str(j) + '.jpg', base_dir + str(i) + '.jpg')

import os
base_dir = '../pear_dataset/images/'
imgs_index = sorted([int(x.split('.')[0]) for x in os.listdir(base_dir)])
for i, j in enumerate(imgs_index):
    os.rename(base_dir + str(j) + '.jpg', base_dir + str(i) + '.jpg')

# -*- coding:utf-8 -*-
# author = sw

import os

base_dir = '../pear_dataset/images/'

imgs_index = sorted([int(x.split('.')[0]) for x in os.listdir(base_dir)])
for i,j in enumerate(imgs_index) :
    os.rename(base_dir + str(j) + '.jpg',base_dir + str(i) + '.jpg')