Files
MPKFNet/PlayVideo.py
T
2021-09-15 11:33:58 +08:00

26 lines
659 B
Python
Executable File

import cv2
import argparse
parser = argparse.ArgumentParser(description="DensityVideodemo.")
parser.add_argument("video_path", default='', type=str,
help='Video path.')
parser.add_argument(
"opts",
help="Modify config options using the command-line",
default=None,
nargs=argparse.REMAINDER,
)
args = parser.parse_args()
print(args)
#filepath = "/data1/Hatcher/model/data_MPKFNet/rawdata/1_3.mp4"
cap = cv2.VideoCapture(args.video_path)
while (cap.isOpened()):
ret,frame = cap.read()
cv2.imshow('image',frame)
k = cv2.waitKey(10)
if(k&0xff == ord('q')):
break
cap.release()
cv2.destroyAllWindows()