GarimaPuri01 commited on
Commit
3566bd0
·
verified ·
1 Parent(s): 42de484

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -12,6 +12,9 @@ pose = mp_pose.Pose(min_detection_confidence=0.5, min_tracking_confidence=0.5)
12
  # Initialize MediaPipe Drawing
13
  mp_drawing = mp.solutions.drawing_utils
14
 
 
 
 
15
  # Load the Hugging Face model and tokenizer
16
  model_name = "your-huggingface-model-name"
17
  model = AutoModelForSequenceClassification.from_pretrained(model_name)
@@ -30,7 +33,10 @@ def classify_pose(landmarks):
30
  # Map predictions to pose names (adjust this mapping according to your model)
31
  pose_names = ["Mountain Pose", "Tree Pose", "Warrior Pose", "Unknown Pose"]
32
  return pose_names[predictions.item()]
33
-
 
 
 
34
  def main():
35
  st.title("Live Yoga Pose Detection with Hugging Face")
36
 
 
12
  # Initialize MediaPipe Drawing
13
  mp_drawing = mp.solutions.drawing_utils
14
 
15
+ Load the model
16
+ model = load_model()
17
+
18
  # Load the Hugging Face model and tokenizer
19
  model_name = "your-huggingface-model-name"
20
  model = AutoModelForSequenceClassification.from_pretrained(model_name)
 
33
  # Map predictions to pose names (adjust this mapping according to your model)
34
  pose_names = ["Mountain Pose", "Tree Pose", "Warrior Pose", "Unknown Pose"]
35
  return pose_names[predictions.item()]
36
+
37
+ def load_model():
38
+ return pipeline("pose-detection", device=0) # Adjust device as per your requirement
39
+
40
  def main():
41
  st.title("Live Yoga Pose Detection with Hugging Face")
42