Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ import numpy as np
|
|
4 |
import mediapipe as mp
|
5 |
from sklearn.linear_model import LinearRegression
|
6 |
import random
|
7 |
-
import
|
8 |
|
9 |
# Setup for Face Mesh detection
|
10 |
mp_face_mesh = mp.solutions.face_mesh
|
@@ -31,10 +31,15 @@ def train_model(output_range):
|
|
31 |
model = LinearRegression().fit(X, y)
|
32 |
return model
|
33 |
|
34 |
-
# Load pre-trained models for Hemoglobin, SPO2, and Heart Rate
|
35 |
-
|
36 |
-
|
37 |
-
|
|
|
|
|
|
|
|
|
|
|
38 |
|
39 |
# Model dictionary setup for other tests
|
40 |
models = {
|
|
|
4 |
import mediapipe as mp
|
5 |
from sklearn.linear_model import LinearRegression
|
6 |
import random
|
7 |
+
import pickle
|
8 |
|
9 |
# Setup for Face Mesh detection
|
10 |
mp_face_mesh = mp.solutions.face_mesh
|
|
|
31 |
model = LinearRegression().fit(X, y)
|
32 |
return model
|
33 |
|
34 |
+
# Load pre-trained models for Hemoglobin, SPO2, and Heart Rate using pickle
|
35 |
+
with open("hemoglobin_model_from_anemia_dataset.pkl", "rb") as f:
|
36 |
+
hemoglobin_model = pickle.load(f)
|
37 |
+
|
38 |
+
with open("spo2_model_simulated.pkl", "rb") as f:
|
39 |
+
spo2_model = pickle.load(f)
|
40 |
+
|
41 |
+
with open("heart_rate_model.pkl", "rb") as f:
|
42 |
+
hr_model = pickle.load(f)
|
43 |
|
44 |
# Model dictionary setup for other tests
|
45 |
models = {
|