temp / model_contract.json
mitsooko's picture
Upload 9 files
3ae0272
Raw History Blame Contribute Delete
23 kB
{
"schema_version": 1,
"disclaimer": "Research prototype. Not a medical device. Not for diagnosis. Pretrained third-party models; not clinically validated on this app.",
"environment": {
"python": "3.13.16",
"tensorflow": "2.21.0",
"torch": "2.11.0+cpu",
"onnx2tf": "2.6.9",
"mediapipe": "1.1.1",
"supervision": "0.31.1"
},
"rppg": {
"status": "GENERATED",
"reason": null,
"name": "TS-CAN",
"source_url": "https://github.com/ubicomplab/rPPG-Toolbox",
"source_commit": "b7500b848f84ad7f86e277b4612563b69f4f88f9",
"checkpoint": "final_model_release/UBFC-rPPG_TSCAN.pth",
"training_dataset": "UBFC-rPPG (dataset named by the checkpoint filename in the repository's final_model_release folder)",
"license": "Responsible Artificial Intelligence Source Code License (Version 1.1) per LICENSE at commit b7500b848f84",
"file": "rppg_tscan_fp32.tflite",
"sha256": "3ccd6df682f91cb128aa611b4a968c10ffaf70b5f36dc292248a8940d464858e",
"input": {
"shape": [
180,
72,
72,
6
],
"dtype": "float32",
"layout": "NHWC",
"frames_per_window": 180,
"stride_frames": 90,
"fps": 30.0,
"frame_size": [
72,
72
],
"channels_order": "RGB",
"preprocessing": "diff_and_standardize",
"preprocessing_details": "Input f: 180 consecutive 72x72 RGB face crops at 30 fps, float32 values 0..255, before normalization. D (channels 0..2): D[t] = (f[t+1]-f[t]) / (f[t+1]+f[t]+1e-7) for t = 0..178; D = D / std(D[0..178]) where std is taken over all frames, pixels and channels of the window; then D[179] = 0 is appended (padding after normalization); NaN -> 0. R (channels 3..5): R = (f - mean(f)) / std(f), mean and std over all frames, pixels and channels of the window; NaN -> 0. Channel concatenation order follows DATA_TYPE ['DiffNormalized','Standardized']. The toolbox applies these functions to a whole recording before chunking; this app applies them per 180-frame window. Verified source: rPPG-Toolbox commit b7500b848f84ad7f86e277b4612563b69f4f88f9, dataset/data_loader/BaseLoader.py:\ndef diff_normalize_data(data):\n \"\"\"Calculate discrete difference in video data along the time-axis and nornamize by its standard deviation.\"\"\"\n n, h, w, c = data.shape\n diffnormalized_len = n - 1\n diffnormalized_data = np.zeros((diffnormalized_len, h, w, c), dtype=np.float32)\n diffnormalized_data_padding = np.zeros((1, h, w, c), dtype=np.float32)\n for j in range(diffnormalized_len):\n diffnormalized_data[j, :, :, :] = (data[j + 1, :, :, :] - data[j, :, :, :]) / (\n data[j + 1, :, :, :] + data[j, :, :, :] + 1e-7)\n diffnormalized_data = diffnormalized_data / np.std(diffnormalized_data)\n diffnormalized_data = np.append(diffnormalized_data, diffnormalized_data_padding, axis=0)\n diffnormalized_data[np.isnan(diffnormalized_data)] = 0\n return diffnormalized_data\ndef standardized_data(data):\n \"\"\"Z-score standardization for video data.\"\"\"\n data = data - np.mean(data)\n data = data / np.std(data)\n data[np.isnan(data)] = 0\n return data"
},
"output": {
"shape": [
180,
1
],
"dtype": "float32",
"meaning": "normalized pulse first derivative",
"postprocess": "cumsum_then_detrend"
},
"parity": {
"max_abs_diff": 1.7881393432617188e-06,
"pearson_r": 0.9999999999998229
}
},
"emotion": {
"status": "GENERATED",
"reason": null,
"name": "HSEmotion enet_b0_8_va_mtl",
"variant": "enet_b0_8_va_mtl",
"source_url": "https://github.com/av-savchenko/face-emotion-recognition/raw/main/models/affectnet_emotions/onnx/enet_b0_8_va_mtl.onnx",
"license": "Apache License (Version 2.0) per https://github.com/av-savchenko/face-emotion-recognition/raw/main/LICENSE",
"file": "emotion_enet_b0_fp32.tflite",
"sha256": "8663a90e4017e77bce8cb9d8bf6389c9f7cbacc82543ab7d78c6bf00372f487c",
"input": {
"shape": [
1,
224,
224,
3
],
"dtype": "float32",
"layout": "NHWC",
"color_order": "RGB",
"mean": [
0.485,
0.456,
0.406
],
"std": [
0.229,
0.224,
0.225
],
"scale": "pixel/255"
},
"output": {
"shape": [
1,
10
],
"dtype": "float32",
"labels": [
"Anger",
"Contempt",
"Disgust",
"Fear",
"Happiness",
"Neutral",
"Sadness",
"Surprise"
],
"activation": "logits",
"valence_index": 8,
"arousal_index": 9
},
"parity": {
"max_abs_diff": 2.1457672119140625e-06
}
},
"face_landmarker": {
"status": "GENERATED",
"reason": null,
"file": "face_landmarker.task",
"sha256": "64184e229b263107bc2b804c6625db1341ff2bb731874b0bcc2fe6544e0bc9ff",
"source_url": "https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/1/face_landmarker.task",
"num_landmarks_used": 468,
"blendshapes": true,
"facial_transformation_matrix": true
},
"landmark_constants_file": "landmark_constants.json",
"coordinate_golden_file": "coordinate_golden.json",
"verify": [
{
"item": "rppg.repo",
"status": "VERIFIED",
"detail": "git clone https://github.com/ubicomplab/rPPG-Toolbox.git at commit b7500b848f84ad7f86e277b4612563b69f4f88f9"
},
{
"item": "rppg.license",
"status": "VERIFIED",
"detail": "Responsible Artificial Intelligence Source Code License (Version 1.1) per LICENSE at commit b7500b848f84"
},
{
"item": "rppg.checkpoint",
"status": "VERIFIED",
"detail": "UBFC-rPPG_TSCAN.pth (8922589 bytes); available: ['BP4D_BigSmall_Multitask_Fold1.pth', 'BP4D_BigSmall_Multitask_Fold2.pth', 'BP4D_BigSmall_Multitask_Fold3.pth', 'BP4D_PseudoLabel_DeepPhys.pth', 'BP4D_PseudoLabel_EfficientPhys.pth', 'BP4D_PseudoLabel_PhysNet_DiffNormalized.pth', 'BP4D_PseudoLabel_TSCAN.pth', 'MA-UBFC_deepphys.pth', 'MA-UBFC_efficientphys.pth', 'MA-UBFC_physnet.pth', 'MA-UBFC_tscan.pth', 'PURE_DeepPhys.pth', 'PURE_EfficientPhys.pth', 'PURE_FactorizePhys_FSAM_Res.pth', 'PURE_PhysFormer_DiffNormalized.pth', 'PURE_PhysMamba_DiffNormalized.pth', 'PURE_PhysNet_DiffNormalized.pth', 'PURE_RhythmFormer.pth', 'PURE_TSCAN.pth', 'PURE_iBVPNet.pth', 'SCAMPS_DeepPhys.pth', 'SCAMPS_EfficientPhys.pth', 'SCAMPS_FactorizePhys_FSAM_Res.pth', 'SCAMPS_PhysFormer_DiffNormalized.pth', 'SCAMPS_PhysNet_DiffNormalized.pth', 'SCAMPS_TSCAN.pth', 'UBFC-rPPG_DeepPhys.pth', 'UBFC-rPPG_EfficientPhys.pth', 'UBFC-rPPG_FactorizePhys_FSAM_Res.pth', 'UBFC-rPPG_PhysFormer_DiffNormalized.pth', 'UBFC-rPPG_PhysMamba_DiffNormalized.pth', 'UBFC-rPPG_PhysNet_DiffNormalized.pth', 'UBFC-rPPG_RhythmFormer.pth', 'UBFC-rPPG_TSCAN.pth', 'iBVP_EfficientPhys.pth', 'iBVP_FactorizePhys_FSAM_Res.pth']"
},
{
"item": "rppg.config_frame_depth_img_size",
"status": "VERIFIED",
"detail": "configs referencing UBFC-rPPG_TSCAN.pth: [{'file': 'configs/infer_configs/UBFC-rPPG_MMPD_TSCAN_BASIC.yaml', 'frame_depth': ['10'], 'resize_h': ['72'], 'data_type': [\" 'DiffNormalized','Standardized' \"], 'chunk_length': ['180']}, {'file': 'configs/infer_configs/UBFC-rPPG_PURE_TSCAN_BASIC.yaml', 'frame_depth': ['10'], 'resize_h': ['72'], 'data_type': [\" 'DiffNormalized','Standardized' \"], 'chunk_length': ['180']}, {'file': 'configs/infer_configs/UBFC-rPPG_UBFC-PHYS_TSCAN_BASIC.yaml', 'frame_depth': ['10'], 'resize_h': ['72'], 'data_type': [\" 'DiffNormalized','Standardized' \"], 'chunk_length': ['210']}]"
},
{
"item": "rppg.model_class",
"status": "VERIFIED",
"detail": "TSCAN imported from neural_methods/model/TS_CAN.py; 24 tensors loaded strict=True after stripping 'module.'"
},
{
"item": "rppg.channel_order",
"status": "VERIFIED",
"detail": "UBFCrPPGLoader converts frames with cv2.COLOR_BGR2RGB"
},
{
"item": "rppg.preprocessing",
"status": "VERIFIED",
"detail": "diff_normalize_data and standardized_data executed from repo source and matched the written formula (atol 1e-4)"
},
{
"item": "rppg.tsm_cat_equivalence",
"status": "VERIFIED",
"detail": "max |repo TSM - torch.cat TSM| on the test window = 0"
},
{
"item": "rppg.conversion",
"status": "VERIFIED",
"detail": "variant=repo, backend=tf_converter, candidate=saved_model->TFLiteConverter float32 (optimizations=[]), exporter=torchscript opset 17, runtime=tf.lite.Interpreter(OpResolverType.BUILTIN), analyzer=tf.lite.experimental.Analyzer.analyze"
},
{
"item": "emotion.labels_and_preprocessing",
"status": "VERIFIED",
"detail": "https://github.com/av-savchenko/face-emotion-recognition/raw/main/emotiefflib/facial_analysis.py: labels=['Anger', 'Contempt', 'Disgust', 'Fear', 'Happiness', 'Neutral', 'Sadness', 'Surprise'], checks={'mean': True, 'std': True, 'img_size_224': True, 'scale_div_255': True, 'mtl_slice': True}"
},
{
"item": "emotion.valence_arousal_order",
"status": "ASSUMED",
"detail": "source slices scores[:, :-2] as expression logits; index 8 = valence, 9 = arousal follows the 'va' model name"
},
{
"item": "emotion.license",
"status": "VERIFIED",
"detail": "Apache License (Version 2.0) per https://github.com/av-savchenko/face-emotion-recognition/raw/main/LICENSE"
},
{
"item": "emotion.url.enet_b0_8_va_mtl",
"status": "VERIFIED",
"detail": "https://github.com/av-savchenko/face-emotion-recognition/raw/main/models/affectnet_emotions/onnx/enet_b0_8_va_mtl.onnx (https://github.com/av-savchenko/face-emotion-recognition/raw/main/models/affectnet_emotions/onnx/enet_b0_8_va_mtl.onnx -> 16049834 bytes)"
},
{
"item": "onnx2tf.convert.tf_converter",
"status": "VERIFIED",
"detail": "onnx2tf 2.6.9 accepted ['copy_onnx_input_output_names_to_tflite', 'input_onnx_file_path', 'non_verbose', 'output_folder_path', 'output_integer_quantized_tflite', 'overwrite_input_shape', 'tflite_backend']; rejected []"
},
{
"item": "emotion.conversion",
"status": "VERIFIED",
"detail": "variant=enet_b0_8_va_mtl, backend=tf_converter, candidate=saved_model->TFLiteConverter float32 (optimizations=[]), runtime=tf.lite.Interpreter(OpResolverType.BUILTIN), analyzer=tf.lite.experimental.Analyzer.analyze"
},
{
"item": "mediapipe.face_landmarker_url",
"status": "VERIFIED",
"detail": "https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/1/face_landmarker.task -> 3758596 bytes"
},
{
"item": "mediapipe.api",
"status": "VERIFIED",
"detail": "mediapipe 1.1.1: vision.FaceLandmarker=True, RunningMode=True, FaceLandmarksConnections=True"
},
{
"item": "mediapipe.test_image_url",
"status": "VERIFIED",
"detail": "https://storage.googleapis.com/mediapipe-assets/business-person.png -> 1094717 bytes"
},
{
"item": "mediapipe.landmark_count",
"status": "VERIFIED",
"detail": "478 landmarks, 52 blendshapes, matrix [4, 4] on https://storage.googleapis.com/mediapipe-assets/business-person.png"
},
{
"item": "mediapipe.tessellation_api",
"status": "VERIFIED",
"detail": "mediapipe.tasks.python.vision.FaceLandmarksConnections.FACE_LANDMARKS_TESSELATION: 1322 unique undirected edges"
},
{
"item": "landmarks.roi_placement",
"status": "VERIFIED",
"detail": "{'forehead_above_nose': True, 'left_cheek_image_right': True, 'right_cheek_image_left': True, 'cheeks_below_forehead': True} on https://storage.googleapis.com/mediapipe-assets/business-person.png"
},
{
"item": "landmarks.blendshape_order",
"status": "VERIFIED",
"detail": "FaceLandmarker result on https://storage.googleapis.com/mediapipe-assets/business-person.png; eyeBlinkLeft=9, eyeBlinkRight=10"
},
{
"item": "supervision.api",
"status": "VERIFIED",
"detail": "supervision 0.31.1; available={'Detections': True, 'KeyPoints': True, 'VertexAnnotator': True, 'EdgeAnnotator': True, 'LabelAnnotator': True, 'Color': True, 'VideoInfo': True, 'VideoSink': True, 'get_video_frames_generator': True, 'ByteTrack': False, 'match_detections': True}; EdgeAnnotator edges 1-based; KeyPoints confidence param=keypoint_confidence; tracker=IouAssociationTracker(sv.match_detections)"
},
{
"item": "supervision.reference_on_test_image",
"status": "VERIFIED",
"detail": "{'tracker_id': 1, 'bbox_xyxy': [366.544921875, 177.2789764404297, 617.8607177734375, 458.6279296875], 'pose': {'yaw_deg': 4.877058827435793, 'pitch_deg': 18.128881512712507, 'roll_deg': 5.242579929209524, 'translation': [1.187615990638733, 22.372756958007812, -68.015380859375]}}"
}
],
"models": {
"rppg_tscan": {
"asset": "rppg_tscan_fp32.tflite",
"sha256": "3ccd6df682f91cb128aa611b4a968c10ffaf70b5f36dc292248a8940d464858e",
"architecture": "TS-CAN (rPPG-Toolbox)",
"license": "Responsible Artificial Intelligence Source Code License (Version 1.1) per LICENSE at commit b7500b848f84",
"fps": 30,
"native_window_frames": 180,
"buffer_frames_required": 180,
"crop_box_scale": 1.1,
"input": {
"name": null,
"shape": [
180,
72,
72,
6
],
"dtype": "float32",
"layout": "NHWC",
"channel_order": "RGB",
"value_range": [
0.0,
255.0
],
"preprocessing": "diff_and_standardize"
},
"output": {
"name": null,
"shape": [
180,
1
],
"dtype": "float32",
"postprocess": "cumsum_then_detrend"
},
"note": "Mirror of the top-level 'rppg' block in the per-model schema used by the app (ml.ModelContract). crop_box_scale 1.1 keeps the Phase 3 framing (CROP_EXPAND 0.10)."
},
"rppg_mamba": {
"asset": "rppg_mamba_fp32.tflite",
"size_bytes": 15984316,
"sha256": "5700fc5a3d5610690bfd199744aa88d59e1ab0cedba126d6531c6f7b06c9bc29",
"architecture": "RhythmMamba (Zou et al., AAAI 2025)",
"source_repo": "https://github.com/zizheng-guo/RhythmMamba.git",
"source_commit": "1533ad21cb4ae0d31e9dbb9afb0b1eefbed54aed",
"weights": [
{
"file": "MMPD_intra_RhythmMamba.pth",
"sha256": "aff4367807a500f702c8c6dbf5059352410a6255df03e0319693353e7104963e"
}
],
"trained_on": "MMPD (intra-dataset)",
"license": "MIT",
"fps": 30,
"native_window_frames": 160,
"buffer_frames_required": 160,
"sliding_window": {
"hop_frames_recommended": 30,
"hop_frames_low_power": 80,
"combine": "Hann-weighted overlap-add of z-scored windows"
},
"input": {
"name": "serving_default_input_rgb:0",
"shape": [
1,
160,
128,
128,
3
],
"dtype": "float32",
"layout": "NTHWC",
"channel_order": "RGB",
"value_range": [
0.0,
255.0
],
"element_strides": [
7864320,
49152,
384,
3,
1
],
"byte_strides": [
31457280,
196608,
1536,
12,
4
],
"bytes": 31457280,
"preprocessing": "raw_rgb_0_255"
},
"app_preprocessing": [
"Detect the face on the first frame of the window (or track it); enlarge the box 1.5x about its centre (rPPG-Toolbox LARGE_BOX_COEF=1.5), make it square, clip to the image.",
"Crop and resize to 128x128 with area interpolation (cv2.INTER_AREA equivalent).",
"Write pixels as float32 R,G,B in raw 0..255 range, frame-major (N,T,H,W,C). No /255, no mean/std: the graph does it.",
"Frames must be consecutive at 30 fps (resample if the camera delivers another rate)."
],
"in_graph_preprocessing": "Standardized: (x - mean) / std over the whole window (population std).",
"output": {
"name": "PartitionedCall:0",
"shape": [
160,
1
],
"dtype": "float32",
"semantics": "BVP waveform (Standardized label space), z-scored per window; row i aligned with input frame i.",
"postprocess": "zscore"
},
"postprocessing": [
"Optionally Hann-weighted overlap-add across hops.",
"Detrend (smoothness priors, lambda=100), band-pass 0.75-2.5 Hz (45-150 bpm).",
"HR = spectral peak (FFT/Welch) of the band-passed signal; HRV from peak detection on the same signal."
],
"conversion": {
"path": "PyTorch -> ONNX -> onnx2tf SavedModel -> TFLiteConverter",
"onnx_opset": 17,
"onnx2tf_backend": "flatbuffer_direct",
"tflite_ops": "TFLITE_BUILTINS",
"requires_flex_delegate": false,
"precision": "float32",
"float16_tensors": 0,
"quantized_tensors": 0,
"dequantize_ops": 0,
"audit_pass": true
},
"parity": {
"wrapper_vs_upstream_pytorch": {
"max_abs": 9.760260581970215e-07,
"pearson": 0.9999999999999581
},
"onnxruntime_vs_pytorch": {
"max_abs": 0.013345342129468918,
"pearson": 0.9999928050931804
},
"tflite_vs_pytorch": {
"max_abs": 7.285550236701965e-05,
"pearson": 0.9999999998022092
},
"colab_cpu_invoke_seconds": 3.38
},
"crop_box_scale": 1.5
},
"rppg_lq": {
"asset": "rppg_lq_fp32.tflite",
"size_bytes": 1803396,
"sha256": "f4002d1f36997f8baad50010204172d43940692652d824a50fea951c66e88102",
"architecture": "LQ-rPPG / LQC2F (label-quantized coarse-to-fine, bidirectional Mamba)",
"source_repo": "https://github.com/junseonglee-repo/LQ-rPPG.git",
"source_commit": "dc0143a6e67e12c30aa722d902e078cb24b1f17b",
"weights": [
{
"file": "MMPD_MMPD_LQC2F_1th_LQ_Epoch6.pth",
"sha256": "55e84cdd97cc3ca920ba83fefe51c294fbac721eb20af6653b0f7fe280e08415"
},
{
"file": "MMPD_MMPD_LQC2F_2th_LQ_Epoch5.pth",
"sha256": "3e8f68490c5a74a84f8a3af2576d4a3c45350340d59047f465e3c110d0cea69d"
},
{
"file": "MMPD_MMPD_LQC2F_3th_LQ_Epoch7.pth",
"sha256": "e60222d364fe1257f7c819bf0c7d96087ae1e443e45a6bd9768f634e12b5857e"
},
{
"file": "MMPD_MMPD_LQC2F_4th_LQ_Epoch29.pth",
"sha256": "69319f2c85f95599cbca054567af0191b9e82435528797b6041506bff5b05827"
},
{
"file": "MMPD_MMPD_LQC2F_5th_LQ_Epoch14.pth",
"sha256": "744fde8d293f832e5b74372984e2508b80d8f1ec5f5eab407a229f42fa19ad87"
},
{
"file": "MMPD_MMPD_LQC2F_rPPG_Epoch19.pth",
"sha256": "1bd592a1bdd2594eac3817d6f738c9bc04b8c429a1232c381b64718e2ff096b6"
}
],
"trained_on": "MMPD -> MMPD (train -> test protocol)",
"license": "MIT",
"fps": 30,
"native_window_frames": 160,
"buffer_frames_required": 160,
"sliding_window": {
"hop_frames_recommended": 30,
"hop_frames_low_power": 80,
"combine": "Hann-weighted overlap-add of z-scored windows"
},
"input": {
"name": "serving_default_input_rgb:0",
"shape": [
1,
160,
128,
128,
3
],
"dtype": "float32",
"layout": "NTHWC",
"channel_order": "RGB",
"value_range": [
0.0,
255.0
],
"element_strides": [
7864320,
49152,
384,
3,
1
],
"byte_strides": [
31457280,
196608,
1536,
12,
4
],
"bytes": 31457280,
"preprocessing": "raw_rgb_0_255"
},
"app_preprocessing": [
"Detect the face on the first frame of the window (or track it); enlarge the box 1.5x about its centre (rPPG-Toolbox LARGE_BOX_COEF=1.5), make it square, clip to the image.",
"Crop and resize to 128x128 with area interpolation (cv2.INTER_AREA equivalent).",
"Write pixels as float32 R,G,B in raw 0..255 range, frame-major (N,T,H,W,C). No /255, no mean/std: the graph does it.",
"Frames must be consecutive at 30 fps (resample if the camera delivers another rate)."
],
"in_graph_preprocessing": "Standardized: (x - mean) / std over the whole window (population std).",
"output": {
"name": "PartitionedCall:0",
"shape": [
160,
1
],
"dtype": "float32",
"semantics": "BVP waveform reconstructed from a 32-code label codebook, z-scored per window; row i aligned with input frame i.",
"postprocess": "zscore"
},
"postprocessing": [
"Optionally Hann-weighted overlap-add across hops.",
"Detrend (smoothness priors, lambda=100), band-pass 0.75-2.5 Hz (45-150 bpm).",
"HR = spectral peak (FFT/Welch) of the band-passed signal; HRV from peak detection on the same signal."
],
"conversion": {
"path": "PyTorch -> ONNX -> onnx2tf SavedModel -> TFLiteConverter",
"onnx_opset": 17,
"onnx2tf_backend": "flatbuffer_direct",
"tflite_ops": "TFLITE_BUILTINS",
"requires_flex_delegate": false,
"precision": "float32",
"float16_tensors": 0,
"quantized_tensors": 0,
"dequantize_ops": 0,
"audit_pass": true
},
"parity": {
"wrapper_vs_upstream_pytorch": {
"max_abs": 1.5497207641601562e-06,
"pearson": 0.9999999999998466
},
"onnxruntime_vs_pytorch": {
"max_abs": 0.0187833309173584,
"pearson": 0.9999901955444845
},
"tflite_vs_pytorch": {
"max_abs": 0.00014415383338928223,
"pearson": 0.9999999994881277
},
"colab_cpu_invoke_seconds": 0.859
},
"crop_box_scale": 1.5
}
},
"phase4": {
"generated_utc": "2026-10-26T07:59:23+00:00",
"notebook": "MedAI_Phase4_Models.ipynb",
"disclaimer": "Research prototype. Not a medical device. Not for diagnosis. Pretrained third-party models; not clinically validated on this app.",
"toolchain": {
"torch": "2.11.0+cpu",
"onnx": "1.20.1",
"onnxruntime": "1.26.0",
"onnx2tf": "2.6.9",
"tensorflow": "2.21.0"
},
"models_added": [
"rppg_lq",
"rppg_mamba"
]
}
}