TB Chest X-ray Classifier

This Hugging Face Space loads an EfficientNet-B0 model trained to classify chest X-rays as:

  • TB
  • Non-TB

The app exposes both a web upload UI and a Gradio API endpoint.

Files

  • app.py: Gradio app and inference code
  • model.pth: trained PyTorch weights
  • requirements.txt: Python dependencies
  • api_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.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support