Spaces:
Running
Running
vishalkatheriya18
commited on
Commit
•
0861614
1
Parent(s):
a69b8f5
Update app.py
Browse files
app.py
CHANGED
@@ -12,12 +12,6 @@ from classification import pipes
|
|
12 |
from rembg import remove
|
13 |
from PIL import Image
|
14 |
|
15 |
-
# input_path = 'input.png'
|
16 |
-
# output_path = 'output.png'
|
17 |
-
|
18 |
-
# input = Image.open(input_path)
|
19 |
-
# output = remove(input)
|
20 |
-
# output.save(output_path)
|
21 |
time_taken={}
|
22 |
# Categories dictionary
|
23 |
categories_dict = {
|
@@ -73,9 +67,9 @@ if url:
|
|
73 |
image = Image.open(BytesIO(response.content))
|
74 |
st.sidebar.image(image.resize((200, 200)), caption="Uploaded Image", use_column_width=False)
|
75 |
# Ensure the image is in RGBA mode (or RGB)
|
76 |
-
if image.mode != 'RGB':
|
77 |
-
image = image.convert('RGB')
|
78 |
rmimg = remove(image)
|
|
|
|
|
79 |
# Convert image to numpy array for YOLO model
|
80 |
image_np = np.array(image)
|
81 |
outputs={}
|
|
|
12 |
from rembg import remove
|
13 |
from PIL import Image
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
time_taken={}
|
16 |
# Categories dictionary
|
17 |
categories_dict = {
|
|
|
67 |
image = Image.open(BytesIO(response.content))
|
68 |
st.sidebar.image(image.resize((200, 200)), caption="Uploaded Image", use_column_width=False)
|
69 |
# Ensure the image is in RGBA mode (or RGB)
|
|
|
|
|
70 |
rmimg = remove(image)
|
71 |
+
if rmimg.mode != 'RGB':
|
72 |
+
rmimg = rmimg.convert('RGB')
|
73 |
# Convert image to numpy array for YOLO model
|
74 |
image_np = np.array(image)
|
75 |
outputs={}
|