Update app.py
Browse files
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
|
|
|
|
| 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)
|