Update README.md
Browse files
README.md
CHANGED
|
@@ -29,44 +29,42 @@ Installation
|
|
| 29 |
bash
|
| 30 |
|
| 31 |
# Installation via PyPI
|
| 32 |
-
pip install
|
| 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
|
| 41 |
-
from <dein-paketname> import <ModellKlasse>, utils
|
| 42 |
|
| 43 |
-
# 1.
|
| 44 |
-
|
| 45 |
-
|
| 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 |
|
|
|
|
| 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 |
|