Update app.py
Browse files
app.py
CHANGED
@@ -28,15 +28,15 @@ class Generator(nn.Module):
|
|
28 |
return output
|
29 |
|
30 |
|
31 |
-
def display_gif(file_name):
|
32 |
images = []
|
33 |
|
34 |
for frame in range(8):
|
35 |
-
frame_name = '
|
36 |
image_filename = file_name + frame_name + '.png'
|
37 |
images.append(imageio.imread(image_filename))
|
38 |
|
39 |
-
gif_filename = '
|
40 |
return imageio.mimsave(gif_filename, images)
|
41 |
|
42 |
|
@@ -72,10 +72,10 @@ def run(action, body, hair, top, bottom):
|
|
72 |
elif bottom == "red": bottom = '2'
|
73 |
elif bottom == "silver": bottom = '3'
|
74 |
|
75 |
-
|
76 |
-
|
77 |
|
78 |
-
gif =
|
79 |
|
80 |
return 'avatar_source.gif'
|
81 |
|
|
|
28 |
return output
|
29 |
|
30 |
|
31 |
+
def display_gif(file_name, save_name):
|
32 |
images = []
|
33 |
|
34 |
for frame in range(8):
|
35 |
+
frame_name = '%d' % (frame)
|
36 |
image_filename = file_name + frame_name + '.png'
|
37 |
images.append(imageio.imread(image_filename))
|
38 |
|
39 |
+
gif_filename = 'avatar_source.gif'
|
40 |
return imageio.mimsave(gif_filename, images)
|
41 |
|
42 |
|
|
|
72 |
elif bottom == "red": bottom = '2'
|
73 |
elif bottom == "silver": bottom = '3'
|
74 |
|
75 |
+
file_name_source = './Sprite/frames/domain_1/' + action + '/'
|
76 |
+
file_name_source = file_name_source + 'front' + '_' + str(body) + str(bottom) + str(top) + str(hair) + '_'
|
77 |
|
78 |
+
gif = display_gif(file_name_source, 'avatar_source.gif')
|
79 |
|
80 |
return 'avatar_source.gif'
|
81 |
|