Spaces:
Runtime error
Runtime error
bills
commited on
Commit
•
372dfad
1
Parent(s):
e1460c8
Change source of AIS dataset
Browse files- apps/__pycache__/home.cpython-37.pyc +0 -0
- apps/home.py +27 -5
apps/__pycache__/home.cpython-37.pyc
CHANGED
Binary files a/apps/__pycache__/home.cpython-37.pyc and b/apps/__pycache__/home.cpython-37.pyc differ
|
|
apps/home.py
CHANGED
@@ -6,7 +6,8 @@ import numpy as np
|
|
6 |
import pandas as pd
|
7 |
import streamlit as st
|
8 |
from folium.plugins import MarkerCluster
|
9 |
-
from streamlit_folium import folium_static
|
|
|
10 |
|
11 |
def app():
|
12 |
st.write("# Welcome to Ship Detection Application! :satellite:")
|
@@ -24,7 +25,7 @@ def app():
|
|
24 |
|
25 |
"""
|
26 |
)
|
27 |
-
ais = pd.read_csv("https://raw.githubusercontent.com/bills1912/marine-vessels-dataset/main/
|
28 |
ais_jakarta = ais[ais['Destination Port'] == 'JAKARTA']
|
29 |
ais_list = ais_jakarta.values.tolist()
|
30 |
f = folium.Figure(width=1000, height=500)
|
@@ -32,14 +33,35 @@ def app():
|
|
32 |
ais_data = folium.FeatureGroup(name="marine_vessels")
|
33 |
mCluster = MarkerCluster(name="Marine Vessels")
|
34 |
for i in ais_list:
|
35 |
-
html = f"<h3>{i[1]}</h3> Vessel Type: {i[
|
36 |
-
</br> Latitude: {i[
|
37 |
iframe = folium.IFrame(html)
|
38 |
popup = folium.Popup(iframe, min_width=250, max_width=300)
|
39 |
-
ais_data.add_child(mCluster.add_child(folium.Marker(location=[i[
|
40 |
jakarta_vessels.add_child(ais_data)
|
41 |
folium_static(jakarta_vessels, width=1100, height=700)
|
42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
st.markdown(
|
44 |
"""
|
45 |
## Explanation of The Ship Detection Result
|
|
|
6 |
import pandas as pd
|
7 |
import streamlit as st
|
8 |
from folium.plugins import MarkerCluster
|
9 |
+
from streamlit_folium import folium_static
|
10 |
+
from st_aggrid import GridOptionsBuilder, AgGrid, GridUpdateMode, DataReturnMode
|
11 |
|
12 |
def app():
|
13 |
st.write("# Welcome to Ship Detection Application! :satellite:")
|
|
|
25 |
|
26 |
"""
|
27 |
)
|
28 |
+
ais = pd.read_csv("https://raw.githubusercontent.com/bills1912/marine-vessels-dataset/main/ais_dataV2.csv")
|
29 |
ais_jakarta = ais[ais['Destination Port'] == 'JAKARTA']
|
30 |
ais_list = ais_jakarta.values.tolist()
|
31 |
f = folium.Figure(width=1000, height=500)
|
|
|
33 |
ais_data = folium.FeatureGroup(name="marine_vessels")
|
34 |
mCluster = MarkerCluster(name="Marine Vessels")
|
35 |
for i in ais_list:
|
36 |
+
html = f"<h3>{i[1]}</h3> Vessel Type: {i[8]} </br> Destination Port: {i[2]} </br> Reported Destination: {i[4]} </br> Current Port: {i[5]}\
|
37 |
+
</br> Latitude: {i[10]} </br> Longitude: {i[11]}"
|
38 |
iframe = folium.IFrame(html)
|
39 |
popup = folium.Popup(iframe, min_width=250, max_width=300)
|
40 |
+
ais_data.add_child(mCluster.add_child(folium.Marker(location=[i[10], i[11]], popup=popup, icon=folium.Icon(color="black", icon="ship", prefix="fa"))))
|
41 |
jakarta_vessels.add_child(ais_data)
|
42 |
folium_static(jakarta_vessels, width=1100, height=700)
|
43 |
|
44 |
+
# gb = GridOptionsBuilder.from_dataframe(ais)
|
45 |
+
# gb.configure_pagination(paginationAutoPageSize=True) #Add pagination
|
46 |
+
# gb.configure_selection('multiple', use_checkbox=False) #Enable multi-row selection
|
47 |
+
# gridOptions = gb.build()
|
48 |
+
|
49 |
+
# grid_response = AgGrid(
|
50 |
+
# ais,
|
51 |
+
# gridOptions=gridOptions,
|
52 |
+
# data_return_mode='AS_INPUT',
|
53 |
+
# update_mode='MODEL_CHANGED',
|
54 |
+
# fit_columns_on_grid_load=False,
|
55 |
+
# theme='dark', #Add theme color to the table
|
56 |
+
# enable_enterprise_modules=True,
|
57 |
+
# height=350,
|
58 |
+
# width='100%',
|
59 |
+
# reload_data=True
|
60 |
+
# )
|
61 |
+
|
62 |
+
# data = grid_response['data']
|
63 |
+
# selected = grid_response['selected_rows']
|
64 |
+
|
65 |
st.markdown(
|
66 |
"""
|
67 |
## Explanation of The Ship Detection Result
|