TB Chest X-ray Classifier
This Hugging Face Space loads an EfficientNet-B0 model trained to classify chest X-rays as:
TBNon-TB
The app exposes both a web upload UI and a Gradio API endpoint.
Files
app.py: Gradio app and inference codemodel.pth: trained PyTorch weightsrequirements.txt: Python dependenciesapi_client_example.py: example remote API call
API Example
After the Space is running, install the client:
pip install gradio_client
Then call it:
from gradio_client import Client, handle_file
client = Client("YOUR_USERNAME/YOUR_SPACE_NAME")
result = client.predict(
image=handle_file("path/to/chest_xray.png"),
api_name="/predict",
)
print(result)
Important
This model is for research and education only. It should not be used as a medical diagnosis tool.
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support