VishnuEcoClim commited on
Commit
9456c86
·
1 Parent(s): fafad4f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -4,7 +4,7 @@ import numpy as np
4
  import PIL
5
  import urllib.request
6
  from utils import *
7
- from fastai.basics import *
8
 
9
  # Function to classify the garbage
10
  def classify_garbage(img_path, model):
@@ -29,12 +29,12 @@ opt = st.selectbox("How do you want to upload the image for classification?", ('
29
  if opt == 'Upload image from device':
30
  file = st.file_uploader('Select', type=['jpg', 'png', 'jpeg'])
31
  if file is not None:
32
- image = to_image(file).resize((256, 256), Image.LANCZOS)
33
 
34
  elif opt == 'Upload image via link':
35
  img_url = st.text_input('Enter the Image Address')
36
  try:
37
- image = to_image(urllib.request.urlopen(img_url)).resize((256, 256), Image.LANCZOS)
38
  except ValueError:
39
  st.error("Please Enter a valid Image Address!")
40
 
 
4
  import PIL
5
  import urllib.request
6
  from utils import *
7
+ from fastai.data.external import *
8
 
9
  # Function to classify the garbage
10
  def classify_garbage(img_path, model):
 
29
  if opt == 'Upload image from device':
30
  file = st.file_uploader('Select', type=['jpg', 'png', 'jpeg'])
31
  if file is not None:
32
+ image = Image.open(file).resize((256, 256), Image.LANCZOS)
33
 
34
  elif opt == 'Upload image via link':
35
  img_url = st.text_input('Enter the Image Address')
36
  try:
37
+ image = Image.open(urllib.request.urlopen(img_url)).resize((256, 256), Image.LANCZOS)
38
  except ValueError:
39
  st.error("Please Enter a valid Image Address!")
40