Tomatillo commited on
Commit
356884b
·
verified ·
1 Parent(s): 705767f

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +6 -1
src/streamlit_app.py CHANGED
@@ -8,6 +8,10 @@ from get_labels_from_samples import export_all_sensor_frames_and_annotations
8
  st.title("Copy annotations from one dataset to another")
9
  st.subheader("For Multi-sensor datasets - Cuboids and bounding boxes")
10
 
 
 
 
 
11
  api_key = st.text_input("Enter your API Key", type="password")
12
  source_uuid = st.text_input("Source UUID (the sample you want to copy from)", value="")
13
  source_frame_num = st.number_input("Source Frame Number", min_value=1, value=50, step=1)
@@ -15,6 +19,7 @@ target_uuid = st.text_input("Target UUID (the sample you want to copy to)", valu
15
  target_frame_num = st.number_input("Target Frame Number", min_value=1, value=1, step=1)
16
 
17
  if st.button("Overwrite Target Frame Annotations"):
 
18
  if not api_key or not source_uuid or not target_uuid:
19
  st.error("Please fill in all fields.")
20
  else:
@@ -62,6 +67,6 @@ if st.button("Overwrite Target Frame Annotations"):
62
  labelset="ground-truth", # Change this if you use a different labelset name
63
  attributes=new_target_label.attributes.model_dump()
64
  )
65
- st.success("Target label updated and uploaded to Segments.ai!")
66
  except Exception as e:
67
  st.error(f"Error: {e}")
 
8
  st.title("Copy annotations from one dataset to another")
9
  st.subheader("For Multi-sensor datasets - Cuboids and bounding boxes")
10
 
11
+ # Initialize success message in session state
12
+ if "success" not in st.session_state:
13
+ st.session_state.success = ""
14
+
15
  api_key = st.text_input("Enter your API Key", type="password")
16
  source_uuid = st.text_input("Source UUID (the sample you want to copy from)", value="")
17
  source_frame_num = st.number_input("Source Frame Number", min_value=1, value=50, step=1)
 
19
  target_frame_num = st.number_input("Target Frame Number", min_value=1, value=1, step=1)
20
 
21
  if st.button("Overwrite Target Frame Annotations"):
22
+ st.session_state.success = "" # Clear previous success message
23
  if not api_key or not source_uuid or not target_uuid:
24
  st.error("Please fill in all fields.")
25
  else:
 
67
  labelset="ground-truth", # Change this if you use a different labelset name
68
  attributes=new_target_label.attributes.model_dump()
69
  )
70
+ st.session_state.success = "Target label updated and uploaded to Segments.ai!"
71
  except Exception as e:
72
  st.error(f"Error: {e}")