[Already solved]When dealing with 3D point clouds, there is a problem with the display of the function pydeck_chart()

Summary

There is a problem when using the pydeck_chart function in the library to load 3D point cloud information. Maybe it is because the amount of information is too large, resulting in no display in the streamlit window

Steps to reproduce

Code snippet:

DATA_URL = "https://raw.githubusercontent.com/ajduberstein/geo_datasets/master/small_waterfall.csv"
df = pd.read_csv(DATA_URL)

target = [df.x.mean(), df.y.mean(), df.z.mean()]

point_cloud_layer = pdk.Layer(
    "PointCloudLayer",
    data=DATA_URL,
    get_position=["x", "y", "z"],
    get_color=["r", "g", "b"],
    get_normal=[0, 0, 15],
    auto_highlight=True,
    pickable=True,
    point_size=3,
)

view_state = pdk.ViewState(target=target, controller=True, rotation_x=15, rotation_orbit=30, zoom=5.3)
view = pdk.View(type="OrbitView", controller=True)

r = pdk.Deck(point_cloud_layer, initial_view_state=view_state, views=[view])

st.pydeck_chart(r)


Expected behavior:
Expected output is like this picture:

Actual behavior:

Actual output is like this picture:

Debug info

  • OS version: window 10
  • Browser version: google chrome

Links

According to Streamlit+PyDeck Performance Issues (compared to non-streamlit usage of Pydeck with local data object) · Issue #5532 · streamlit/streamlit · GitHub

using components.html() embed the html into streamlit app

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.