chainyo commited on
Commit
8dc61d0
·
1 Parent(s): 4f8ddde

fix plotly figure and colors

Browse files
Files changed (1) hide show
  1. main.py +3 -4
main.py CHANGED
@@ -7,6 +7,7 @@ Author:
7
  """
8
 
9
  import plotly
 
10
  import numpy as np
11
  import pandas as pd
12
  import streamlit as st
@@ -80,10 +81,8 @@ def get_plot(timers: Dict[str, Union[float, List[float]]]) -> plotly.graph_objs.
80
  Dictionary of inference times for each model.
81
  """
82
  data = pd.DataFrame.from_dict(timers, orient="columns")
83
- colors = ["#140f0d", "#2b2c4f", "#615aa2", "#a991fa"]
84
- fig = plotly.figure_factory.create_distplot(
85
- [data[col] for col in data.columns], data.columns, bin_size=0.2, colors=colors
86
- )
87
  fig.update_layout(title_text="Inference Time", xaxis_title="Inference Time (s)", yaxis_title="Number of Samples")
88
  return fig
89
 
 
7
  """
8
 
9
  import plotly
10
+ import plotly.figure_factory as ff
11
  import numpy as np
12
  import pandas as pd
13
  import streamlit as st
 
81
  Dictionary of inference times for each model.
82
  """
83
  data = pd.DataFrame.from_dict(timers, orient="columns")
84
+ colors = ["#84353f", "#b4524b", "#f47e58", "#ffbe67"]
85
+ fig = ff.create_distplot([data[col] for col in data.columns], data.columns, bin_size=0.2, colors=colors)
 
 
86
  fig.update_layout(title_text="Inference Time", xaxis_title="Inference Time (s)", yaxis_title="Number of Samples")
87
  return fig
88