update one2n.py

This commit is contained in:
王庆刚
2025-02-24 18:56:54 +08:00
parent 64248b1557
commit b657be729b
22 changed files with 279 additions and 123 deletions

View File

@ -136,7 +136,7 @@ def pipeline(
bname = os.path.basename(vpath[0])
if not isinstance(vpath, list):
CameraEvent["videoPath"] = vpath
bname = os.path.basename(vpath)
bname = os.path.basename(vpath).split('.')[0]
if bname.split('_')[0] == "0" or bname.find('back')>=0:
CameraEvent["cameraType"] = "back"
if bname.split('_')[0] == "1" or bname.find('front')>=0:
@ -264,19 +264,18 @@ def pipeline(
def main():
'''
函数pipeline(),遍历事件文件夹,选择类型 image 或 video,
'''
'''
parmDict = {}
evtdir = r"\\192.168.1.28\share\测试视频数据以及日志\算法全流程测试\202412\images"
evtdir = r"\\192.168.1.28\share\测试视频数据以及日志\全实时测试\V12\2025-2-21\比对\video"
parmDict["SourceType"] = "video" # video, image
parmDict["savepath"] = r"\\192.168.1.28\share\测试视频数据以及日志\算法全流程测试\202412\result"
parmDict["savepath"] = r"\\192.168.1.28\share\测试视频数据以及日志\全实时测试\result_V12"
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("20241209-160201-b97f7a0e-7322-4375-9f17-c475500097e9_6926265317292")
item = evtdir/Path("20250221-160936-893_6942506204855_6942506204855")
parmDict["eventpath"] = item
# pipeline(**parmDict)
@ -284,9 +283,9 @@ def main():
pipeline(**parmDict)
except Exception as e:
errEvents.append(str(item))
# k+=1
# if k==100:
# 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: