This commit is contained in:
王庆刚
2025-03-13 15:36:29 +08:00
parent 0efe8892f3
commit 9b5b135fa3
21 changed files with 837 additions and 258 deletions

View File

@ -191,10 +191,19 @@ def stdfeat_infer(imgPath, featPath, bcdSet=None):
return
def gen_bcd_features(imgpath, bcdpath, featpath, bcdSet=None):
def gen_bcd_features(imgpath, bcdpath, featpath, eventSourcePath):
''' 生成标准特征集 '''
'''1. 提取 imgpath 中样本地址,生成字典{barcode: [imgpath1, imgpath1, ...]}
并存储于: bcdpath, 格式为 barcode.pickle'''
bcdList = []
for evtname in os.listdir(eventSourcePath):
bname, ext = os.path.splitext(evtname)
evt = bname.split('_')
if len(evt)>=2 and evt[-1].isdigit() and len(evt[-1])>=10:
bcdList.append(evt[-1])
bcdSet = set(bcdList)
get_std_barcodeDict(imgpath, bcdpath, bcdSet)
'''2. 特征提取,并保存至文件夹 featpath 中,也根据 bcdSet 交集执行'''