|
import streamlit |
|
import pickle |
|
import numpy |
|
|
|
|
|
|
|
|
|
|
|
loaded_model = pickle.load(open('MWmodel.sav','rb')) |
|
|
|
def microwave_fault_prediction (user_input_data): |
|
|
|
Input_array = numpy.asarray(user_input_data) |
|
Input_array_reshaped = Input_array.reshape(1, -1) |
|
make_prediction = loaded_model.predict(Input_array_reshaped) |
|
print(make_prediction) |
|
|
|
if make_prediction== 0: |
|
return 'site is up' |
|
elif make_prediction == 1: |
|
return'site is down: fault: 1. inteference 2. misalignment 3. one of the odu is faulty' |
|
elif make_prediction == 2: |
|
return 'site is down: fault: 1. NO power at remote site(A),2.ODU offline remote site(A)(check alarm \'IF cable open\') ' |
|
elif make_prediction == 3: |
|
return 'site is down: fault:1.ODu hunged at remote site(A), reset power at both sites(A,B)' |
|
elif make_prediction == 4: |
|
return 'site is down: fault: 1. cascaded cable faulty at hub Site (B), 2. ODU/IDU/If cable offline,at remote end' |
|
elif make_prediction == 5: |
|
return'site is down: fault: 1 ODU at hub site(B)degraded( reset ODU, reterminate IF cable,check alarm)' |
|
elif make_prediction == 6: |
|
return 'site is down: faulty: if power is okay, odu burnt at either remote site (A) OR (B)' |
|
else: |
|
return 'case 7: site status cannot be determined by RSL data' |
|
|
|
|
|
def main(): |
|
|
|
streamlit.title('microwave fault detection web app') |
|
|
|
RSLA = streamlit.number_input('Site A Local end: enter RSL of the site, it must be negative number, input zero for no supervision',min_value=-99, max_value=0, value=-30, step=1,key= 'rsla') |
|
|
|
RSLB = streamlit.number_input('Site B Remote end: enter RSL of the Hub site, it must be negative number, input zero for no supervision',min_value=-99, max_value=0, value=-30, step=1,key= 'rslb') |
|
|
|
detection ="" |
|
|
|
if streamlit.button('click here for fault prediction'): |
|
detection=microwave_fault_prediction([RSLA,RSLB]) |
|
|
|
|
|
streamlit.success(detection) |
|
if __name__ == '__main__': |
|
main() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|