File size: 1,089 Bytes
147156b
 
 
 
 
 
 
 
554697f
147156b
 
554697f
243ea28
147156b
 
 
 
 
 
 
 
0d069be
147156b
 
 
 
 
 
 
 
 
 
 
 
 
 
554697f
147156b
 
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
36
37
38
39
import gradio as gr
import numpy as np
import pandas as pd
import tensorflow as tf
from tensorflow import keras

#loading the saved model 
from keras.models import load_model 
model = load_model('model.h5')


def ana(Gender ,Hemoglobin, MCH, MCHC, MCV):
    prediction = model.predict([[Gender ,Hemoglobin, MCH, MCHC, MCV]])
    if (prediction[0] ==0):
      return "Positive"

    elif (prediction[0] ==1):
      return "Negative"
    else:
      return "Error"

#create input and output objects-
#input object1
input1 = gr.inputs.Number(label="Gender")
#input object 2
input2 = gr.inputs.Number(label="Hemoglobin")
#input object3
input3 = gr.inputs.Number(label="Mean Corpusular Hemoglobin (MCH)")
#input object 3
input4 = gr.inputs.Number(label="Mean Corpusular Hemoglobin Concentration (MCH")
#input object
input5 = gr.inputs.Number(label="Mean Corpusular Volume (MCV)")

output = gr.outputs.Textbox(label= "RESULT") 

#create interface
gui = gr.Interface(fn=ana,
                   inputs=[input1, input2, input3, input4, input5],
                   outputs=output).launch(debug=True)