Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,11 +3,8 @@ import numpy as np
|
|
| 3 |
from ultralytics import YOLO
|
| 4 |
import streamlit as st
|
| 5 |
|
| 6 |
-
model = YOLO('
|
| 7 |
-
font_size = 40
|
| 8 |
img = st.file_uploader('Choose an Image')
|
| 9 |
-
font = ImageFont.truetype("arial.ttf", size=font_size)
|
| 10 |
-
arr = ['With mask','Without mask']
|
| 11 |
|
| 12 |
if img is not None:
|
| 13 |
img = Image.open(img).resize((640,640)).convert('RGB')
|
|
@@ -15,5 +12,5 @@ if img is not None:
|
|
| 15 |
st.image(img,'Input')
|
| 16 |
for result in results:
|
| 17 |
for j, mask in result.masks.data:
|
| 18 |
-
mask = mask.numpy()*255
|
| 19 |
st.image(mask,'Mask')
|
|
|
|
| 3 |
from ultralytics import YOLO
|
| 4 |
import streamlit as st
|
| 5 |
|
| 6 |
+
model = YOLO('LaneSegmentation.pt')
|
|
|
|
| 7 |
img = st.file_uploader('Choose an Image')
|
|
|
|
|
|
|
| 8 |
|
| 9 |
if img is not None:
|
| 10 |
img = Image.open(img).resize((640,640)).convert('RGB')
|
|
|
|
| 12 |
st.image(img,'Input')
|
| 13 |
for result in results:
|
| 14 |
for j, mask in result.masks.data:
|
| 15 |
+
mask = mask.numpy()* 255
|
| 16 |
st.image(mask,'Mask')
|