ftx7go commited on
Commit
64614f4
·
verified ·
1 Parent(s): 584b8ee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -15
app.py CHANGED
@@ -28,6 +28,18 @@ def predict_image(img):
28
  sample_images_dir = "samples"
29
  sample_images = [os.path.join(sample_images_dir, f) for f in os.listdir(sample_images_dir) if f.endswith(('.jpg', '.png'))]
30
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  # Define Gradio Interface
32
  interface = gr.Interface(
33
  fn=predict_image,
@@ -36,23 +48,17 @@ interface = gr.Interface(
36
  examples=sample_images, # Preloaded images for testing
37
  title="Bone Fracture Detection",
38
  description="Upload an X-ray image or select a sample image to check for fractures.",
39
- article="""
40
  ## Instructions
41
- - Type a question or statement
42
- - Upload images or audio files
43
- - You can combine text with media files
44
- - Support 2 modalities at the same time
45
- - The model can analyze images and transcribe audio
46
- - For best results with images, use JPG or PNG files
47
- - For audio, use WAV, MP3, or FLAC files
48
-
49
  ## Capabilities
50
- This chatbot can:
51
- - Answer questions and provide explanations
52
- - Describe and analyze images
53
- - Transcribe, translate, summarize, and analyze audio content
54
- - Process multiple inputs in the same message
55
- - Maintain context throughout the conversation
56
  """
57
  )
58
 
 
28
  sample_images_dir = "samples"
29
  sample_images = [os.path.join(sample_images_dir, f) for f in os.listdir(sample_images_dir) if f.endswith(('.jpg', '.png'))]
30
 
31
+ # File download paths
32
+ report_path = "report.pdf"
33
+ notebook_path = "bfd.ipynb"
34
+
35
+ # Function to provide file download links
36
+ def get_download_links():
37
+ return f"""
38
+ **Download Project Files:**
39
+ - [Download Report (PDF)]({report_path})
40
+ - [Download Notebook (IPYNB)]({notebook_path})
41
+ """
42
+
43
  # Define Gradio Interface
44
  interface = gr.Interface(
45
  fn=predict_image,
 
48
  examples=sample_images, # Preloaded images for testing
49
  title="Bone Fracture Detection",
50
  description="Upload an X-ray image or select a sample image to check for fractures.",
51
+ article=f"""
52
  ## Instructions
53
+ - Upload an X-ray image to check for fractures.
54
+ - Select a sample image for quick testing.
55
+ - The model will predict if the bone is fractured or normal.
56
+
 
 
 
 
57
  ## Capabilities
58
+ - Detects bone fractures from X-ray images.
59
+ - Uses a trained deep learning model for classification.
60
+
61
+ {get_download_links()}
 
 
62
  """
63
  )
64