ONNX
Cobtras commited on
Commit
9b589fe
·
verified ·
1 Parent(s): 1f8baa2

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +19 -23
README.md CHANGED
@@ -31,42 +31,38 @@ bash
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
 
 
31
  # Installation via PyPI
32
  pip install <dein-paketname>
33
 
 
 
 
34
  Grundlegende Verwendung
35
  python
36
 
37
+ # 1. 2D PoseEstimation eines Bilder
38
+ estimator = RTMPoseEstimator2D(num_keypoints=17)\
39
+ result2D = estimator.process_image_from_file(image_path="Testbild.jpg")
 
 
 
40
 
41
+ # 2. Lifting Model laden
42
+ lifting = RTMLifting(num_keypoints=17, mode="ai")
43
 
44
+ # 3. Liften
45
+ lifting.lift_pose(result2D)
 
 
 
 
46
 
47
  📥 Modell-Download
48
 
49
  Das vortrainierte Modell wird automatisch über from_pretrained() heruntergeladen. Für einen manuellen Download:
50
  python
51
 
52
+ from pose_estimation_recognition_utils_rtmlib import ModelLoader, Simple3DPoseLiftingModel
 
53
 
54
+ model=Simple3DPoseLiftingModel(num_keypoints=17)\
55
+ model.to(device)\
56
+ model.eval()\
57
+
58
+ model_loader=ModelLoader(
59
+ repo_id="fhswf/rtm17lifting",
60
+ model_filename="rtm17lifting.pth",
61
+ cache_dir=cache_dir,
62
  )
63
+
64
+ state_dict=model_loader.load_model(device=device)\
65
+ model.load_state_dict(state_dict)
66
 
67
  📊 Evaluation & Leistung
68