Skip to content

Commit

Permalink
the app created successfully
Browse files Browse the repository at this point in the history
  • Loading branch information
subratamondal1 committed Aug 8, 2024
1 parent f056614 commit 2301f53
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 142 deletions.
38 changes: 18 additions & 20 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,31 @@
import streamlit as st
from PIL import Image
from preprocess_image import grayscale_contrast

# Title of the app
st.title("Document Extraction")

# Image uploader in the sidebar
uploaded_image = st.sidebar.file_uploader("**Upload Image**",
type=["jpg", "jpeg", "png"])

# Main content area
st.write("### Image Preview")

if uploaded_image is not None:
# Open the uploaded image using PIL
image = Image.open(uploaded_image)
if uploaded_image:
st.write("### Image Preview")

# Display the original image
st.image(image, caption="Uploaded Image", use_column_width=True)

# Placeholder for processed image (for demonstration, we'll just display the same image)
processed_image = image # Replace this with your image processing function

# Display the processed image
st.write("### Processed Image")
st.image(processed_image, caption="Processed Image", use_column_width=True)
# original_image = Image.open(uploaded_image)
st.image(uploaded_image, caption="Uploaded Image", use_column_width=True)

# Optionally, you can add a button to trigger processing
if st.sidebar.button("Process Image"):
# Add your image processing logic here
st.success("Image processed successfully!")
else:
st.info("Please upload an image to see the results.")
if st.button("Process Image"):
# Process the uploaded image
preprocessed_image = grayscale_contrast(uploaded_image)

if preprocessed_image:
# Display the processed image
st.write("### Processed Image")
st.image(preprocessed_image,
caption="Processed Image",
use_column_width=True)
st.success("Image processed successfully!")
else:
st.info("Please upload an image to see the results.")
Loading

0 comments on commit 2301f53

Please sign in to comment.