File size: 1,877 Bytes
2182139 | 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 40 41 42 43 44 45 46 47 48 49 50 | import gradio as gr
import random
def simulate_edge(device_type, ai_model, edge_location):
latency = round(random.uniform(2, 25), 1)
accuracy = round(random.uniform(88, 99), 1)
power = round(random.uniform(2, 12), 1)
throughput = random.randint(15, 120)
result = f"""### AIoT Edge Simulation Results
**Device Type**: {device_type}
**AI Model**: {ai_model}
**Edge Location**: {edge_location}
🎮 **Simulation Metrics**:
- Inference Latency: {latency}ms
- Model Accuracy: {accuracy}%
- Power Consumption: {power}W
- Throughput: {throughput} inferences/sec
- Edge Processing: {'Enabled' if random.choice([True, False]) else 'Cloud Fallback'}
**Status**: ✅ Simulation completed successfully
---
**Anktechsol** - AIoT & Edge AI Solutions
🔗 [Visit anktechsol.com](https://anktechsol.com)"""
return result
with gr.Blocks(title="AIoT Edge Simulator") as demo:
gr.Markdown("# 🌐 AIoT & Edge AI Simulator")
gr.Markdown("Test AIoT deployments - **Anktechsol**")
with gr.Row():
with gr.Column():
device = gr.Dropdown(["Raspberry Pi 4", "Jetson Nano", "AWS IoT Greengrass", "Azure IoT Edge"], label="Edge Device", value="Raspberry Pi 4")
model = gr.Dropdown(["Object Detection", "Image Classification", "Anomaly Detection", "Predictive Model"], label="AI Model", value="Object Detection")
location = gr.Radio(["Factory Floor", "Warehouse", "Retail Store", "Remote Site"], label="Deployment Location", value="Factory Floor")
btn = gr.Button("Run Simulation")
with gr.Column():
output = gr.Markdown()
btn.click(simulate_edge, inputs=[device, model, location], outputs=output)
gr.Markdown("""---
### Anktechsol - AIoT Specialists
Edge AI deployment & AIoT consulting. [Get started](https://anktechsol.com)""")
demo.launch() |