GarimaPuri01 commited on
Commit
56facd8
·
verified ·
1 Parent(s): 3566bd0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -7
app.py CHANGED
@@ -12,9 +12,6 @@ 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 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,10 +30,7 @@ def classify_pose(landmarks):
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
 
 
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
  # 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