mybYusuf commited on
Commit
a28f7bf
·
verified ·
1 Parent(s): 7eb4c6f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -10,7 +10,10 @@ with open('class_labels.json', 'r') as f:
10
  class_labels = json.load(f)
11
 
12
  def preprocess_image(image):
 
 
13
  image = cv2.resize(image, (128,128)) # Model için kullandığımız boyuta getir
 
14
  image = image.astype('float32') / 255.0 # Normalize et
15
  return np.expand_dims(image, axis=0) # Batch boyutu ekle
16
 
 
10
  class_labels = json.load(f)
11
 
12
  def preprocess_image(image):
13
+
14
+ image = cv2.cvtColor(image, cv2.COLOR_RGB2BGR) # Veri okuma uyumsuzluğunu kaldırma
15
  image = cv2.resize(image, (128,128)) # Model için kullandığımız boyuta getir
16
+ image = np.array(image, dtype=np.float32) # Numpy dizisine çevir
17
  image = image.astype('float32') / 255.0 # Normalize et
18
  return np.expand_dims(image, axis=0) # Batch boyutu ekle
19