File size: 789 Bytes
a2ae375
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fe7ae18
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import gradio as gr
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

def bmi(name, weight, height):
    bmi_val = weight / (height ** 2)
    return "Hello Mr." + name + ", your BMI is " + str(bmi_val)
    
interface = gr.Interface(bmi,
                         inputs = ['text', gr.inputs.Slider(0, 200, label = "Weight in Kg"), gr.inputs.Slider(0, 200, label = "Height in meters")],
                         outputs = ['text'],
                         description = "This would calculate the BMI",
                         examples = [['Abhishek', 100, 200], ['Little', 300, 500], ['Kaushik', 200, 400]],
                         theme = "darkgrass",
                         title = "BMI Demo"
                        )
                        
interface.launch()