aus10powell commited on
Commit
edd6d44
1 Parent(s): c580c86

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -39,7 +39,9 @@ def load_video(video_url):
39
 
40
  @st.cache_data
41
  def load_historical(fpath):
42
- return pd.read_csv(fpath)
 
 
43
 
44
 
45
 
@@ -47,7 +49,7 @@ def load_historical(fpath):
47
  # Define the main function to run the Streamlit app
48
  def run_app():
49
  # Set Streamlit options
50
- st.set_page_config(layout="wide")
51
  st.set_option("deprecation.showfileUploaderEncoding", False)
52
 
53
  # App title and description
@@ -65,7 +67,7 @@ def run_app():
65
  gpu_available = torch.cuda.is_available()
66
  mps_available = torch.backends.mps.is_available()
67
 
68
- main_tab, upload_tab = st.tabs(["Analysis", "Upload video for analysis"])
69
 
70
  with main_tab:
71
 
@@ -80,7 +82,8 @@ def run_app():
80
  use_container_width=True,
81
  )
82
  st.subheader("Yearly Totals (from manual counts)")
83
- st.dataframe(df_historical_herring.groupby(df_historical_herring["Date"].dt.year).sum().T)
 
84
  # Display map of fishery locations
85
  st.subheader("Map of Fishery Locations")
86
  st.map(
 
39
 
40
  @st.cache_data
41
  def load_historical(fpath):
42
+ df = pd.read_csv(fpath)
43
+ df['Date'] = pd.to_datetime(df['Date'])
44
+ return df
45
 
46
 
47
 
 
49
  # Define the main function to run the Streamlit app
50
  def run_app():
51
  # Set Streamlit options
52
+ # st.set_page_config(layout="wide")
53
  st.set_option("deprecation.showfileUploaderEncoding", False)
54
 
55
  # App title and description
 
67
  gpu_available = torch.cuda.is_available()
68
  mps_available = torch.backends.mps.is_available()
69
 
70
+ upload_tab, main_tab = st.tabs(["Upload video for analysis", "Analysis", ])
71
 
72
  with main_tab:
73
 
 
82
  use_container_width=True,
83
  )
84
  st.subheader("Yearly Totals (from manual counts)")
85
+ df_historical_herring["Year"] = df_historical_herring["Date"].dt.year
86
+ st.dataframe(df_historical_herring.groupby('Year')['Count'].sum().T)
87
  # Display map of fishery locations
88
  st.subheader("Map of Fishery Locations")
89
  st.map(