tommy24 commited on
Commit
1688328
·
1 Parent(s): 193edf8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -30,8 +30,8 @@ def classify(image_path):
30
  try:
31
  image_data = np.array(image_path)
32
  # image = cv.imread(image_path)
33
- image = cv.resize(image, (224, 224))
34
- image_array = np.asarray(image)
35
  normalized_image_array = (image_array.astype(np.float32) / 127.0) - 1
36
  data[0] = normalized_image_array
37
  prediction = model.predict(data)
@@ -79,4 +79,4 @@ iface = gr.Interface(
79
  title="Waste Classifier",
80
  description="Upload an image to classify and get disposal instructions."
81
  )
82
- iface.launch()
 
30
  try:
31
  image_data = np.array(image_path)
32
  # image = cv.imread(image_path)
33
+ image_data = cv.resize(image_data, (224, 224))
34
+ image_array = np.asarray(image_data)
35
  normalized_image_array = (image_array.astype(np.float32) / 127.0) - 1
36
  data[0] = normalized_image_array
37
  prediction = model.predict(data)
 
79
  title="Waste Classifier",
80
  description="Upload an image to classify and get disposal instructions."
81
  )
82
+ iface.launch()