samH98 commited on
Commit
d78b137
·
1 Parent(s): e2696cc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -28
app.py CHANGED
@@ -1,29 +1,3 @@
1
- # import gradio as gr
2
- # import cv2
3
- # import torch
4
-
5
- # # Load YOLOv7 model
6
- # model = torch.hub.load('models', 'custom', 'models/100epoch.pt',force_reload=True, source='local',trust_repo=True)
7
- # model.eval()
8
-
9
- # def process_image(input_image):
10
- # # Perform inference on the input image
11
- # results = model(input_image)
12
- # img = results.render()[0]
13
-
14
- # return img
15
-
16
- # iface = gr.Interface(
17
- # fn=process_image,
18
- # inputs=gr.components.Image(type='pil', label="Input Image"),
19
- # outputs=gr.components.Image(type='pil', label="Processed Image"),
20
- # live=True,
21
- # title="YOLOv7 Object Detection",
22
- # description="Upload an image and see the object detection results."
23
- # )
24
-
25
- # if __name__ == '__main__':
26
- # iface.launch()
27
  import gradio as gr
28
  import cv2
29
  import torch
@@ -60,8 +34,15 @@ iface = gr.Interface(
60
  inputs=gr.components.Image(type='pil', label="Input Image"),
61
  outputs=[gr.components.Image(type='pil', label="Processed Image"), gr.components.Textbox(label="Detected Cancer Type")],
62
  live=True,
63
- title="Lung Cancer Detection",
64
- description="Upload an image and see the object detection results."
 
 
 
 
 
 
 
65
  )
66
 
67
  if __name__ == '__main__':
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
  import cv2
3
  import torch
 
34
  inputs=gr.components.Image(type='pil', label="Input Image"),
35
  outputs=[gr.components.Image(type='pil', label="Processed Image"), gr.components.Textbox(label="Detected Cancer Type")],
36
  live=True,
37
+ title="Lung Cancer Detection App",
38
+ description=""The AI model was trained to detect the following types of lung cancer:\n"
39
+ "1. Adenocarcinoma (A)\n"
40
+ "2. Small Cell Carcinoma (B)\n"
41
+ "3. Large Cell Carcinoma (E)\n"
42
+ "4. Squamous Cell Carcinoma (G)\n\n"
43
+ "How to Use:\n"
44
+ "1. Upload a CT scan image of a patient's lungs.\n"
45
+ "2. The app will display the predicted type of lung cancer.""
46
  )
47
 
48
  if __name__ == '__main__':