Update README.md
Browse files
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 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
# 1. Modell laden
|
| 44 |
-
model = <ModellKlasse>.from_pretrained("<dein-username>/<dein-modellname>")
|
| 45 |
-
model.eval()
|
| 46 |
|
| 47 |
-
# 2.
|
| 48 |
-
|
| 49 |
|
| 50 |
-
# 3.
|
| 51 |
-
|
| 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
|
| 63 |
-
import torch
|
| 64 |
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
)
|
| 69 |
-
|
|
|
|
|
|
|
| 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 |
|