()
| 41 | |
| 42 | |
| 43 | def main(): |
| 44 | tab_file_path, tab_direct_upload = st.tabs(["File Path", "Direct Upload"]) |
| 45 | |
| 46 | with tab_file_path: |
| 47 | file_path = st.text_input('Path to trajectory') |
| 48 | if os.path.isfile(file_path): |
| 49 | with open(file_path, 'rb') as f: |
| 50 | rollout_traj = np.load(f) |
| 51 | show_rollout_traj(rollout_traj, 'FP') |
| 52 | else: |
| 53 | st.warning('Please input a valid path', icon="⚠️") |
| 54 | |
| 55 | with tab_direct_upload: |
| 56 | uploaded_file = st.file_uploader("Upload a trajectory") |
| 57 | if uploaded_file is not None: |
| 58 | rollout_traj = np.load(uploaded_file) |
| 59 | show_rollout_traj(rollout_traj, 'DU') |
| 60 | |
| 61 | |
| 62 | if __name__ == '__main__': |
no test coverage detected