bakeup
This commit is contained in:
37
pipeline.py
37
pipeline.py
@ -16,12 +16,6 @@ from tracking.dotrack.dotracks_front import doFrontTracks
|
||||
from tracking.utils.drawtracks import plot_frameID_y2, draw_all_trajectories
|
||||
from utils.getsource import get_image_pairs, get_video_pairs
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
std_feature_path = r"\\192.168.1.28\share\测试_202406\contrast\std_features_2192_ft32vsft16"
|
||||
|
||||
def get_interbcd_inputenents():
|
||||
bcdpath = r"\\192.168.1.28\share\测试_202406\contrast\std_barcodes_2192"
|
||||
eventpath = r"\\192.168.1.28\share\测试_202406\0918"
|
||||
@ -49,8 +43,7 @@ def pipeline(eventpath, stdfeat_path=None, SourceType = "image"):
|
||||
outputs:
|
||||
|
||||
'''
|
||||
SourceType = "image" # image
|
||||
|
||||
# SourceType = "image" # image
|
||||
# eventpath = r"\\192.168.1.28\share\测试_202406\0918\images1\20240918-110822-1bc3902e-5a8e-4e23-8eca-fb3f02738551_6938314601726"
|
||||
|
||||
savepath = r"D:\contrast\detect"
|
||||
@ -71,16 +64,14 @@ def pipeline(eventpath, stdfeat_path=None, SourceType = "image"):
|
||||
|
||||
|
||||
event_tracks = []
|
||||
for vpath in vpaths:
|
||||
|
||||
for vpath in vpaths:
|
||||
'''事件结果文件夹'''
|
||||
save_dir_event = Path(savepath) / Path(eventname)
|
||||
if isinstance(vpath, list):
|
||||
save_dir_video = save_dir_event / Path("images")
|
||||
else:
|
||||
save_dir_video = save_dir_event / Path(str(Path(vpath).stem))
|
||||
|
||||
|
||||
|
||||
if not save_dir_video.exists():
|
||||
save_dir_video.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
@ -112,6 +103,11 @@ def pipeline(eventpath, stdfeat_path=None, SourceType = "image"):
|
||||
for CamerType, vts in event_tracks:
|
||||
if CamerType == 'front':
|
||||
edgeline = cv2.imread("./tracking/shopcart/cart_tempt/board_ftmp_line.png")
|
||||
|
||||
h, w = edgeline.shape[:2]
|
||||
nh, nw = h//2, w//2
|
||||
edgeline = cv2.resize(edgeline, (nw, nh), interpolation=cv2.INTER_AREA)
|
||||
|
||||
img_tracking = draw_all_trajectories(vts, edgeline, save_dir_event, CamerType, draw5p=True)
|
||||
illus[0] = img_tracking
|
||||
|
||||
@ -121,6 +117,11 @@ def pipeline(eventpath, stdfeat_path=None, SourceType = "image"):
|
||||
|
||||
if CamerType == 'back':
|
||||
edgeline = cv2.imread("./tracking/shopcart/cart_tempt/edgeline.png")
|
||||
|
||||
h, w = edgeline.shape[:2]
|
||||
nh, nw = h//2, w//2
|
||||
edgeline = cv2.resize(edgeline, (nw, nh), interpolation=cv2.INTER_AREA)
|
||||
|
||||
img_tracking = draw_all_trajectories(vts, edgeline, save_dir_event, CamerType, draw5p=True)
|
||||
illus[1] = img_tracking
|
||||
|
||||
@ -177,18 +178,14 @@ def main_loop():
|
||||
|
||||
def main():
|
||||
eventpath = r"D:\datasets\ym\exhibition\175836"
|
||||
|
||||
eventpath = r"\\192.168.1.28\share\测试视频数据以及日志\各模块测试记录\展厅测试\1120_展厅模型v801测试\扫A放A\20241121-144855-dce94b09-1100-43f1-92e8-33a1b538b159_6924743915848_6924743915848"
|
||||
|
||||
SourceType = 'image'
|
||||
stdfeat_path = None
|
||||
|
||||
pipeline(eventpath, stdfeat_path, SourceType)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
Reference in New Issue
Block a user