Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -45,13 +45,12 @@ def crop():
|
|
| 45 |
init()
|
| 46 |
|
| 47 |
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
"""
|
| 56 |
|
| 57 |
import numpy
|
|
@@ -63,6 +62,9 @@ def gen(seed):
|
|
| 63 |
imgArr = []
|
| 64 |
for i in range(4):
|
| 65 |
img = Image.open(str(i)+".png")
|
|
|
|
|
|
|
|
|
|
| 66 |
imgArr.append(img)
|
| 67 |
return imgArr
|
| 68 |
|
|
@@ -71,7 +73,7 @@ iface = gr.Interface(
|
|
| 71 |
inputs=gr.Slider(0,1000,500,step = 0.01),
|
| 72 |
outputs=gr.Gallery(label="Generated Skins"),
|
| 73 |
title = "Minecraft Skin Generator",
|
| 74 |
-
|
| 75 |
debug = True,
|
| 76 |
)
|
| 77 |
iface.launch(width=64,height=64,enable_queue=True)
|
|
|
|
| 45 |
init()
|
| 46 |
|
| 47 |
|
| 48 |
+
js= """
|
| 49 |
+
<style>
|
| 50 |
+
img{
|
| 51 |
+
image-rendering: pixelated;
|
| 52 |
+
}
|
| 53 |
+
</style>
|
|
|
|
| 54 |
"""
|
| 55 |
|
| 56 |
import numpy
|
|
|
|
| 62 |
imgArr = []
|
| 63 |
for i in range(4):
|
| 64 |
img = Image.open(str(i)+".png")
|
| 65 |
+
|
| 66 |
+
img = img.resize((64,64), Image.NEAREST)
|
| 67 |
+
|
| 68 |
imgArr.append(img)
|
| 69 |
return imgArr
|
| 70 |
|
|
|
|
| 73 |
inputs=gr.Slider(0,1000,500,step = 0.01),
|
| 74 |
outputs=gr.Gallery(label="Generated Skins"),
|
| 75 |
title = "Minecraft Skin Generator",
|
| 76 |
+
js = js,
|
| 77 |
debug = True,
|
| 78 |
)
|
| 79 |
iface.launch(width=64,height=64,enable_queue=True)
|