Update app.py
Browse files
app.py
CHANGED
|
@@ -2,6 +2,8 @@ import streamlit as st
|
|
| 2 |
import os
|
| 3 |
import zipfile
|
| 4 |
from PIL import Image, ImageDraw, ImageFont
|
|
|
|
|
|
|
| 5 |
|
| 6 |
def draw_ruler(image, dpi=300, unit="in", color="black"):
|
| 7 |
"""
|
|
@@ -219,7 +221,7 @@ def main():
|
|
| 219 |
if index < num_images:
|
| 220 |
cols[col].subheader(f"Image {index+1}")
|
| 221 |
cols[col].image(uploaded_files[index], caption="Original Image", width=col_width)
|
| 222 |
-
cols[col].image(cropped_images[index], caption="Cropped Image", width=col_width)
|
| 223 |
|
| 224 |
# Save all cropped images
|
| 225 |
if st.button("Save All"):
|
|
|
|
| 2 |
import os
|
| 3 |
import zipfile
|
| 4 |
from PIL import Image, ImageDraw, ImageFont
|
| 5 |
+
from rembg import remove
|
| 6 |
+
|
| 7 |
|
| 8 |
def draw_ruler(image, dpi=300, unit="in", color="black"):
|
| 9 |
"""
|
|
|
|
| 221 |
if index < num_images:
|
| 222 |
cols[col].subheader(f"Image {index+1}")
|
| 223 |
cols[col].image(uploaded_files[index], caption="Original Image", width=col_width)
|
| 224 |
+
cols[col].image(remove(cropped_images[index]), caption="Cropped Image", width=col_width)
|
| 225 |
|
| 226 |
# Save all cropped images
|
| 227 |
if st.button("Save All"):
|