Skip to content

Commit

Permalink
add video_grid based on img_grid
Browse files Browse the repository at this point in the history
  • Loading branch information
EderSantana committed Sep 20, 2015
1 parent badc5bc commit fd4c094
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions agnez/output/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ def video_grid(video, ani_path='video_grid.gif', rescale=False):
flag to rescale displayed images by grid2d
'''
fig = plt.figure()
fig = plt.figure(figsize=(10, 10))
ax1 = _prepare_axis(111)
t, b, d = video.shape
t = video.shape[1]

grid = img_grid(video[:, 0])

Expand Down
5 changes: 3 additions & 2 deletions agnez/weight/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ def img_grid(X, rows_cols=None, rescale=True):
else:
rows, cols = rows_cols

total_height = rows * height + 2*rows - 1
total_width = cols * width
total_height = rows * height + rows - 1
total_width = cols * width + cols - 1

if rescale:
X = scale_norm(X)
Expand Down Expand Up @@ -118,6 +118,7 @@ def grid2d(X, example_width=False, display_cols=False, pad_row=1, pad_col=1, res
visual = (display_array - display_array.min()) / (display_array.max() - display_array.min())
visual = np.nan_to_num(visual)
ret = visual if rescale else display_array
ret = (255*ret).astype(np.uint8)
return ret


Expand Down

0 comments on commit fd4c094

Please sign in to comment.