File size: 2,008 Bytes
16432d6
98b6ea5
 
8dc2d0c
98b6ea5
 
56b01e3
8dc2d0c
ac030d8
56b01e3
8dc2d0c
8dc8812
98b6ea5
16432d6
56b01e3
 
 
 
8dc2d0c
 
56b01e3
 
 
8dc2d0c
56b01e3
 
75e5369
e0ee1d8
54a62dc
56b01e3
 
 
 
 
 
 
 
 
 
 
8dc2d0c
81a7abb
8dc2d0c
 
 
 
 
 
 
 
 
98b6ea5
16432d6
ac030d8
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
51
52
53
54
import streamlit as st
import pandas as pd

def display_csv(file_path, columns_to_display):
    # Load the CSV file using pandas
    df = pd.read_csv(file_path)

    # Select only the specified columns
    df_selected_columns = df[columns_to_display].sort_values(by=['avg_score'], ascending=False).reset_index(drop=True)

    # Display the selected columns as a table
    st.dataframe(df_selected_columns, height=500, width=1000)

def main():
    # Hardcoded file paths
    file_path1 = "merged-averaged-model_timings_2.1.0_12.1_NVIDIA_A10G_False.csv"
    file_path2 = "merged-averaged-model_timings_2.1.0_12.1_Tesla_T4_False.csv"  # Replace with the path to your second CSV file

    # Columns to display
    columns_to_display = [
        "model_name", "pretrained", "avg_score", "image_time", "text_time",
        "image_shape", "text_shape",
        "output shape",
        "params (M)", "FLOPs (B)"
    ]

    # Add header and description
    st.header("CLIP benchmarks - retrieval and inference")
    st.write("CLIP benchmarks for inference and retrieval performance. Image size, context length and output dimensions are also included. Retrieval performance comes from https://github.com/mlfoundations/open_clip/blob/main/docs/openclip_retrieval_results.csv. Tested with T4 and A10G, CUDA 12.1, Torch 2.1.0, AMP, Open CLIP v2.24 .")

    # Add radio button to select the CSV file
    selected_file = st.radio("Select results for a specific GPU", ("GPU: A10g", "GPU: T4"))

    # Determine the file path based on the selected file
    if selected_file == "GPU: A10g":
        file_path = file_path1
    else:
        file_path = file_path2

    # Call the display_csv function with the selected file path and columns
    display_csv(file_path, columns_to_display)

    # Custom CSS to make the app full screen
    st.markdown("""
    <style>
    .reportview-container {
        width: 100%;
        height: 100%;
    }
    </style>
    """, unsafe_allow_html=True)

if __name__ == "__main__":
    main()