Spaces:
Sleeping
Sleeping
File size: 1,179 Bytes
d5a3f17 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
import pickle
import gradio as gr
with open("Condition_Model","rb") as f:
mp=pickle.load(f)
def Conditional_Prediction(Gender,Height,Weight):
Gen=0
if(Gender=="Male"):
Gen=1
elif(Gender=="Female"):
Gen=0
Height=float(Height)
Weight=float(Weight)
result=mp.predict([[Gen,Height,Weight]])
print(result[0])
if result[0]==0:
final_result="You have Extremely Weak Body Condition"
elif result[0]==1:
final_result="You have Weak Body Condition"
elif result[0]==2:
final_result="You have Normal Body Condition"
elif result[0]==3:
final_result="You have Estimated Overweight"
elif result[0]==4:
final_result="You have Estimated Obesity"
elif result[0]==5:
final_result="You seem to have Extreme Obesity"
return final_result
interface=gr.Interface(fn=Conditional_Prediction,inputs=[gr.inputs.Radio(["Male","Female"],type="value",label="Gender"),gr.inputs.Textbox(lines=2,placeholder="Enter Your Height"),gr.inputs.Textbox(lines=2,placeholder="Enter Your Weight")],
outputs=[gr.outputs.Textbox(label="Your Estimated Condition")],
enable_queu=True)
interface.launch(debug=True) |