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

pr develop (#5703)

* fix PP-HumanV2 PP-Vehicle Single choice bug

* add PP-TinyPose model file

* modified PP-TinyPose auto download model

* del modelcenter/PP-TinyPose/APP/output_inference/

* add PP-TinyPose PP-HumanV2 PP-Vehicle video format checks

* fix PP-HumanV2 PP-TinyPose PP-Vehicle video adaptive code
上级 9aad2df0
......@@ -389,8 +389,7 @@ class PipePredictor(object):
def set_file_name(self, path):
if path is not None:
if "." in path:
self.file_name = path.split(".")[-2]
self.file_name = path
else:
# use camera id
self.file_name = None
......@@ -446,9 +445,9 @@ class PipePredictor(object):
frame_count = int(capture.get(cv2.CAP_PROP_FRAME_COUNT))
print("video fps: %d, frame_count: %d" % (fps, frame_count))
video_out_name = 'output' if self.file_name is None else self.file_name
out_path = video_out_name + "_output.mp4"
fourcc = cv2.VideoWriter_fourcc(*'mp4v')
video_name,suffix = os.path.splitext(self.file_name)
out_path = video_name + "_output"+suffix
fourcc = int(capture.get(cv2.CAP_PROP_FOURCC))
writer = cv2.VideoWriter(out_path, fourcc, fps, (width, height))
frame_id = 0
......
......@@ -107,18 +107,18 @@ def topdown_unite_predict_video(FLAGS,
capture = cv2.VideoCapture(camera_id)
else:
capture = cv2.VideoCapture(FLAGS.video_file)
video_name,suffix = FLAGS.video_file.split('.')
video_name = video_name+"_output."+suffix
video_name,suffix = os.path.splitext(FLAGS.video_file)
video_name = video_name+"_output"+suffix
# Get Video info : resolution, fps, frame count
width = int(capture.get(cv2.CAP_PROP_FRAME_WIDTH))
height = int(capture.get(cv2.CAP_PROP_FRAME_HEIGHT))
fps = int(capture.get(cv2.CAP_PROP_FPS))
frame_count = int(capture.get(cv2.CAP_PROP_FRAME_COUNT))
print("fps: %d, frame_count: %d" % (fps, frame_count))
fourcc = cv2.VideoWriter_fourcc(* 'mp4v')
writer = cv2.VideoWriter(video_name, fourcc, fps, (width, height))
codec = int(capture.get(cv2.CAP_PROP_FOURCC))
writer = cv2.VideoWriter(video_name, codec, fps, (width, height))
index = 0
store_res = []
keypoint_smoothing = KeypointSmoothing(
......
......@@ -329,8 +329,7 @@ class PipePredictor(object):
def set_file_name(self, path):
if path is not None:
if "." in path:
self.file_name = path.split(".")[-2]
self.file_name = path
else:
# use camera id
self.file_name = None
......@@ -397,9 +396,9 @@ class PipePredictor(object):
frame_count = int(capture.get(cv2.CAP_PROP_FRAME_COUNT))
print("video fps: %d, frame_count: %d" % (fps, frame_count))
video_out_name = 'output' if self.file_name is None else self.file_name
out_path = video_out_name + "_output.mp4"
fourcc = cv2.VideoWriter_fourcc(*'mp4v')
video_name,suffix = os.path.splitext(self.file_name)
out_path = video_name + "_output"+suffix
fourcc = int(capture.get(cv2.CAP_PROP_FOURCC))
writer = cv2.VideoWriter(out_path, fourcc, fps, (width, height))
frame_id = 0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册