Update app.py
Browse files
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 |
-
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 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)
|
|
|