Spaces:
Runtime error
Runtime error
##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) |