Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -128,33 +128,33 @@ if uploaded_file is not None:
|
|
| 128 |
obj_summary = summarize_text_and_image(obj_description, obj_text)
|
| 129 |
st.write(f"Object Summary:\n{obj_summary}")
|
| 130 |
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
|
| 135 |
-
data_mapping = create_summary_table(objects_data)
|
| 136 |
-
output_path = os.path.join("data", "output", f"{master_id}_data_mapping.json")
|
| 137 |
-
save_mapping_to_json(data_mapping, output_path)
|
| 138 |
|
| 139 |
-
# Generate the final output image with annotations and summary table
|
| 140 |
-
annotated_image_path, summary_table_path = generate_output(image, outputs[0]['masks'], objects_data, master_id)
|
| 141 |
|
| 142 |
-
st.subheader("Final Output")
|
| 143 |
|
| 144 |
-
# Display the annotated image
|
| 145 |
-
st.image(annotated_image_path, caption='Annotated Image', use_column_width=True)
|
| 146 |
|
| 147 |
-
# Provide a download link for the summary table
|
| 148 |
-
st.write("Summary Table:")
|
| 149 |
-
st.write(f"Download the summary table [here](data/output/{master_id}_summary.csv)")
|
| 150 |
|
| 151 |
-
# Display the mapped data
|
| 152 |
-
st.write("Mapped Data:")
|
| 153 |
-
st.json(data_mapping)
|
| 154 |
-
|
| 155 |
-
# # Display the JSON data
|
| 156 |
# st.write("Mapped Data:")
|
| 157 |
# st.json(data_mapping)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
|
| 159 |
else:
|
| 160 |
st.write("No objects were detected")
|
|
|
|
| 128 |
obj_summary = summarize_text_and_image(obj_description, obj_text)
|
| 129 |
st.write(f"Object Summary:\n{obj_summary}")
|
| 130 |
|
| 131 |
+
# object_id = str(uuid.uuid4())
|
| 132 |
+
# object_data = map_object_data(object_id, obj_description, obj_text, obj_summary)
|
| 133 |
+
# objects_data.append(object_data)
|
| 134 |
|
| 135 |
+
# data_mapping = create_summary_table(objects_data)
|
| 136 |
+
# output_path = os.path.join("data", "output", f"{master_id}_data_mapping.json")
|
| 137 |
+
# save_mapping_to_json(data_mapping, output_path)
|
| 138 |
|
| 139 |
+
# # Generate the final output image with annotations and summary table
|
| 140 |
+
# annotated_image_path, summary_table_path = generate_output(image, outputs[0]['masks'], objects_data, master_id)
|
| 141 |
|
| 142 |
+
# st.subheader("Final Output")
|
| 143 |
|
| 144 |
+
# # Display the annotated image
|
| 145 |
+
# st.image(annotated_image_path, caption='Annotated Image', use_column_width=True)
|
| 146 |
|
| 147 |
+
# # Provide a download link for the summary table
|
| 148 |
+
# st.write("Summary Table:")
|
| 149 |
+
# st.write(f"Download the summary table [here](data/output/{master_id}_summary.csv)")
|
| 150 |
|
| 151 |
+
# # Display the mapped data
|
|
|
|
|
|
|
|
|
|
|
|
|
| 152 |
# st.write("Mapped Data:")
|
| 153 |
# st.json(data_mapping)
|
| 154 |
+
|
| 155 |
+
# # # Display the JSON data
|
| 156 |
+
# # st.write("Mapped Data:")
|
| 157 |
+
# # st.json(data_mapping)
|
| 158 |
|
| 159 |
else:
|
| 160 |
st.write("No objects were detected")
|