Spaces:
Sleeping
Sleeping
rmayormartins
commited on
Commit
•
9d3a36f
1
Parent(s):
3d8bca6
Subindo arquivos
Browse files- app.py +3 -6
- example1.jpg +0 -0
app.py
CHANGED
@@ -9,15 +9,13 @@ def muda_dpi(input_image, dpi):
|
|
9 |
|
10 |
image = Image.fromarray(input_image.astype('uint8'), 'RGB')
|
11 |
|
12 |
-
|
13 |
temp_file = tempfile.NamedTemporaryFile(delete=False, suffix='.png')
|
14 |
image.save(temp_file, format='PNG', dpi=dpi_tuple)
|
15 |
temp_file.close()
|
16 |
|
17 |
-
|
18 |
return temp_file.name
|
19 |
|
20 |
-
#
|
21 |
iface = gr.Interface(
|
22 |
fn=muda_dpi,
|
23 |
inputs=[
|
@@ -26,9 +24,8 @@ iface = gr.Interface(
|
|
26 |
],
|
27 |
outputs=gr.File(label="Download"),
|
28 |
title="Conversor DPI",
|
29 |
-
description="Faça o upload da imagem (.jpg, .png), ajuste o DPI e submeta"
|
|
|
30 |
)
|
31 |
|
32 |
-
|
33 |
iface.launch(debug=True)
|
34 |
-
|
|
|
9 |
|
10 |
image = Image.fromarray(input_image.astype('uint8'), 'RGB')
|
11 |
|
|
|
12 |
temp_file = tempfile.NamedTemporaryFile(delete=False, suffix='.png')
|
13 |
image.save(temp_file, format='PNG', dpi=dpi_tuple)
|
14 |
temp_file.close()
|
15 |
|
|
|
16 |
return temp_file.name
|
17 |
|
18 |
+
# Configurar a interface Gradio
|
19 |
iface = gr.Interface(
|
20 |
fn=muda_dpi,
|
21 |
inputs=[
|
|
|
24 |
],
|
25 |
outputs=gr.File(label="Download"),
|
26 |
title="Conversor DPI",
|
27 |
+
description="Faça o upload da imagem (.jpg, .png), ajuste o DPI e submeta",
|
28 |
+
examples=["example1.jpg"]
|
29 |
)
|
30 |
|
|
|
31 |
iface.launch(debug=True)
|
|
example1.jpg
ADDED