20 lines
408 B
Python
20 lines
408 B
Python
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")
|
|
|
|
|
|
|
|
|