diff --git a/deploy/pphuman/pipeline.py b/deploy/pphuman/pipeline.py index c4f1901a08f921ea1af4d39f0a0355566cd588ab..f87035dc44bf14a7680729eee6c6271096854fcc 100644 --- a/deploy/pphuman/pipeline.py +++ b/deploy/pphuman/pipeline.py @@ -40,7 +40,7 @@ from python.preprocess import decode_image from python.visualize import visualize_box_mask, visualize_attr, visualize_pose, visualize_action from pptracking.python.mot_sde_infer import SDE_Detector -from pptracking.python.visualize import plot_tracking +from pptracking.python.mot.visualize import plot_tracking class Pipeline(object): diff --git a/deploy/pptracking/python/det_infer.py b/deploy/pptracking/python/det_infer.py index b586621f961e29093e0ec0c11ae1f9fddf6210a1..90a391e07209951cc80671c97f898b5cdd4bc0a9 100644 --- a/deploy/pptracking/python/det_infer.py +++ b/deploy/pptracking/python/det_infer.py @@ -33,8 +33,8 @@ sys.path.insert(0, parent_path) from benchmark_utils import PaddleInferBenchmark from picodet_postprocess import PicoDetPostProcess from preprocess import preprocess, Resize, NormalizeImage, Permute, PadStride, LetterBoxResize, decode_image -from visualize import visualize_box_mask -from utils import argsparser, Timer, get_current_memory_mb +from mot.visualize import visualize_box_mask +from mot_utils import argsparser, Timer, get_current_memory_mb # Global dictionary SUPPORT_MODELS = { @@ -269,7 +269,7 @@ class Detector(object): if not os.path.exists(self.output_dir): os.makedirs(self.output_dir) out_path = os.path.join(self.output_dir, video_out_name) - fourcc = cv2.VideoWriter_fourcc(*'mp4v') + fourcc = cv2.VideoWriter_fourcc(* 'mp4v') writer = cv2.VideoWriter(out_path, fourcc, fps, (width, height)) index = 1 while (1): diff --git a/deploy/pptracking/python/visualize.py b/deploy/pptracking/python/mot/visualize.py similarity index 100% rename from deploy/pptracking/python/visualize.py rename to deploy/pptracking/python/mot/visualize.py diff --git a/deploy/pptracking/python/mot_jde_infer.py b/deploy/pptracking/python/mot_jde_infer.py index 6a4e18abd8762010e8d4b37e6372b00e4781a8fd..6ce7a5e4f7e1fbb54503eb39c10754dd5cdee047 100644 --- a/deploy/pptracking/python/mot_jde_infer.py +++ b/deploy/pptracking/python/mot_jde_infer.py @@ -22,7 +22,7 @@ import paddle from benchmark_utils import PaddleInferBenchmark from preprocess import decode_image -from utils import argsparser, Timer, get_current_memory_mb +from mot_utils import argsparser, Timer, get_current_memory_mb from det_infer import Detector, get_test_images, print_arguments, bench_log, PredictConfig # add python path @@ -31,8 +31,8 @@ parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2))) sys.path.insert(0, parent_path) from mot import JDETracker -from utils import MOTTimer, write_mot_results -from visualize import plot_tracking, plot_tracking_dict +from mot.utils import MOTTimer, write_mot_results +from mot.visualize import plot_tracking, plot_tracking_dict # Global dictionary MOT_JDE_SUPPORT_MODELS = { @@ -264,7 +264,7 @@ class JDE_Detector(Detector): if not os.path.exists(self.output_dir): os.makedirs(self.output_dir) out_path = os.path.join(self.output_dir, video_out_name) - fourcc = cv2.VideoWriter_fourcc(*'mp4v') + fourcc = cv2.VideoWriter_fourcc(* 'mp4v') writer = cv2.VideoWriter(out_path, fourcc, fps, (width, height)) frame_id = 1 diff --git a/deploy/pptracking/python/mot_sde_infer.py b/deploy/pptracking/python/mot_sde_infer.py index 5e15adb21c10cf567ddf6452cf0b7335a20f8345..9eac91278bd966487c6e13434fd888cce32dbbe8 100644 --- a/deploy/pptracking/python/mot_sde_infer.py +++ b/deploy/pptracking/python/mot_sde_infer.py @@ -24,17 +24,17 @@ import paddle from benchmark_utils import PaddleInferBenchmark from preprocess import decode_image -from .utils import argsparser, Timer, get_current_memory_mb, _is_valid_video, video2frames -from .det_infer import Detector, get_test_images, print_arguments, bench_log, PredictConfig, load_predictor # add python path import sys -parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2))) +parent_path = os.path.abspath(os.path.join(__file__, *(['..']))) sys.path.insert(0, parent_path) +from det_infer import Detector, get_test_images, print_arguments, bench_log, PredictConfig, load_predictor +from mot_utils import argsparser, Timer, get_current_memory_mb, video2frames, _is_valid_video from mot.tracker import JDETracker, DeepSORTTracker from mot.utils import MOTTimer, write_mot_results, flow_statistic, get_crops, clip_box -from .visualize import plot_tracking, plot_tracking_dict +from mot.visualize import plot_tracking, plot_tracking_dict from mot.mtmct.utils import parse_bias from mot.mtmct.postprocess import trajectory_fusion, sub_cluster, gen_res, print_mtmct_result diff --git a/deploy/pptracking/python/utils.py b/deploy/pptracking/python/mot_utils.py similarity index 99% rename from deploy/pptracking/python/utils.py rename to deploy/pptracking/python/mot_utils.py index a4eddfe1b6e4893321448a52c07fe909cc4e2441..04f9420604a3cad3bc6cc8ae0333a12536c2393c 100644 --- a/deploy/pptracking/python/utils.py +++ b/deploy/pptracking/python/mot_utils.py @@ -147,7 +147,6 @@ def argsparser(): return parser - class Times(object): def __init__(self): self.time = 0. @@ -241,7 +240,7 @@ class Timer(Times): total_time = pre_time + infer_time + post_time if self.with_tracker: dic['tracking_time_s'] = round(track_time / max(1, self.img_num), - 4) if average else track_time + 4) if average else track_time total_time = total_time + track_time dic['total_time_s'] = round(total_time, 4) return dic diff --git a/deploy/python/mot_sde_infer.py b/deploy/python/mot_sde_infer.py index 3394db188064bd614116c1e49b9c4259d15b9a5c..4dd66dda0812d7143bc5f31cb033f8ac8305828c 100644 --- a/deploy/python/mot_sde_infer.py +++ b/deploy/python/mot_sde_infer.py @@ -32,7 +32,7 @@ sys.path.insert(0, parent_path) from pptracking.python.mot import JDETracker from pptracking.python.mot.utils import MOTTimer, write_mot_results -from pptracking.python.visualize import plot_tracking, plot_tracking_dict +from pptracking.python.mot.visualize import plot_tracking, plot_tracking_dict class SDE_Detector(Detector):