File size: 1,814 Bytes
1f5364b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
##importing the libraries

import torch
import cv2
import os
import numpy as np
import pandas as pd
import gradio as gr
from ultralytics import YOLO


# Load your trained model
model = YOLO('best.pt')

### Preprocess the new image

def predict_image(test_image):
    # save images
    results = model.predict(test_image, save=True, conf=0.1, batch=2)
    return results
        



platform = gr.Interface( fn = predict_image, 
                        title ="PTCADx: Computer-Aided Detection of Pneumothorax in Chest X-ray Images",
                        inputs = "image", 
                        outputs = "label",
                        description="""
                        Introducing a revolutionary computer-aided detection tool designed to enhance the efficiency of clinicians in detecting pneumothorax in chest X-ray images. 
                        """,
                        article = """ 
                        It is crucial to emphasize that while this tool serves as a valuable research aid, 
                        it is not intended to replace clinical guidelines, 
                        nor should it substitute for the wealth of clinical knowledge 
                        and experience possessed by healthcare professionals. 
                        The algorithm is meant to complement and support the diagnostic process, 
                        providing an additional layer of analysis for consideration in conjunction with the clinician's expertise. 
                        Users are encouraged to interpret the algorithm's output in conjunction with their clinical judgment, 
                        and the tool should be viewed as a supplementary resource rather than a standalone diagnostic solution.
                        """ )


platform.launch(inline=True,share=True)