diff --git a/deploy/pipeline/docs/tutorials/ppvehicle_retrograde.md b/deploy/pipeline/docs/tutorials/ppvehicle_retrograde.md index 57ba922ff35c63b4a74a51af6c7defef994878fe..8f229d16ac7f4edc1e860da38faf7ec1897ceecc 100644 --- a/deploy/pipeline/docs/tutorials/ppvehicle_retrograde.md +++ b/deploy/pipeline/docs/tutorials/ppvehicle_retrograde.md @@ -72,7 +72,7 @@ python deploy/pipeline/pipeline.py --config deploy/pipeline/config/infer_cfg_ppv #预测包含一个或多个视频的文件夹 python deploy/pipeline/pipeline.py --config deploy/pipeline/config/infer_cfg_ppvehicle.yml \ -o VEHICLE_RETROGRADE.enable=true \ - --video_dir=test_video.mp4\ + --video_dir=test_video \ --device=gpu ``` @@ -97,7 +97,8 @@ python deploy/pipeline/pipeline.py --config deploy/pipeline/config/infer_cfg_ppv **注意:** - 车道线中间线自动判断条件:在采样的视频段内同时有两个相反方向的车辆,且判断一次后固定,不再更新; - - 因摄像头角度以及2d视角问题,车道线中间线判断存在不准确情况,可在配置文件手动输入中间线坐标 + - 因摄像头角度以及2d视角问题,车道线中间线判断存在不准确情况; + - 可在配置文件手动输入中间线坐标.参考[车辆违章配置文件](../../config/examples/infer_cfg_vehicle_violation.yml) ## 方案说明 diff --git a/deploy/pipeline/docs/tutorials/ppvehicle_retrograde_en.md b/deploy/pipeline/docs/tutorials/ppvehicle_retrograde_en.md index 457f84bfa2084075c9396f95868b29f51b45e61f..650efe199a1df5bcf0a12458c78cc2bc2b8837de 100644 --- a/deploy/pipeline/docs/tutorials/ppvehicle_retrograde_en.md +++ b/deploy/pipeline/docs/tutorials/ppvehicle_retrograde_en.md @@ -70,7 +70,7 @@ python deploy/pipeline/pipeline.py --config deploy/pipeline/config/infer_cfg_ppv #For folder contains one or multiple videos python deploy/pipeline/pipeline.py --config deploy/pipeline/config/infer_cfg_ppvehicle.yml \ -o VEHICLE_RETROGRADE.enable=true \ - --video_dir=test_video.mp4\ + --video_dir=test_video \ --device=gpu ``` @@ -95,7 +95,8 @@ The result is shown as follow: **Note:** - Automatic judgment condition of lane line middle line: there are two vehicles in opposite directions in the sampled video segment, and the judgment is fixed after one time and will not be updated; - - Due to camera angle and 2d visual angle problems, the judgment of lane line middle line is inaccurate. You can manually enter the middle line coordinates in the configuration file + - Due to camera angle and 2d visual angle problems, the judgment of lane line middle line is inaccurate. + - You can manually enter the middle line coordinates in the configuration file.Example as [infer_cfg_vehicle_violation.yml](../../config/examples/infer_cfg_vehicle_violation.yml) ## Features to the Solution diff --git a/deploy/pipeline/pipeline.py b/deploy/pipeline/pipeline.py index 04fcfc28be29fa762122116b7c0c983ac5947688..3407f479e82a5a7ac96e29da98168df25ab44e20 100644 --- a/deploy/pipeline/pipeline.py +++ b/deploy/pipeline/pipeline.py @@ -24,8 +24,12 @@ import copy import threading import queue import time -from collections import Sequence, defaultdict +from collections import defaultdict from datacollector import DataCollector, Result +try: + from collections.abc import Sequence +except Exception: + from collections import Sequence # add deploy path of PaddleDetection to sys.path parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2))) diff --git a/deploy/pipeline/pphuman/action_infer.py b/deploy/pipeline/pphuman/action_infer.py index b04bd3f881bae8cf70434dd49bb3686d3b14c410..45c04ad5198c92466764eb58696921c9f11c8bc9 100644 --- a/deploy/pipeline/pphuman/action_infer.py +++ b/deploy/pipeline/pphuman/action_infer.py @@ -21,7 +21,10 @@ import numpy as np import math import paddle import sys -from collections import Sequence +try: + from collections.abc import Sequence +except Exception: + from collections import Sequence # add deploy path of PaddleDetection to sys.path parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2))) diff --git a/deploy/pipeline/pphuman/video_action_infer.py b/deploy/pipeline/pphuman/video_action_infer.py index e5e6c10eccd32aabb992393e24cd02362b4d493c..6a10355f385a633fb7c63d90398bc32998643b8e 100644 --- a/deploy/pipeline/pphuman/video_action_infer.py +++ b/deploy/pipeline/pphuman/video_action_infer.py @@ -21,8 +21,11 @@ import numpy as np import math import paddle import sys -from collections import Sequence import paddle.nn.functional as F +try: + from collections.abc import Sequence +except Exception: + from collections import Sequence # add deploy path of PaddleDetection to sys.path parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2))) diff --git a/deploy/pipeline/pphuman/video_action_preprocess.py b/deploy/pipeline/pphuman/video_action_preprocess.py index f6f9f11f7aee643ebfc070073f18f7e28bebf9dd..eccec048dbe98e6326f169924ab86e5317aaba41 100644 --- a/deploy/pipeline/pphuman/video_action_preprocess.py +++ b/deploy/pipeline/pphuman/video_action_preprocess.py @@ -14,9 +14,12 @@ import cv2 import numpy as np -from collections.abc import Sequence from PIL import Image import paddle +try: + from collections.abc import Sequence +except Exception: + from collections import Sequence class Sampler(object): diff --git a/deploy/pipeline/ppvehicle/vehicle_attr.py b/deploy/pipeline/ppvehicle/vehicle_attr.py index 4f7923f61e3aae73ece20c2125e5bd39d723e554..eb1b9423b64b3f1649f6e95790a0fa5b9fbcd7ff 100644 --- a/deploy/pipeline/ppvehicle/vehicle_attr.py +++ b/deploy/pipeline/ppvehicle/vehicle_attr.py @@ -21,7 +21,10 @@ import numpy as np import math import paddle import sys -from collections import Sequence +try: + from collections.abc import Sequence +except Exception: + from collections import Sequence # add deploy path of PaddleDetection to sys.path parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 3)))