|
import streamlit as st |
|
import pandas as pd |
|
import numpy as np |
|
import plotly.express as px |
|
|
|
|
|
def generate_example_data(): |
|
data = { |
|
'Model': [], |
|
'Version': [], |
|
'Dataset': [], |
|
'Epoch': [], |
|
'FLOPS': [], |
|
'Params': [], |
|
'mAP': [] |
|
} |
|
|
|
|
|
epochs = range(1, 6) |
|
versions = ['v1', 'v2', 'v3'] |
|
for epoch in epochs: |
|
for version in versions: |
|
for model in ['SSD300', 'SSD512', 'DETR']: |
|
for dataset in ['Dataset1', 'Dataset2']: |
|
data['Model'].append(model) |
|
data['Version'].append(version) |
|
data['Dataset'].append(dataset) |
|
data['Epoch'].append(epoch) |
|
data['FLOPS'].append(np.random.randint(100, 300)) |
|
data['Params'].append(np.random.randint(10, 30)) |
|
data['mAP'].append(np.random.uniform(0.7, 0.9)) |
|
|
|
return pd.DataFrame(data) |
|
|
|
|
|
def get_final_metrics(data): |
|
final_metrics = data.groupby(['Model', 'Version']).agg({'FLOPS': 'last', 'Params': 'last', 'mAP': 'last'}).reset_index() |
|
return final_metrics |
|
|
|
|
|
st.title("VIB Compression Results") |
|
|
|
|
|
data = generate_example_data() |
|
|
|
|
|
model = st.sidebar.selectbox("Select Model", ["SSD300", "SSD512", "DETR"]) |
|
dataset = st.sidebar.selectbox("Select Dataset", ["Dataset1", "Dataset2"]) |
|
|
|
|
|
st.subheader("Final Metrics for Each Model Version") |
|
filtered_metrics = get_final_metrics(data[(data['Model'] == model) & (data['Dataset'] == dataset)]) |
|
st.table(filtered_metrics) |
|
|
|
|
|
factor = st.radio("Select Factor to Display", ["FLOPS", "Params", "mAP"]) |
|
|
|
|
|
filtered_data = data[(data['Model'] == model) & (data['Dataset'] == dataset)] |
|
|
|
|
|
if factor == "FLOPS": |
|
fig = px.line(filtered_data, x='Epoch', y='FLOPS', color='Version', title='FLOPS Evolution') |
|
elif factor == "Params": |
|
fig = px.line(filtered_data, x='Epoch', y='Params', color='Version', title='Params Evolution') |
|
else: |
|
fig = px.line(filtered_data, x='Epoch', y='mAP', color='Version', title='mAP Evolution') |
|
|
|
|
|
st.plotly_chart(fig) |