rmayormartins commited on
Commit
252534c
1 Parent(s): 501eb77

Subindo arquivos5332

Browse files
Files changed (2) hide show
  1. app.py +5 -2
  2. example1.jpg +0 -0
app.py CHANGED
@@ -18,7 +18,6 @@ def image_inspector(uploaded_file):
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,12 +39,16 @@ def image_inspector(uploaded_file):
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__":
 
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
  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__":
example1.jpg ADDED