Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions modelcenter/PP-HumanV2/APP/pipeline/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,8 @@ def __init__(self, args, cfg, is_video=True, multi_camera=False):

def set_file_name(self, path):
if path is not None:
self.file_name = path
if "." in path:
self.file_name = path.split(".")[-2]
else:
# use camera id
self.file_name = None
Expand Down Expand Up @@ -445,9 +446,9 @@ def predict_video(self, video_file, thread_idx=0):
frame_count = int(capture.get(cv2.CAP_PROP_FRAME_COUNT))
print("video fps: %d, frame_count: %d" % (fps, frame_count))

video_name,suffix = os.path.splitext(self.file_name)
out_path = video_name + "_output"+suffix
fourcc = int(capture.get(cv2.CAP_PROP_FOURCC))
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')
writer = cv2.VideoWriter(out_path, fourcc, fps, (width, height))

frame_id = 0
Expand Down
12 changes: 6 additions & 6 deletions modelcenter/PP-TinyPose/APP/det_keypoint_unite_infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = os.path.splitext(FLAGS.video_file)
video_name = video_name+"_output"+suffix

video_name,suffix = FLAGS.video_file.split('.')
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))

codec = int(capture.get(cv2.CAP_PROP_FOURCC))
writer = cv2.VideoWriter(video_name, codec, fps, (width, height))


fourcc = cv2.VideoWriter_fourcc(* 'mp4v')
writer = cv2.VideoWriter(video_name, fourcc, fps, (width, height))
index = 0
store_res = []
keypoint_smoothing = KeypointSmoothing(
Expand Down
9 changes: 5 additions & 4 deletions modelcenter/PP-Vehicle/APP/pipeline/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,8 @@ def __init__(self, args, cfg, is_video=True, multi_camera=False):

def set_file_name(self, path):
if path is not None:
self.file_name = path
if "." in path:
self.file_name = path.split(".")[-2]
else:
# use camera id
self.file_name = None
Expand Down Expand Up @@ -396,9 +397,9 @@ def predict_video(self, video_file, thread_idx=0):
frame_count = int(capture.get(cv2.CAP_PROP_FRAME_COUNT))
print("video fps: %d, frame_count: %d" % (fps, frame_count))

video_name,suffix = os.path.splitext(self.file_name)
out_path = video_name + "_output"+suffix
fourcc = int(capture.get(cv2.CAP_PROP_FOURCC))
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')
writer = cv2.VideoWriter(out_path, fourcc, fps, (width, height))

frame_id = 0
Expand Down