mirror of
https://github.com/we0091234/yolov7_plate.git
synced 2025-09-26 21:01:13 +08:00
20 lines
561 B
Python
20 lines
561 B
Python
import os
|
|
|
|
def allFilePath(rootPath,allFIleList):
|
|
fileList = os.listdir(rootPath)
|
|
for temp in fileList:
|
|
if os.path.isfile(os.path.join(rootPath,temp)):
|
|
allFIleList.append(os.path.join(rootPath,temp))
|
|
else:
|
|
allFilePath(os.path.join(rootPath,temp),allFIleList)
|
|
|
|
|
|
val_path =r"/mnt/Gpan/Mydata/pytorchPorject/datasets/ccpd/val_detect/danger_data_val/"
|
|
|
|
file_list = []
|
|
allFilePath(val_path,file_list)
|
|
|
|
for file_ in file_list:
|
|
new_file = file_.replace(" ","")
|
|
print(file_,new_file)
|
|
os.rename(file_,new_file) |