Cobtras commited on
Commit
2845cc7
·
verified ·
1 Parent(s): 8004b97

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +21 -23
README.md CHANGED
@@ -29,44 +29,42 @@ Installation
29
  bash
30
 
31
  # Installation via PyPI
32
- pip install <dein-paketname>
33
-
34
- # Oder direkt aus dem Repository
35
- pip install git+https://github.com/<dein-username>/<dein-repo>.git
36
 
37
  Grundlegende Verwendung
38
  python
39
 
40
- import torch
41
- from <dein-paketname> import <ModellKlasse>, utils
42
 
43
- # 1. Modell laden
44
- model = <ModellKlasse>.from_pretrained("<dein-username>/<dein-modellname>")
45
- model.eval()
46
 
47
- # 2. Bild vorbereiten (Beispiel)
48
- image = utils.load_and_preprocess_image("dein_bild.jpg")
49
 
50
- # 3. Inferenz durchführen
51
- with torch.no_grad():
52
- predictions = model(image)
53
-
54
- # 4. Ergebnisse verarbeiten (z.B. Visualisierung)
55
- utils.visualize_3d_pose(predictions)
56
 
57
  📥 Modell-Download
58
 
59
  Das vortrainierte Modell wird automatisch über from_pretrained() heruntergeladen. Für einen manuellen Download:
60
  python
61
 
62
- from huggingface_hub import hf_hub_download
63
- import torch
64
 
65
- model_path = hf_hub_download(
66
- repo_id="<dein-username>/<dein-modellname>",
67
- filename="model_weights.pth"
 
 
 
 
 
68
  )
69
- state_dict = torch.load(model_path, map_location='cpu')
 
 
70
 
71
  📊 Evaluation & Leistung
72
 
 
29
  bash
30
 
31
  # Installation via PyPI
32
+ pip install pose-estimation-recognition-utils-rtmlib
 
 
 
33
 
34
  Grundlegende Verwendung
35
  python
36
 
37
+ from pose_estimation_recognition_utils_rtmlib import RTMLifting, RTMPoseEstimator2D
 
38
 
39
+ # 1. 2D PoseEstimation eines Bilder
40
+ estimator = RTMPoseEstimator2D()
41
+ result2D = estimator.process_image_from_file(image_path="Zwergnase2.jpg")
42
 
43
+ # 2. Lifting Model laden
44
+ lifting = RTMLifting(num_keypoints=133, mode="ai")
45
 
46
+ # 3. Liften
47
+ lifting.lift_pose(result2D)
 
 
 
 
48
 
49
  📥 Modell-Download
50
 
51
  Das vortrainierte Modell wird automatisch über from_pretrained() heruntergeladen. Für einen manuellen Download:
52
  python
53
 
54
+ from pose_estimation_recognition_utils_rtmlib import ModelLoader, Simple3DPoseLiftingModel
 
55
 
56
+ model=Simple3DPoseLiftingModel(num_keypoints=num_keypoints)
57
+ model.to(device)
58
+ model.eval()
59
+
60
+ model_loader=ModelLoader(
61
+ repo_id="fhswf/rtm133lifting",
62
+ model_filename="rtm133lifting.pth",
63
+ cache_dir=cache_dir,
64
  )
65
+
66
+ state_dict=model_loader.load_model(device=device)
67
+ model.load_state_dict(state_dict)
68
 
69
  📊 Evaluation & Leistung
70