Skip to content

Commit afbb51c

Browse files
charsymepassalis
andauthored
Update human-model-generation.md (opendr-eu#189)
* Update human-model-generation.md * Update human-model-generation.md * Update human-model-generation.md * Update human-model-generation.md * Update human-model-generation.md * Update human-model-generation.md * Update human-model-generation.md * Update human-model-generation.md * Update human-model-generation.md * Update docs/reference/human-model-generation.md Co-authored-by: Nikolaos Passalis <[email protected]> Co-authored-by: Nikolaos Passalis <[email protected]>
1 parent 07dee3b commit afbb51c

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

docs/reference/human-model-generation.md

+37-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,43 @@ Parameters:
6767
Specifies the folder where data will be downloaded.
6868
- **url**: *str, default=OpenDR FTP URL*\
6969
URL of the FTP server.
70-
70+
71+
#### ROS Node
72+
73+
A [ROS client node](../../projects/opendr_ws/src/simulation/scripts/human_model_generation_client.py) and a [ROS service node](../../projects/opendr_ws/src/simulation/scripts/human_model_generation_service.py) are available for performing
74+
inference on an image stream.
75+
Documentation on how to use this node can be found [here](../../projects/opendr_ws/src/perception/README.md).
76+
77+
#### Tutorials and Demos
78+
79+
A demo in the form of a Jupyter Notebook is available
80+
[here](../../projects/simulation/human_model_generation/demos/model_generation.ipynb).
81+
82+
#### Example
83+
84+
* **Generation of a 3D human model from a single image using the PIFuGeneratorLearner.**
85+
86+
This example shows how to perform inference on an RGB image, using along an image of the silhouette of the depicted human, and generate a 3D human model.
87+
88+
```python
89+
import sys
90+
import os
91+
from opendr.engine.data import Image
92+
from opendr.simulation.human_model_generation import PIFuGeneratorLearner
93+
import matplotlib.pyplot as plt
94+
import numpy as np
95+
OPENDR_HOME = os.environ["OPENDR_HOME"]
96+
97+
# We load a full-body image of a human as well as an image depicting its corresponding silhouette.
98+
rgb_img = Image.open(os.path.join(OPENDR_HOME, 'projects/simulation/human_model_generation/demos', 'imgs_input/rgb/result_0004.jpg'))
99+
msk_img = Image.open(os.path.join(OPENDR_HOME, 'projects/simulation/human_model_generation/demos', 'imgs_input/msk/result_0004.jpg'))
100+
101+
# We initialize learner. Using the infer method, we generate human 3D model.
102+
model_generator = PIFuGeneratorLearner(device='cuda', checkpoint_dir='./temp')
103+
model_3D = model_generator.infer(imgs_rgb=[rgb_img], imgs_msk=[msk_img], extract_pose=False)
104+
```
105+
106+
71107
#### References
72108
<a name="pifu-paper" href="https://shunsukesaito.github.io/PIFu/">[1]</a>
73109
PIFu: Pixel-Aligned Implicit Function for High-Resolution Clothed Human Digitization,

0 commit comments

Comments
 (0)