Skip to content

Commit 25cd793

Browse files
committed
Support prpy==0.3.4
1 parent eb128e8 commit 25cd793

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ dependencies = [
2525
"importlib_resources>=5.12",
2626
"numpy>=1.24",
2727
"onnxruntime>=1.15.0",
28-
"prpy[ffmpeg,numpy_min]>=0.3.2",
28+
"prpy[ffmpeg,numpy_min]>=0.3.4",
2929
"python-dotenv>=1.0",
3030
"pyyaml>=6.0.1",
3131
"requests>=2.32.0",

tests/test_vitallens.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import json
2323
import numpy as np
2424
from prpy.numpy.image import parse_image_inputs
25+
from prpy.numpy.physio import CALC_HR_MIN_T, CALC_RR_MIN_T
2526
import pytest
2627
import requests
2728
from unittest.mock import Mock, patch
@@ -163,7 +164,10 @@ def test_VitalLens_API_valid_response(request, process_signals, n_frames):
163164
assert resp_waveform_data.shape == (n_frames,)
164165
assert resp_waveform_conf.shape == (n_frames,)
165166
t = n_frames/test_video_fps
166-
assert all((key in vital_signs) if (process_signals and t > 8.) else (key not in vital_signs) for key in ["heart_rate", "respiratory_rate"])
167+
if process_signals and t >= CALC_HR_MIN_T: assert "heart_rate" in vital_signs
168+
else: assert "heart_rate" not in vital_signs
169+
if process_signals and t >= CALC_RR_MIN_T: assert "respiratory_rate" in vital_signs
170+
else: assert "respiratory_rate" not in vital_signs
167171
live = np.asarray(response_body["face"]["confidence"])
168172
assert live.shape == (n_frames,)
169173
state = np.asarray(response_body["state"]["data"])

0 commit comments

Comments
 (0)