未验证 提交 ec79a4af 编写于 作者: L LokeZhou 提交者: GitHub

[Pipeline] fix import Sequence for python 3.10 (#7739) (#7756)

上级 a39cf8fc
...@@ -72,7 +72,7 @@ python deploy/pipeline/pipeline.py --config deploy/pipeline/config/infer_cfg_ppv ...@@ -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 \ python deploy/pipeline/pipeline.py --config deploy/pipeline/config/infer_cfg_ppvehicle.yml \
-o VEHICLE_RETROGRADE.enable=true \ -o VEHICLE_RETROGRADE.enable=true \
--video_dir=test_video.mp4\ --video_dir=test_video \
--device=gpu --device=gpu
``` ```
...@@ -97,7 +97,8 @@ python deploy/pipeline/pipeline.py --config deploy/pipeline/config/infer_cfg_ppv ...@@ -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)
## 方案说明 ## 方案说明
......
...@@ -70,7 +70,7 @@ python deploy/pipeline/pipeline.py --config deploy/pipeline/config/infer_cfg_ppv ...@@ -70,7 +70,7 @@ python deploy/pipeline/pipeline.py --config deploy/pipeline/config/infer_cfg_ppv
#For folder contains one or multiple videos #For folder contains one or multiple videos
python deploy/pipeline/pipeline.py --config deploy/pipeline/config/infer_cfg_ppvehicle.yml \ python deploy/pipeline/pipeline.py --config deploy/pipeline/config/infer_cfg_ppvehicle.yml \
-o VEHICLE_RETROGRADE.enable=true \ -o VEHICLE_RETROGRADE.enable=true \
--video_dir=test_video.mp4\ --video_dir=test_video \
--device=gpu --device=gpu
``` ```
...@@ -95,7 +95,8 @@ The result is shown as follow: ...@@ -95,7 +95,8 @@ The result is shown as follow:
**Note:** **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; - 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 ## Features to the Solution
......
...@@ -24,8 +24,12 @@ import copy ...@@ -24,8 +24,12 @@ import copy
import threading import threading
import queue import queue
import time import time
from collections import Sequence, defaultdict from collections import defaultdict
from datacollector import DataCollector, Result 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 # add deploy path of PaddleDetection to sys.path
parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2))) parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2)))
......
...@@ -21,7 +21,10 @@ import numpy as np ...@@ -21,7 +21,10 @@ import numpy as np
import math import math
import paddle import paddle
import sys 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 # add deploy path of PaddleDetection to sys.path
parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2))) parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2)))
......
...@@ -21,8 +21,11 @@ import numpy as np ...@@ -21,8 +21,11 @@ import numpy as np
import math import math
import paddle import paddle
import sys import sys
from collections import Sequence
import paddle.nn.functional as F 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 # add deploy path of PaddleDetection to sys.path
parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2))) parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2)))
......
...@@ -14,9 +14,12 @@ ...@@ -14,9 +14,12 @@
import cv2 import cv2
import numpy as np import numpy as np
from collections.abc import Sequence
from PIL import Image from PIL import Image
import paddle import paddle
try:
from collections.abc import Sequence
except Exception:
from collections import Sequence
class Sampler(object): class Sampler(object):
......
...@@ -21,7 +21,10 @@ import numpy as np ...@@ -21,7 +21,10 @@ import numpy as np
import math import math
import paddle import paddle
import sys 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 # add deploy path of PaddleDetection to sys.path
parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 3))) parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 3)))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册