has_person_images = []
for file in has_person_files:
image_name = os.path.splitext(file)[0] + '.jpg'
has_person_images.append(image_name)
print()
# move files
new_label_path = "D:\\下載\\已挑出行人\\batch9-6.13\\label"
new_image_path = "D:\\下載\\已挑出行人\\batch9-6.13\\image"
is_exists = os.path.exists(new_label_path)
if not is_exists:
os.makedirs(new_label_path)
is_exists = os.path.exists(new_image_path)
if not is_exists:
os.makedirs(new_image_path)
for label_file in has_person_files:
shutil.move(label_path+label_file, new_label_path+label_file)
for image_file in has_person_images:
shutil.move(image_path + image_file, new_image_path + image_file)
print('done')
但是報了下面的錯誤:
D:\pycharm\anaconda3\python.exe D:/python資料/123/腳本/挑選person.py
Traceback (most recent call last):
File "D:/python資料/123/腳本/挑選person.py", line 30, in <module>
has_person_files = get_annot_has_person(label_path)
File "D:/python資料/123/腳本/挑選person.py", line 15, in get_annot_has_person
tree = ET.ElementTree(file=AnotPath + file_name)
File "D:\pycharm\anaconda3\lib\xml\etree\ElementTree.py", line 558, in __init__
self.parse(file)
File "D:\pycharm\anaconda3\lib\xml\etree\ElementTree.py", line 587, in parse
source = open(source, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'D:\\下載\\未挑出行人\\batch9-6.13\\batch9\\label130001_highway_pedestrian_large_20190601160554327_pos_699_931_28_79_src.xml'
FileNotFoundError: [Errno 2] No such file or directory: 'D:\\下載\\未挑出行人\\batch9-6.13\\batch9\\label130001_highway_pedestrian_large_20190601160554327_pos_699_931_28_79_src.xml'
FileNotFoundError: [Errno 2] No such file or directory: 'D:\\下載\\未挑出行人\\batch9-6.13\\batch9\\label130001_highway_pedestrian_large_20190601160554327_pos_699_931_28_79_src.xml'
FileNotFoundError: [Errno 2] No such file or directory: 'D:\\下載\\未挑出行人\\batch9-6.13\\batch9\\label130001_highway_pedestrian_large_20190601160554327_pos_699_931_28_79_src.xml'
我學到了一下幾點 Windows系統目錄結構與滲透的作用 常見Windows的服務詳解 Windows埠詳解 常用的Windows注冊表詳解 hacker DOS命令詳解(net user / type /md /rd/ dir /cd /net use copy、批處理 等) 利用dos命令制作 ......