TEAM_7_GAP / app.py
fatimaxa's picture
Update app.py
db45e51 verified
raw
history blame contribute delete
994 Bytes
import gradio as gr
from utils.model_loader import load_model_and_config, load_ui_text
from tabs.single_prediction import create_single_prediction_tab
from tabs.batch_processing import create_batch_processing_tab
# loadign model
config = load_model_and_config()
intro_md, about_md = load_ui_text()
model = config['model']
class_names = config['class_names']
disease_db = config['disease_db']
device = config['device']
# CSS
custom_css = """
.gradio-container {
font-family: 'Arial', sans-serif;
}
.output-class {
font-size: 16px;
}
"""
with gr.Blocks() as demo:
gr.HTML(f"<style>{custom_css}</style>")
gr.Markdown(intro_md)
with gr.Tab("Single Image Prediction"):
create_single_prediction_tab(model, class_names, disease_db, device)
with gr.Tab("Batch Processing"):
create_batch_processing_tab(model, class_names, device)
with gr.Tab("About"):
gr.Markdown(about_md)
if __name__ == "__main__":
demo.launch(share=False)