crop_yield / app.py
abdulsamod's picture
Update app.py
e8178cb
raw
history blame
980 Bytes
import pickle
import numpy as np
model = pickle.load(open(model.pkl, 'rb'))
def crop_yield(Planted, Size of land (Hectare), Bags, Soil Type, Type of Seed, Color of Seeds):
prediction = model.predict([[Planted, Size of land (Hectare), Bags, Soil Type, Type of Seed, Color of Seeds]])
return prediction
#create input and output objects
#input object1
input1 = gr.inputs.Number(label="Planted")
#input object 2
input2 = gr.inputs.Number(label="Size of land (Hectare)")
#input object3
input3 = gr.inputs.Number(label="Number of Bags")
#input object 3
input4 = gr.inputs.Number(label="Soil Type")
#input object 3
input5 = gr.inputs.Number(label="Type of Seed")
#input object 3
input6 = gr.inputs.Number(label="Color of Seeds")
#output object
output = gr.outputs.Textbox(label= "Number of Yields")
#create interface
gui = gr.Interface(fn=crop_yield,
inputs=[input1, input2, input3, input4, input5, input6],
outputs=output).launch()