未验证 提交 22736876 编写于 作者: W wangguanzhong 提交者: GitHub

refine pptracking import (#5421)

上级 8622966f
...@@ -40,7 +40,7 @@ from python.preprocess import decode_image ...@@ -40,7 +40,7 @@ from python.preprocess import decode_image
from python.visualize import visualize_box_mask, visualize_attr, visualize_pose, visualize_action 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.mot_sde_infer import SDE_Detector
from pptracking.python.visualize import plot_tracking from pptracking.python.mot.visualize import plot_tracking
class Pipeline(object): class Pipeline(object):
......
...@@ -33,8 +33,8 @@ sys.path.insert(0, parent_path) ...@@ -33,8 +33,8 @@ sys.path.insert(0, parent_path)
from benchmark_utils import PaddleInferBenchmark from benchmark_utils import PaddleInferBenchmark
from picodet_postprocess import PicoDetPostProcess from picodet_postprocess import PicoDetPostProcess
from preprocess import preprocess, Resize, NormalizeImage, Permute, PadStride, LetterBoxResize, decode_image from preprocess import preprocess, Resize, NormalizeImage, Permute, PadStride, LetterBoxResize, decode_image
from visualize import visualize_box_mask from mot.visualize import visualize_box_mask
from utils import argsparser, Timer, get_current_memory_mb from mot_utils import argsparser, Timer, get_current_memory_mb
# Global dictionary # Global dictionary
SUPPORT_MODELS = { SUPPORT_MODELS = {
...@@ -269,7 +269,7 @@ class Detector(object): ...@@ -269,7 +269,7 @@ class Detector(object):
if not os.path.exists(self.output_dir): if not os.path.exists(self.output_dir):
os.makedirs(self.output_dir) os.makedirs(self.output_dir)
out_path = os.path.join(self.output_dir, video_out_name) 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)) writer = cv2.VideoWriter(out_path, fourcc, fps, (width, height))
index = 1 index = 1
while (1): while (1):
......
...@@ -22,7 +22,7 @@ import paddle ...@@ -22,7 +22,7 @@ import paddle
from benchmark_utils import PaddleInferBenchmark from benchmark_utils import PaddleInferBenchmark
from preprocess import decode_image 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 from det_infer import Detector, get_test_images, print_arguments, bench_log, PredictConfig
# add python path # add python path
...@@ -31,8 +31,8 @@ parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2))) ...@@ -31,8 +31,8 @@ parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2)))
sys.path.insert(0, parent_path) sys.path.insert(0, parent_path)
from mot import JDETracker from mot import JDETracker
from utils import MOTTimer, write_mot_results from mot.utils import MOTTimer, write_mot_results
from visualize import plot_tracking, plot_tracking_dict from mot.visualize import plot_tracking, plot_tracking_dict
# Global dictionary # Global dictionary
MOT_JDE_SUPPORT_MODELS = { MOT_JDE_SUPPORT_MODELS = {
...@@ -264,7 +264,7 @@ class JDE_Detector(Detector): ...@@ -264,7 +264,7 @@ class JDE_Detector(Detector):
if not os.path.exists(self.output_dir): if not os.path.exists(self.output_dir):
os.makedirs(self.output_dir) os.makedirs(self.output_dir)
out_path = os.path.join(self.output_dir, video_out_name) 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)) writer = cv2.VideoWriter(out_path, fourcc, fps, (width, height))
frame_id = 1 frame_id = 1
......
...@@ -24,17 +24,17 @@ import paddle ...@@ -24,17 +24,17 @@ import paddle
from benchmark_utils import PaddleInferBenchmark from benchmark_utils import PaddleInferBenchmark
from preprocess import decode_image 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 # add python path
import sys 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) 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.tracker import JDETracker, DeepSORTTracker
from mot.utils import MOTTimer, write_mot_results, flow_statistic, get_crops, clip_box 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.utils import parse_bias
from mot.mtmct.postprocess import trajectory_fusion, sub_cluster, gen_res, print_mtmct_result from mot.mtmct.postprocess import trajectory_fusion, sub_cluster, gen_res, print_mtmct_result
......
...@@ -147,7 +147,6 @@ def argsparser(): ...@@ -147,7 +147,6 @@ def argsparser():
return parser return parser
class Times(object): class Times(object):
def __init__(self): def __init__(self):
self.time = 0. self.time = 0.
......
...@@ -32,7 +32,7 @@ sys.path.insert(0, parent_path) ...@@ -32,7 +32,7 @@ sys.path.insert(0, parent_path)
from pptracking.python.mot import JDETracker from pptracking.python.mot import JDETracker
from pptracking.python.mot.utils import MOTTimer, write_mot_results 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): class SDE_Detector(Detector):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册