-
Notifications
You must be signed in to change notification settings - Fork 0
/
notebook_tools.py
42 lines (38 loc) · 1.45 KB
/
notebook_tools.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG),
# acting on behalf of its Max Planck Institute for Intelligent Systems and the
# Max Planck Institute for Biological Cybernetics. All rights reserved.
#
# Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG) is holder of all proprietary rights
# on this computer program. You can only use this computer program if you have closed a license agreement
# with MPG or you get the right to use the computer program from someone who is authorized to grant you that right.
# Any use of the computer program without a valid license is prohibited and liable to prosecution.
# Contact: [email protected]
#
#
# If you use this code in a research publication please consider citing the following:
#
# Expressive Body Capture: 3D Hands, Face, and Body from a Single Image <https://arxiv.org/abs/1904.05866>
#
#
# Code Developed by:
# Nima Ghorbani <https://nghorbani.github.io/>
#
# 2018.01.02
import numpy as np
def show_image(img_ndarray):
'''
Visualize images resulted from calling vis_smpl_params in Jupyternotebook
:param img_ndarray: Nx400x400x3
'''
import matplotlib.pyplot as plt
import cv2
fig = plt.figure(figsize=(4, 4), dpi=300)
ax = fig.gca()
img = img_ndarray.astype(np.uint8)
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
ax.imshow(img)
plt.axis('off')
# fig.canvas.draw()
# return True