cools commited on
Commit
28b86d4
·
1 Parent(s): 75fd4ca

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -9
app.py CHANGED
@@ -2,17 +2,20 @@ import streamlit as st
2
  import cv2
3
  import Scraper
4
  import Manager
 
5
 
6
 
7
 
8
  loc_link = st.text_input('LOC Link')
9
- Scraper.download_loc('https://tile.loc.gov/storage-services/service/ll/usrep/usrep200/usrep200361/usrep200361.pdf')
10
- Manager.run('200_361')
 
 
 
11
 
12
- col1, col2, col3, col4 = st.columns(4)
13
- image = cv2.imread('PDF Cases/19-896_2135/10-processed.png')
14
- with col1:
15
- st.image(image)
16
- image = cv2.imread('PDF Cases/200_361/0-processed.png')
17
- with col3:
18
- st.image(image)
 
2
  import cv2
3
  import Scraper
4
  import Manager
5
+ import os
6
 
7
 
8
 
9
  loc_link = st.text_input('LOC Link')
10
+ run = st.button("Run")
11
+ if run:
12
+ with st.spinner("Downloading"):
13
+ Scraper.download_loc('https://tile.loc.gov/storage-services/service/ll/usrep/usrep200/usrep200361/usrep200361.pdf')
14
+ Manager.run('200_361')
15
 
16
+ cols = st.columns(4)
17
+ image_filenames = [f for f in os.listdir('PDF Cases/200_361') if "procsessed" in f]
18
+ for (i,f) in enumerate(image_filenames):
19
+ image = cv2.imread('PDF Cases/200_361/' + f)
20
+ with cols[i%4]:
21
+ st.image(image)