Skip to content

Commit

Permalink
Use imgviz.io.pyplot_to_numpy in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
wkentaro committed Jan 21, 2020
1 parent 186bc11 commit 5849b86
Show file tree
Hide file tree
Showing 19 changed files with 19 additions and 21 deletions.
Binary file modified examples/.readme/centerize.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/.readme/depth2rgb.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/.readme/draw.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/.readme/flow2rgb.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/.readme/instances2rgb.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/.readme/label2rgb.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/.readme/nchannel2rgb.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/.readme/plot_trajectory.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/.readme/resize.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/.readme/tile.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 2 additions & 5 deletions examples/centerize.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def centerize():

# -------------------------------------------------------------------------

fig = plt.figure(dpi=200)
plt.figure(dpi=200)

plt.subplot(131)
plt.title('original')
Expand All @@ -33,10 +33,7 @@ def centerize():
plt.imshow(centerized2)
plt.axis('off')

img = imgviz.io.pyplot_fig2arr(fig)
plt.close()

return img
return imgviz.io.pyplot_to_numpy()


if __name__ == '__main__':
Expand Down
4 changes: 2 additions & 2 deletions examples/depth2rgb.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def depth2rgb():

# -------------------------------------------------------------------------

fig = plt.figure(dpi=200)
plt.figure(dpi=200)

plt.subplot(121)
plt.title('rgb')
Expand All @@ -22,7 +22,7 @@ def depth2rgb():
plt.imshow(depthviz)
plt.axis('off')

img = imgviz.io.pyplot_fig2arr(fig)
img = imgviz.io.pyplot_to_numpy()
plt.close()

return img
Expand Down
4 changes: 2 additions & 2 deletions examples/draw.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def draw():

# -------------------------------------------------------------------------

fig = plt.figure(dpi=200)
plt.figure(dpi=200)

plt.subplot(121)
plt.title('original')
Expand All @@ -63,7 +63,7 @@ def draw():
plt.imshow(viz)
plt.axis('off')

img = imgviz.io.pyplot_fig2arr(fig)
img = imgviz.io.pyplot_to_numpy()
plt.close()

return img
Expand Down
5 changes: 3 additions & 2 deletions examples/flow2rgb.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ def flow2rgb():

# -------------------------------------------------------------------------

fig = plt.figure(dpi=200)
plt.figure(dpi=200)

plt.subplot(121)
plt.title('image')
plt.imshow(rgb)
Expand All @@ -22,7 +23,7 @@ def flow2rgb():
plt.imshow(flowviz)
plt.axis('off')

img = imgviz.io.pyplot_fig2arr(fig)
img = imgviz.io.pyplot_to_numpy()
plt.close()

return img
Expand Down
4 changes: 2 additions & 2 deletions examples/instances2rgb.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def instances2rgb():

# -------------------------------------------------------------------------

fig = plt.figure(dpi=200)
plt.figure(dpi=200)

plt.subplot(131)
plt.title('rgb')
Expand All @@ -39,7 +39,7 @@ def instances2rgb():
plt.imshow(insviz2)
plt.axis('off')

img = imgviz.io.pyplot_fig2arr(fig)
img = imgviz.io.pyplot_to_numpy()
plt.close()

return img
Expand Down
4 changes: 2 additions & 2 deletions examples/label2rgb.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def label2rgb():

# -------------------------------------------------------------------------

fig = plt.figure(dpi=200)
plt.figure(dpi=200)

plt.subplot(131)
plt.title('+img')
Expand All @@ -40,7 +40,7 @@ def label2rgb():
plt.imshow(labelviz_withname2)
plt.axis('off')

img = imgviz.io.pyplot_fig2arr(fig)
img = imgviz.io.pyplot_to_numpy()
plt.close()

return img
Expand Down
4 changes: 2 additions & 2 deletions examples/nchannel2rgb.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def nchannel2rgb():

# -------------------------------------------------------------------------

fig = plt.figure(dpi=200)
plt.figure(dpi=200)

plt.subplot(121)
plt.title('rgb')
Expand All @@ -28,7 +28,7 @@ def nchannel2rgb():
plt.imshow(nchannel_viz)
plt.axis('off')

img = imgviz.io.pyplot_fig2arr(fig)
img = imgviz.io.pyplot_to_numpy()
plt.close()

return img
Expand Down
4 changes: 2 additions & 2 deletions examples/resize.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def resize():

# -------------------------------------------------------------------------

fig = plt.figure(dpi=200)
plt.figure(dpi=200)

plt.subplot(121)
plt.title('rgb:\n{}'.format(rgb.shape))
Expand All @@ -25,7 +25,7 @@ def resize():
plt.imshow(rgb_resized)
plt.axis('off')

img = imgviz.io.pyplot_fig2arr(fig)
img = imgviz.io.pyplot_to_numpy()
plt.close()

return img
Expand Down
4 changes: 2 additions & 2 deletions examples/tile.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def tile():

# -------------------------------------------------------------------------

fig = plt.figure(dpi=200)
plt.figure(dpi=200)

plt.subplot(121)
plt.title('original')
Expand All @@ -31,7 +31,7 @@ def tile():
plt.imshow(tiled)
plt.axis('off')

img = imgviz.io.pyplot_fig2arr(fig)
img = imgviz.io.pyplot_to_numpy()
plt.close()

return img
Expand Down

0 comments on commit 5849b86

Please sign in to comment.