alperugurcan commited on
Commit
2221e4f
·
verified ·
1 Parent(s): 7e05ded

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -9,7 +9,8 @@ model = load_model('traffic_classifier.h5')
9
 
10
  def process_image(image):
11
  img=np.array(image)
12
- img=img.convert('RGB')
 
13
  img=cv2.resize(img,(30,30))
14
  img=img/255.0
15
  img=np.expand_dims(img,axis=0)
 
9
 
10
  def process_image(image):
11
  img=np.array(image)
12
+ if img.shape[-1] == 4:
13
+ img = img[:,:,:3]
14
  img=cv2.resize(img,(30,30))
15
  img=img/255.0
16
  img=np.expand_dims(img,axis=0)