Skip to content

Commit

Permalink
add rendering from alternate viewpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
mkocabas committed Dec 16, 2019
1 parent 67b7674 commit 1147b97
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
21 changes: 20 additions & 1 deletion demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@ def main(args):
img_fname = image_file_names[frame_idx]
img = cv2.imread(img_fname)

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

for person_id, person_data in frame_results[frame_idx].items():
frame_verts = person_data['verts']
frame_cam = person_data['cam']
Expand All @@ -281,6 +284,19 @@ def main(args):
color=mc,
)

if args.sideview:
side_img = renderer.render(
side_img,
frame_verts,
cam=frame_cam,
color=mc,
angle=270,
axis=[0,1,0],
)

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

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

if args.display:
Expand Down Expand Up @@ -340,7 +356,10 @@ def main(args):
help='disable final rendering of output video.')

parser.add_argument('--wireframe', action='store_true',
help='render all meshes as wireframes')
help='render all meshes as wireframes.')

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

args = parser.parse_args()

Expand Down
5 changes: 4 additions & 1 deletion doc/demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@ to a temporary folder and then processed.
- `--run_smplify`: Enable this flag if you want to refine the results of VIBE using Temporal SMPLify algorithm.
For this option, you have to set `--tracking_method` option to `pose`.

- `--no-render`: This flag disables the final rendering of VIBE results. Useful if you only want to get VIBE predictions.
- `--no_render`: This flag disables the final rendering of VIBE results. Useful if you only want to get VIBE predictions.

- `--wireframe`: Enable this if you would like to render wireframe meshes in the final rendering.

- `--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.

## Examples
- Run VIBE on a video file using bbox tracker and visualize the results with wireframe meshes:
```bash
Expand Down

0 comments on commit 1147b97

Please sign in to comment.