Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
image_resolution = ast.literal_eval(image_resolution)
has_display = 'DISPLAY' in os.environ.keys() or sys.platform == 'win32'
video_writer = None
if filename is not None:
rotation_code = check_video_rotation(filename)
video = cv2.VideoCapture(filename)
assert video.isOpened()
else:
rotation_code = None
if disable_vidgear:
video = cv2.VideoCapture(camera_id)
assert video.isOpened()
else:
video = CamGear(camera_id).start()
model = SimpleHRNet(
hrnet_c,
hrnet_j,
hrnet_weights,
resolution=image_resolution,
multiperson=not single_person,
max_batch_size=max_batch_size,
device=device
)
while True:
t = time.time()
if filename is not None or disable_vidgear:
ret, frame = video.read()