Spaces:
Sleeping
Sleeping
rmayormartins
commited on
Commit
•
cc52ca8
1
Parent(s):
316f25b
Subindo arquivos53321
Browse files
app.py
CHANGED
@@ -18,6 +18,7 @@ def image_inspector(uploaded_file):
|
|
18 |
|
19 |
try:
|
20 |
with Image.open(uploaded_file.name) as image:
|
|
|
21 |
bit_depth = image.mode
|
22 |
num_channels = len(image.getbands())
|
23 |
bit_depth_info = f"{num_channels * 8}-bit" if bit_depth else 'Desconhecido'
|
@@ -39,16 +40,12 @@ def image_inspector(uploaded_file):
|
|
39 |
formatted_details = "\n".join([f"{key}: {value}" for key, value in details.items()])
|
40 |
return formatted_details
|
41 |
|
42 |
-
# Caminho relativo para a imagem de exemplo
|
43 |
-
example_image_path = "example1.jpg"
|
44 |
-
|
45 |
iface = gr.Interface(
|
46 |
fn=image_inspector,
|
47 |
inputs=gr.File(label="Upload de Imagem"),
|
48 |
outputs="text",
|
49 |
title="Inspetor de Imagem",
|
50 |
-
description="Faça o upload de uma imagem (.jpg, .png, .bmp, etc.) e veja detalhes sobre ela."
|
51 |
-
examples=[[example_image_path]]
|
52 |
)
|
53 |
|
54 |
if __name__ == "__main__":
|
|
|
18 |
|
19 |
try:
|
20 |
with Image.open(uploaded_file.name) as image:
|
21 |
+
|
22 |
bit_depth = image.mode
|
23 |
num_channels = len(image.getbands())
|
24 |
bit_depth_info = f"{num_channels * 8}-bit" if bit_depth else 'Desconhecido'
|
|
|
40 |
formatted_details = "\n".join([f"{key}: {value}" for key, value in details.items()])
|
41 |
return formatted_details
|
42 |
|
|
|
|
|
|
|
43 |
iface = gr.Interface(
|
44 |
fn=image_inspector,
|
45 |
inputs=gr.File(label="Upload de Imagem"),
|
46 |
outputs="text",
|
47 |
title="Inspetor de Imagem",
|
48 |
+
description="Faça o upload de uma imagem (.jpg, .png, .bmp, etc.) e veja detalhes sobre ela."
|
|
|
49 |
)
|
50 |
|
51 |
if __name__ == "__main__":
|