train
This commit is contained in:
19
delte_xml_imgs.py
Normal file
19
delte_xml_imgs.py
Normal file
@ -0,0 +1,19 @@
|
||||
import os
|
||||
import shutil
|
||||
xml_path = "paper_data/Annotations"
|
||||
imgs_path = "paper_data/images"
|
||||
newimg_path = "paper_data/new_images"
|
||||
|
||||
for xml in os.listdir(xml_path):
|
||||
img_name = xml.split(".")[0]+".jpg"
|
||||
# print(img_name)
|
||||
if img_name in os.listdir(imgs_path):
|
||||
img_path = f"{imgs_path}/{img_name}"
|
||||
shutil.move(img_path, newimg_path)
|
||||
else:
|
||||
print(xml)
|
||||
print("move done")
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user