Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@ from transformers import ViTForImageClassification, ViTFeatureExtractor
|
|
3 |
from PIL import Image
|
4 |
import torch
|
5 |
import numpy as np
|
|
|
6 |
|
7 |
# Load the pre-trained model and preprocessor (feature extractor)
|
8 |
model_name_pneumonia = "runaksh/chest_xray_pneumonia_detection"
|
@@ -36,8 +37,10 @@ def classify_image(image):
|
|
36 |
|
37 |
return label
|
38 |
|
|
|
|
|
39 |
# Create title, description and article strings
|
40 |
-
title = "Classification
|
41 |
description = "XRay classification"
|
42 |
|
43 |
css_code = """
|
@@ -52,8 +55,10 @@ iface = gr.Interface(fn=classify_image,
|
|
52 |
outputs=gr.Label(),
|
53 |
title=title,
|
54 |
description=description,
|
55 |
-
css=css_code
|
|
|
56 |
)
|
57 |
|
58 |
# Launch the app
|
59 |
iface.launch()
|
|
|
|
3 |
from PIL import Image
|
4 |
import torch
|
5 |
import numpy as np
|
6 |
+
from gradio.themes import Theme
|
7 |
|
8 |
# Load the pre-trained model and preprocessor (feature extractor)
|
9 |
model_name_pneumonia = "runaksh/chest_xray_pneumonia_detection"
|
|
|
37 |
|
38 |
return label
|
39 |
|
40 |
+
custom_theme = Theme(text_size="1.8em")
|
41 |
+
|
42 |
# Create title, description and article strings
|
43 |
+
title = "Automated Classification of Pneumonia and Tuberculosis using Machine Learning"
|
44 |
description = "XRay classification"
|
45 |
|
46 |
css_code = """
|
|
|
55 |
outputs=gr.Label(),
|
56 |
title=title,
|
57 |
description=description,
|
58 |
+
css=css_code,
|
59 |
+
theme=custom_theme
|
60 |
)
|
61 |
|
62 |
# Launch the app
|
63 |
iface.launch()
|
64 |
+
|