IDS_project / app.py
dev1461's picture
Create app.py
0e8f14a verified
import streamlit as st
import numpy as np
st.title("Intrusion Detection System")
st.write("Enter input values:")
# Example input (adjust size if needed)
inputs = []
for i in range(50): # match your feature count
val = st.number_input(f"Feature {i+1}", value=0.0)
inputs.append(val)
if st.button("Predict"):
data = np.array(inputs).reshape(1, -1)
prediction = model.predict(data)
result = int(prediction[0][0] > 0.5)
if result == 1:
st.error("⚠️ Attack Detected")
else:
st.success("✅ Normal Traffic")