Spaces:
Runtime error
Runtime error
Commit
·
0d9b543
1
Parent(s):
83f48c6
Upload 4 files
Browse files- best_new_v2.pt +3 -0
- packages.txt +2 -0
- requirements.txt +0 -0
- web.py +52 -0
best_new_v2.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:75b7fee7b255144dd980793d9083f8194396a43075963818159491607a09e885
|
| 3 |
+
size 546150559
|
packages.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
python-opencv-headless
|
| 2 |
+
libgl1
|
requirements.txt
ADDED
|
Binary file (2.43 kB). View file
|
|
|
web.py
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
from PIL import Image
|
| 3 |
+
from ultralytics import YOLO
|
| 4 |
+
import time
|
| 5 |
+
|
| 6 |
+
st.title('Aloe Vera Plant Disease Analyser')
|
| 7 |
+
|
| 8 |
+
col1,col2=st.columns(2)
|
| 9 |
+
upload_stat=0
|
| 10 |
+
with col1:
|
| 11 |
+
|
| 12 |
+
input_image=st.file_uploader('Upload The Image File Here',type=['jpg','png'])
|
| 13 |
+
|
| 14 |
+
confirmation=st.button('Submit')
|
| 15 |
+
if confirmation==True:
|
| 16 |
+
st.image(input_image)
|
| 17 |
+
upload_stat=1
|
| 18 |
+
|
| 19 |
+
with col2:
|
| 20 |
+
st.subheader('Detection:')
|
| 21 |
+
if upload_stat==1:
|
| 22 |
+
image_new=Image.open(input_image)
|
| 23 |
+
model1 = YOLO('git_weight.pt')
|
| 24 |
+
model2=YOLO('best.pt')
|
| 25 |
+
model3=YOLO('best_new_v2.pt')
|
| 26 |
+
model4=YOLO('best_v4.pt')
|
| 27 |
+
|
| 28 |
+
results1 = model1(image_new)
|
| 29 |
+
results2= model2(image_new)
|
| 30 |
+
results3= model3(image_new)
|
| 31 |
+
result4=model4(image_new)
|
| 32 |
+
st.subheader('Model 1')
|
| 33 |
+
for r in results1:
|
| 34 |
+
im_array = r.plot() # plot a BGR numpy array of predictions
|
| 35 |
+
im = Image.fromarray(im_array[..., ::-1]) # RGB PIL image
|
| 36 |
+
st.image(im) # show image
|
| 37 |
+
st.subheader('Model 2')
|
| 38 |
+
for r in results2:
|
| 39 |
+
im_array = r.plot() # plot a BGR numpy array of predictions
|
| 40 |
+
im = Image.fromarray(im_array[..., ::-1]) # RGB PIL image
|
| 41 |
+
st.image(im) # show image
|
| 42 |
+
st.subheader('Model 3')
|
| 43 |
+
for r in results3:
|
| 44 |
+
im_array = r.plot() # plot a BGR numpy array of predictions
|
| 45 |
+
im = Image.fromarray(im_array[..., ::-1]) # RGB PIL image
|
| 46 |
+
st.image(im) # show image
|
| 47 |
+
for r in result4:
|
| 48 |
+
im_array = r.plot() # plot a BGR numpy array of predictions
|
| 49 |
+
im = Image.fromarray(im_array[..., ::-1]) # RGB PIL image
|
| 50 |
+
st.image(im) # show image
|
| 51 |
+
|
| 52 |
+
|