Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| import numpy as np | |
| def predict(*inputs): | |
| data = np.array(inputs) | |
| # Simple logic (stable) | |
| result = 1 if np.sum(data) > 5 else 0 | |
| if result == 1: | |
| return "⚠️ Attack Detected" | |
| else: | |
| return "✅ Normal Traffic" | |
| inputs = [gr.Number(label=f"Feature {i+1}") for i in range(20)] | |
| interface = gr.Interface( | |
| fn=predict, | |
| inputs=inputs, | |
| outputs="text", | |
| title="Intrusion Detection System", | |
| description="Enter feature values to detect attack or normal traffic" | |
| ) | |
| interface.launch() |