File size: 455 Bytes
e89aa20
 
 
 
 
ae608bd
e89aa20
 
 
 
 
 
 
097e3d9
07c9f89
e89aa20
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from PIL import Image,ImageDraw,ImageFont
import numpy as np
from ultralytics import YOLO
import streamlit as st

model = YOLO('LaneSegmentation.pt')
img = st.file_uploader('Choose an Image')

if img is not None:
    img = Image.open(img).resize((640,640)).convert('RGB')
    results = model(img)
    st.image(img,'Input')
    for result in results:
        for mask in result.masks.data:
            mask = mask.numpy()
            st.image(mask,'Mask')