Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add smc user guide #312

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 45 additions & 10 deletions docs/smc.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

SMC (SenseMoCap) is a file format designed with multi-camera multi-model support in mind. Each smc file is essentially a HDF5 database,made easy for cross-platform, cross-language support (h5py, H5Cpp).

Each SMC file contains the following structure.
Each SMC file contains **one** sequence of 4D human data, with multiple data modalities in the following structure.

- ### *.smc (File)

Expand Down Expand Up @@ -131,21 +131,21 @@ Each SMC file contains the following structure.
- keypoints3d (Dataset): 3D key point computed from triangulate_optim
- Keypoints3d_mask (Dataset): corresponding mask

### Keypoints2D
- ### Keypoints2D

- Kinect (Group)
- Kinect (Group)

- #### DeviceID (Group)
- #### DeviceID (Group)

- DeviceID
- Length aligned with 3D Keypoints,reprojection from 3D Keypoints
- DeviceID
- Length aligned with 3D Keypoints,reprojection from 3D Keypoints

- iPhone (Group)
- iPhone (Group)

- #### DeviceID (Group)
- #### DeviceID (Group)

- DeviceID
- Length aligned with 3D Keypoints,reprojection from 3D Keypoints
- DeviceID
- Length aligned with 3D Keypoints,reprojection from 3D Keypoints

- ### SMPL (Group)

Expand All @@ -157,3 +157,38 @@ Each SMC file contains the following structure.
- betas (Dataset): SMPL Betas: 1x10
- transl (Dataset): Global Translation: Nx3
- keypoints3d (Dataset): SMPL Keypoints: Nx3


# Tutorial

Please first install MMHuman3D following the [installation](install.md) guide.
To read a `.smc` file, you may refer to the instructions below:

```python
from mmhuman3d.data.data_structures.smc_reader import SMCReader

# Initialize a smc reader
smc_reader = SMCReader('/path/to/pxxxxxx_axxxxxx.smc')

# Get images
# Kinect IDs: from 0 to 9
# iPhone ID: 0; vertical: images are transformed from landscape to vertical
kinect_images = smc_reader.get_color(device='Kinect', device_id=0)
iphone_images = smc_reader.get_color(device='iPhone', device_id=0, vertical=True)

smc_reader.get_kinect_color_extrinsics(kinect_id=0)
smc_reader.get_iphone_extrinsics(iphone_id=0)

# Get images
kinect_images = smc_reader.get_iphone_depth(device='Kinect', device_id=0)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding vertical=True as well?


# Get 2D keypoints
iphone_keypoints2d = smc_reader.get_keypoints2d(device='Kinect', device_id=0)
iphone_keypoints2d = smc_reader.get_keypoints2d(device='iPhone', device_id=0, vertical=True)

# Get 3D keypoints
keypoints3d = smc_reader.get_keypoints3d(device='Kinect', device_id=0)

# Get SMPL
smpl = smc_reader.get_smpl(device='Kinect', device_id=0)
```