pipeline.py 等更新

This commit is contained in:
王庆刚
2025-01-21 18:22:56 +08:00
parent bfe7bc0fd5
commit 64248b1557
15 changed files with 106 additions and 77 deletions

View File

@ -158,6 +158,8 @@ def stdfeat_infer(imgPath, featPath, bcdSet=None):
feature /= np.linalg.norm(feature, axis=1)[:, None]
feature_ft32 = feature.astype(np.float32)
# float16
feature_ft16 = feature.astype(np.float16)
feature_ft16 /= np.linalg.norm(feature_ft16, axis=1)[:, None]
@ -173,7 +175,7 @@ def stdfeat_infer(imgPath, featPath, bcdSet=None):
##================== float32
stdbDict["barcode"] = barcode
stdbDict["imgpaths"] = imgpaths
stdbDict["feats_ft32"] = feature
stdbDict["feats_ft32"] = feature_ft32
stdbDict["feats_ft16"] = feature_ft16
stdbDict["feats_uint8"] = feature_uint8
@ -202,9 +204,13 @@ def gen_bcd_features(imgpath, bcdpath, featpath, bcdSet=None):
stdfeat_infer(bcdpath, featpath, bcdSet)
def main():
imgpath = r"\\192.168.1.28\share\数据\已完成数据\展厅数据\v1.0\比对数据\整理\zhantingBase"
bcdpath = r"D:\exhibition\dataset\bcdpath"
featpath = r"D:\exhibition\dataset\feats"
imgpath = r"\\192.168.1.28\share\数据\已完成数据\展厅数据\v2.0_abroad\比对数据\all_base_二筛"
bcdpath = r"D:\exhibition\dataset\bcdpath_abroad"
featpath = r"D:\exhibition\dataset\feats_abroad"
if not os.path.exists(bcdpath):
os.makedirs(bcdpath)
if not os.path.exists(featpath):
os.makedirs(featpath)
gen_bcd_features(imgpath, bcdpath, featpath)