annanau commited on
Commit
78588ac
·
verified ·
1 Parent(s): 78ec119

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -24,9 +24,9 @@ def classify_image(img):
24
  return {class_labels[i]: float(predictions[0][i]) for i in range(len(class_labels))}, confidence
25
 
26
  # Example images (local paths or URLs)
27
- #example_images = [
28
- #'examples/fresh.jpg', # Replace with actual local file paths or URLs
29
- #]
30
 
31
  # Gradio interface
32
  demo = gr.Interface(
@@ -35,6 +35,7 @@ demo = gr.Interface(
35
  description = "Predict the stage of decay (fresh, early decay, advanced decay, or skeletonized) of a head. This is a demo of one of our human decomposition image classification <a href=\"https://huggingface.co/icputrd/megyesi_decomposition_classification/blob/main/head/xception\">models</a>.",
36
  inputs=gr.Image(type="pil"),
37
  outputs=[gr.Label(num_top_classes=len(class_labels)), gr.Number()],
 
38
  live=True,
39
  article = "Author: <a href=\"https://www.linkedin.com/in/anna-maria-nau/\">Anna-Maria Nau</a>"
40
  )
 
24
  return {class_labels[i]: float(predictions[0][i]) for i in range(len(class_labels))}, confidence
25
 
26
  # Example images (local paths or URLs)
27
+ example_images = [
28
+ 'examples/fresh.jpg' # Replace with actual local file paths or URLs
29
+ ]
30
 
31
  # Gradio interface
32
  demo = gr.Interface(
 
35
  description = "Predict the stage of decay (fresh, early decay, advanced decay, or skeletonized) of a head. This is a demo of one of our human decomposition image classification <a href=\"https://huggingface.co/icputrd/megyesi_decomposition_classification/blob/main/head/xception\">models</a>.",
36
  inputs=gr.Image(type="pil"),
37
  outputs=[gr.Label(num_top_classes=len(class_labels)), gr.Number()],
38
+ examples=example_images,
39
  live=True,
40
  article = "Author: <a href=\"https://www.linkedin.com/in/anna-maria-nau/\">Anna-Maria Nau</a>"
41
  )