new updated

This commit is contained in:
王庆刚
2025-03-19 17:39:26 +08:00
parent 9b5b135fa3
commit f14faa323e
4 changed files with 53 additions and 18 deletions

View File

@ -101,10 +101,10 @@ def pipeline(
savepath_spdict.mkdir(parents=True, exist_ok=True)
pf_path = Path(savepath_spdict) / Path(str(evtname)+".pickle")
# if pf_path.exists():
# return
if pf_path.exists():
print(f"Pickle file have saved: {evtname}.pickle")
return
'''====================== 构造 ShoppingDict 模块 ======================='''
ShoppingDict = {"eventPath": eventpath,
"eventName": evtname,
@ -269,25 +269,25 @@ def main():
函数pipeline(),遍历事件文件夹,选择类型 image 或 video,
'''
parmDict = {}
evtdir = r"\\192.168.1.28\share\测试视频数据以及日志\全实时测试\V12\2025-3-3"
evtdir = r"D:\works\后台回传数据"
parmDict["SourceType"] = "video" # video, image
parmDict["savepath"] = r"D:\全实时\202502\result"
parmDict["savepath"] = r"D:\works\results"
parmDict["weights"] = r'D:\DetectTracking\ckpts\best_cls10_0906.pt'
evtdir = Path(evtdir)
k, errEvents = 0, []
for item in evtdir.iterdir():
if item.is_dir():
item = evtdir/Path("20250303-103058-074_6914973604223_6914973604223")
# item = evtdir/Path("20250303-103058-074_6914973604223_6914973604223")
parmDict["eventpath"] = item
# pipeline(**parmDict)
try:
pipeline(**parmDict)
except Exception as e:
errEvents.append(str(item))
k+=1
if k==1:
break
# k+=1
# if k==1:
# break
errfile = os.path.join(parmDict["savepath"], f'error_events.txt')
with open(errfile, 'w', encoding='utf-8') as f: