Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ model = YOLOv10("doclayout_yolo_docstructbench_imgsz1024.pt")
|
|
| 10 |
|
| 11 |
# Automatically select device
|
| 12 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
| 13 |
-
st.write(f"Using device: {device}")
|
| 14 |
|
| 15 |
# Streamlit UI
|
| 16 |
st.title("Document Layout Detection")
|
|
@@ -20,7 +20,7 @@ uploaded_file = st.file_uploader("Upload Image", type=["jpg", "jpeg", "png"])
|
|
| 20 |
|
| 21 |
if uploaded_file is not None:
|
| 22 |
# Display the uploaded image
|
| 23 |
-
st.image(uploaded_file, caption="Uploaded Image", use_container_width=True)
|
| 24 |
|
| 25 |
# Load the uploaded image
|
| 26 |
image = Image.open(uploaded_file).convert("RGB")
|
|
@@ -45,3 +45,8 @@ if uploaded_file is not None:
|
|
| 45 |
# Display the annotated image
|
| 46 |
st.image(annotated_image, caption="Annotated Image", use_container_width=True)
|
| 47 |
st.success("Detection completed!")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
# Automatically select device
|
| 12 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
| 13 |
+
#st.write(f"Using device: {device}")
|
| 14 |
|
| 15 |
# Streamlit UI
|
| 16 |
st.title("Document Layout Detection")
|
|
|
|
| 20 |
|
| 21 |
if uploaded_file is not None:
|
| 22 |
# Display the uploaded image
|
| 23 |
+
#st.image(uploaded_file, caption="Uploaded Image", use_container_width=True)
|
| 24 |
|
| 25 |
# Load the uploaded image
|
| 26 |
image = Image.open(uploaded_file).convert("RGB")
|
|
|
|
| 45 |
# Display the annotated image
|
| 46 |
st.image(annotated_image, caption="Annotated Image", use_container_width=True)
|
| 47 |
st.success("Detection completed!")
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
st.write("Application Created By Shubham Mhaske")
|
| 51 |
+
st.write("Do have a look on Papers 📄 : - https://arxiv.org/pdf/2410.12628")
|
| 52 |
+
st.write("Thanks to https://github.com/opendatalab")
|