Spaces:
Running
Running
Commit
·
136c1d6
1
Parent(s):
070cde2
Update utils.py
Browse files
utils.py
CHANGED
|
@@ -34,12 +34,12 @@ base_model = tf.keras.applications.ResNet50V2(include_top=False, input_shape=inp
|
|
| 34 |
#Making the layers of the model trainable
|
| 35 |
base_model.trainable = True
|
| 36 |
|
| 37 |
-
def preprocess(
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
return
|
| 43 |
|
| 44 |
def model_arc():
|
| 45 |
model = tf.keras.Sequential([
|
|
|
|
| 34 |
#Making the layers of the model trainable
|
| 35 |
base_model.trainable = True
|
| 36 |
|
| 37 |
+
def preprocess(image):
|
| 38 |
+
image = np.array(image.resize((300, 300), Image.ANTIALIAS))
|
| 39 |
+
image = np.array(image, dtype='uint8')
|
| 40 |
+
image = np.array(image)/255.0
|
| 41 |
+
|
| 42 |
+
return image
|
| 43 |
|
| 44 |
def model_arc():
|
| 45 |
model = tf.keras.Sequential([
|