Skip to content

Commit

Permalink
Fix oversights
Browse files Browse the repository at this point in the history
  • Loading branch information
prouast committed May 20, 2024
1 parent ec07bac commit a0c7d8d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/test_vitallens.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def create_mock_api_response(
except Exception as e:
return create_mock_response(status_code=400, json_data={"signal": None, "conf": None, "live": None, "message": "Error: {}".format(e)})
if video.shape[0] < API_MIN_FRAMES or video.shape[0] > API_MAX_FRAMES:
return create_mock_response(status_code=400, json_data={"signal": None, "conf": None, "live": None, "message": "Error: {}".format(e)})
return create_mock_response(status_code=400, json_data={"signal": None, "conf": None, "live": None, "message": "Error"})
return create_mock_response(
status_code=200,
json_data={"signal": np.random.rand(2, video.shape[0]).tolist(),
Expand Down
2 changes: 1 addition & 1 deletion vitallens/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def probe_video_inputs(
if video.dtype != np.uint8:
raise ValueError("video.dtype should be uint8, but got {}".format(video.dtype))
if len(video.shape) != 4 or video.shape[0] < API_MIN_FRAMES or video.shape[3] != 3:
raise ValueError("video should have shape (n_frames [>= {}], h, w, 3), but found {}".format(MIN_N_FRAMES, video.shape))
raise ValueError("video should have shape (n_frames [>= {}], h, w, 3), but found {}".format(API_MIN_FRAMES, video.shape))
return video.shape, fps
else:
raise ValueError("Invalid video {}, type {}".format(video, type(input)))
Expand Down

0 comments on commit a0c7d8d

Please sign in to comment.