Spaces:
Runtime error
Runtime error
add requirement
Browse files- code/app.py +3 -3
- code/physiological_indicators.py +1 -1
- code/utils_sig.py +1 -1
code/app.py
CHANGED
@@ -14,7 +14,7 @@ from gradio_utils import read_video
|
|
14 |
|
15 |
|
16 |
fece_detection = FaceDetection()
|
17 |
-
csv_url = './ippg_predict.csv'
|
18 |
|
19 |
|
20 |
def video_to_rppg_dynamic(model_choice,path):
|
@@ -25,9 +25,9 @@ def video_to_rppg_dynamic(model_choice,path):
|
|
25 |
'''
|
26 |
print(model_choice,"=======================================")
|
27 |
if model_choice=="ContrastPhys":
|
28 |
-
model = PhysNet_Model('./contrast_phys/model_weights.pt')
|
29 |
elif model_choice=="DeepPhys":
|
30 |
-
model = DeepPhys_Model('./contrast_phys/PURE_PURE_UBFC_deepphys_Epoch29.pth')
|
31 |
else:
|
32 |
model = None
|
33 |
|
|
|
14 |
|
15 |
|
16 |
fece_detection = FaceDetection()
|
17 |
+
csv_url = './code/ippg_predict.csv'
|
18 |
|
19 |
|
20 |
def video_to_rppg_dynamic(model_choice,path):
|
|
|
25 |
'''
|
26 |
print(model_choice,"=======================================")
|
27 |
if model_choice=="ContrastPhys":
|
28 |
+
model = PhysNet_Model('./code/contrast_phys/model_weights.pt')
|
29 |
elif model_choice=="DeepPhys":
|
30 |
+
model = DeepPhys_Model('./code/contrast_phys/PURE_PURE_UBFC_deepphys_Epoch29.pth')
|
31 |
else:
|
32 |
model = None
|
33 |
|
code/physiological_indicators.py
CHANGED
@@ -42,7 +42,7 @@ class PhysiologicalIndicators:
|
|
42 |
ippg_data = np.array(ippg_data).reshape(len(ippg_data),1)
|
43 |
|
44 |
bp_pred = []
|
45 |
-
model_list = joblib.load( './model_weight/lgb_model_ppg2bp.pkl')
|
46 |
for model in model_list:
|
47 |
result = model.predict(ippg_data)
|
48 |
bp_pred.append(result+10)
|
|
|
42 |
ippg_data = np.array(ippg_data).reshape(len(ippg_data),1)
|
43 |
|
44 |
bp_pred = []
|
45 |
+
model_list = joblib.load( './code/model_weight/lgb_model_ppg2bp.pkl')
|
46 |
for model in model_list:
|
47 |
result = model.predict(ippg_data)
|
48 |
bp_pred.append(result+10)
|
code/utils_sig.py
CHANGED
@@ -238,7 +238,7 @@ def RGB_HR(ROI_list):
|
|
238 |
# ippg_chanel_data = np.array(ippg_chanel_data).reshape(len(ippg_chanel_data),6)
|
239 |
|
240 |
HR_pred = []
|
241 |
-
model_list = joblib.load( './model_weight/lgb_model_threechanel2HR.pkl')
|
242 |
for model in model_list:
|
243 |
result = model.predict(ippg_chanel_data)
|
244 |
HR_pred.append(result+10)
|
|
|
238 |
# ippg_chanel_data = np.array(ippg_chanel_data).reshape(len(ippg_chanel_data),6)
|
239 |
|
240 |
HR_pred = []
|
241 |
+
model_list = joblib.load( './code/model_weight/lgb_model_threechanel2HR.pkl')
|
242 |
for model in model_list:
|
243 |
result = model.predict(ippg_chanel_data)
|
244 |
HR_pred.append(result+10)
|