36 lines
903 B
Python
36 lines
903 B
Python
#!/usr/bin/env python
|
||
# -*- coding: utf-8 -*-
|
||
"""
|
||
@project:
|
||
@File : otherperations
|
||
@Author : qiqq
|
||
@create_time : 2023/10/8 11:03
|
||
"""
|
||
|
||
import os
|
||
|
||
'''
|
||
根据bat(最原始版本) 和非bat(新版本)之间的差集 删除 相应的原图和标签
|
||
'''
|
||
#pv
|
||
basedir="/home/qiqq/q3dl/datalinan/taihuyuan_pv/"
|
||
with open("/home/qiqq/q3dl/datalinan/taihuyuan_pv/trainbat.txt" ,'r') as f1:
|
||
pvssource =[ i.strip("\n") for i in f1.readlines()]
|
||
|
||
with open("/home/qiqq/q3dl/datalinan/taihuyuan_pv/train.txt" ,'r') as f2:
|
||
pvn =[ i.strip("\n") for i in f2.readlines()]
|
||
|
||
pvvv=list(set(pvn).difference(set(pvssource))) # b中有而a中没有的
|
||
print(len(pvvv))
|
||
print(pvvv)
|
||
|
||
for i in pvvv:
|
||
imgpa=os.path.join(basedir,'images',i+'.png')
|
||
labelpa=os.path.join(basedir,'labels',i+'.png')
|
||
|
||
os.remove(imgpa)
|
||
os.remove(labelpa)
|
||
|
||
print("Wancheng")
|
||
|