File size: 1,909 Bytes
796b62e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
55
56
57
58
59
import urllib.parse

import pandas as pd
from gradio.themes.utils.colors import Color


DATA_URL = 'https://raw.githubusercontent.com/Deeplite/deeplite-torch-zoo/develop/results/yolobench/'

DEEPLITE_DARK_BLUE_RGB = (0, 66, 107)
DEEPLITE_DARK_BLUE_HEX = '#00426B'

DEEPLITE_LIGHT_BLUE_RGB = (0, 148, 206)
DEEPLITE_LIGHT_BLUE_HEX = '#0094CE'

DEEPLITE_DARK_BLUE_GRADIO = Color(
    name='deeplite_dark_blue',
    c50=DEEPLITE_DARK_BLUE_HEX,
    c100=DEEPLITE_DARK_BLUE_HEX,
    c200=DEEPLITE_DARK_BLUE_HEX,
    c300=DEEPLITE_DARK_BLUE_HEX,
    c400=DEEPLITE_DARK_BLUE_HEX,
    c500=DEEPLITE_DARK_BLUE_HEX,
    c600=DEEPLITE_DARK_BLUE_HEX,
    c700=DEEPLITE_DARK_BLUE_HEX,
    c800=DEEPLITE_DARK_BLUE_HEX,
    c900=DEEPLITE_DARK_BLUE_HEX,
    c950=DEEPLITE_DARK_BLUE_HEX,
)

DEEPLITE_LIGHT_BLUE_GRADIO = Color(
    name='deeplite_dark_blue',
    c50=DEEPLITE_LIGHT_BLUE_HEX,
    c100=DEEPLITE_LIGHT_BLUE_HEX,
    c200=DEEPLITE_LIGHT_BLUE_HEX,
    c300=DEEPLITE_LIGHT_BLUE_HEX,
    c400=DEEPLITE_LIGHT_BLUE_HEX,
    c500=DEEPLITE_LIGHT_BLUE_HEX,
    c600=DEEPLITE_LIGHT_BLUE_HEX,
    c700=DEEPLITE_LIGHT_BLUE_HEX,
    c800=DEEPLITE_LIGHT_BLUE_HEX,
    c900=DEEPLITE_LIGHT_BLUE_HEX,
    c950=DEEPLITE_LIGHT_BLUE_HEX,
)


def load_yolobench_data():
    df = pd.read_csv(urllib.parse.urljoin(DATA_URL, 'merged_results.csv'))
    pareto_indices_df = pd.read_csv(urllib.parse.urljoin(DATA_URL, 'pareto_indices.csv'))
    pareto_indices = {}
    for row_idx in range(pareto_indices_df.shape[0]):
        data_key = pareto_indices_df.iloc[row_idx, :]['data']
        if data_key not in pareto_indices:
            pareto_indices[data_key] = {}
        hw_key = pareto_indices_df.iloc[row_idx, :]['hardware']
        indices = pareto_indices_df.iloc[row_idx, :]['pareto_indices']
        indices = [int(val) for val in indices.split(',')]
        pareto_indices[data_key][hw_key] = indices
    return df, pareto_indices