当前位置:网站首页>Jpg format and XML format files are separated into different folders
Jpg format and XML format files are separated into different folders
2022-06-12 05:48:00 【LEO-max】
import os
import shutil
root = "./data"
dataset ="./data/datasets" # Files that need to be separated , namely image And xml Under this file
img = root + "/JPEGImages"
annotation = root + "/Annotations"
if not os.path.exists(img):
os.mkdir(img)
if not os.path.exists(annotation):
os.mkdir(annotation)
for x in os.scandir(dataset):
if x.name.endswith(".jpg"):
needpath = "./data/datasets/{name}".format(name=x.name)
shutil.move(needpath,img)
if x.name.endswith(".xml"):
needpath ="./data/datasets/{name}".format(name=x.name)
shutil.move(needpath,annotation)
边栏推荐
- Golang idea configures the agent to improve the speed of packages downloaded by go get
- Oracle EBS interface/api (34) - update vendor API
- Select gb28181, RTSP or RTMP for data push?
- 基于tensorflow的校园绿植识别
- Simple introduction to key Wizard
- Review notes of naturallanguageprocessing based on deep learning
- arp timer and arptables
- POI, easyexcel framework use
- Go 面向接口编程实战
- [long time series prediction] the [4] autocorrelation mechanism of aotoformer code explanation
猜你喜欢

Redis cache data consistency and problems

Select gb28181, RTSP or RTMP for data push?

Rtmp/rtsp/hls public network real available test address

Halcon uses points to fit a plane

Halcon 用点来拟合平面

16. Somme des trois plus proches

Understanding of distributed transactions

Makefile文件编写快速掌握

Stack and queue classic interview questions

IO to IO multiplexing from traditional network
随机推荐
[gin] gin framework for golang web development
Go 面向接口编程实战
Leetcode simple problem: converting an integer to the sum of two zero free integers
Json-c common APIs
Special materials | household appliances, white electricity, kitchen electricity
[daily question on niuke.com] two point search
BlockingQueue interface introduction
What is the project advance payment
Analysis of pointer
C language - how to define arrays
Introduction to Internet Protocol
Detailed explanation of WiFi 802.1x authentication process
Flex / fixed Upper, Middle and Lower (Mobile end)
flex/fixed上中下(移動端)
Market trend report, technical innovation and market forecast of Chinese stump crusher
Date ()
Laravel8 authentication login
CCF noi2022 quota allocation scheme
[machine learning] first day of introduction
Flex/fixed upper, middle and lower (mobile end)