Spaces:
Running
Running
phyloforfun
commited on
Commit
•
c47fa5d
1
Parent(s):
94bb15c
update
Browse files
app.py
CHANGED
@@ -1347,6 +1347,12 @@ def clear_image_gallery():
|
|
1347 |
validate_dir(st.session_state['dir_uploaded_images'])
|
1348 |
validate_dir(st.session_state['dir_uploaded_images_small'])
|
1349 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1350 |
def content_tab_settings():
|
1351 |
col_project_1, col_project_2, col_project_3 = st.columns([2,2,2])
|
1352 |
|
@@ -1363,8 +1369,6 @@ def content_tab_settings():
|
|
1363 |
st.header('OCR Overlay Image')
|
1364 |
col_ocr_1, col_ocr_2 = st.columns([4,4])
|
1365 |
|
1366 |
-
|
1367 |
-
os.path.join(st.session_state.dir_home, )
|
1368 |
### Project
|
1369 |
with col_project_1:
|
1370 |
st.subheader('Run name')
|
@@ -1429,10 +1433,13 @@ def content_tab_settings():
|
|
1429 |
st.session_state['input_list_small'].append(file_path_small)
|
1430 |
print(uploaded_file.name)
|
1431 |
|
1432 |
-
|
|
|
|
|
|
|
1433 |
st.session_state['processing_add_on'] = f" {n_images} Images"
|
1434 |
-
print(f"HERE --- {st.session_state['processing_add_on']}")
|
1435 |
uploaded_files = None
|
|
|
1436 |
|
1437 |
with col_local_2:
|
1438 |
if st.session_state['input_list_small']:
|
|
|
1347 |
validate_dir(st.session_state['dir_uploaded_images'])
|
1348 |
validate_dir(st.session_state['dir_uploaded_images_small'])
|
1349 |
|
1350 |
+
def use_test_image():
|
1351 |
+
st.session_state.config['leafmachine']['project']['dir_images_local'] = os.path.join(st.session_state.dir_home,'demo','demo_images')
|
1352 |
+
st.info(f"Processing images from {os.path.join(st.session_state.dir_home,'demo','demo_images')}")
|
1353 |
+
n_images = len([f for f in os.listdir(st.session_state.config['leafmachine']['project']['dir_images_local']) if os.path.isfile(os.path.join(st.session_state.config['leafmachine']['project']['dir_images_local'], f))])
|
1354 |
+
st.session_state['processing_add_on'] = f" {n_images} Images"
|
1355 |
+
|
1356 |
def content_tab_settings():
|
1357 |
col_project_1, col_project_2, col_project_3 = st.columns([2,2,2])
|
1358 |
|
|
|
1369 |
st.header('OCR Overlay Image')
|
1370 |
col_ocr_1, col_ocr_2 = st.columns([4,4])
|
1371 |
|
|
|
|
|
1372 |
### Project
|
1373 |
with col_project_1:
|
1374 |
st.subheader('Run name')
|
|
|
1433 |
st.session_state['input_list_small'].append(file_path_small)
|
1434 |
print(uploaded_file.name)
|
1435 |
|
1436 |
+
# Set the local images to the uploaded images
|
1437 |
+
st.session_state.config['leafmachine']['project']['dir_images_local'] = st.session_state['dir_uploaded_images']
|
1438 |
+
|
1439 |
+
n_images = len([f for f in os.listdir(st.session_state.config['leafmachine']['project']['dir_images_local']) if os.path.isfile(os.path.join(st.session_state.config['leafmachine']['project']['dir_images_local'], f))])
|
1440 |
st.session_state['processing_add_on'] = f" {n_images} Images"
|
|
|
1441 |
uploaded_files = None
|
1442 |
+
st.button("Use Test Image",help="This will clear any uploaded images and load the 1 provided test image.",on_click=use_test_image)
|
1443 |
|
1444 |
with col_local_2:
|
1445 |
if st.session_state['input_list_small']:
|