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 topview rendering option #230

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
19 changes: 19 additions & 0 deletions demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,9 @@ def main(args):

if args.sideview:
side_img = np.zeros_like(img)

if args.topview:
top_img = np.zeros_like(img)

for person_id, person_data in frame_results[frame_idx].items():
frame_verts = person_data['verts']
Expand Down Expand Up @@ -327,9 +330,22 @@ def main(args):
angle=270,
axis=[0,1,0],
)

if args.topview:
top_img = renderer.render(
top_img,
frame_verts,
cam=frame_cam,
color=mc,
angle=90,
axis=[1,0,0],
)

if args.sideview:
img = np.concatenate([img, side_img], axis=1)

if args.topview:
img = np.concatenate([img, top_img], axis=1)

cv2.imwrite(os.path.join(output_img_folder, f'{frame_idx:06d}.png'), img)

Expand Down Expand Up @@ -394,6 +410,9 @@ def main(args):

parser.add_argument('--sideview', action='store_true',
help='render meshes from alternate viewpoint.')

parser.add_argument('--topview', action='store_true',
help='render meshes from bird eye view.')

parser.add_argument('--save_obj', action='store_true',
help='save results as .obj files.')
Expand Down
2 changes: 2 additions & 0 deletions doc/demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ For this option, you have to set `--tracking_method` option to `pose`.
- `--sideview`: Render the output meshes from an alternate viewpoint. Default alternate viewpoint is -90 degrees in y axis.
Note that this option doubles the rendering time.

- `--topview`: Render the output meshes from a bird eye view. It can be used together with `--sideview` to visualize both a sideview and topview. Just like `--sideview` this option doubles the rendering time.

- `--save_obj`: Save output meshes as .obj files.

## Examples
Expand Down