Spaces:
Running
Running
Commit
·
9777758
1
Parent(s):
846939c
Update utils.py
Browse files
utils.py
CHANGED
@@ -34,10 +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 |
def model_arc():
|
43 |
model = tf.keras.Sequential([
|
|
|
34 |
#Making the layers of the model trainable
|
35 |
base_model.trainable = True
|
36 |
|
37 |
+
def preprocess(img_path):
|
38 |
+
img = Image.open(img_path)
|
39 |
+
img = img.resize((256, 256))
|
40 |
+
img_array = np.array(img)
|
41 |
+
img_array = np.expand_dims(img_array, axis=0)
|
42 |
+
return img_array
|
43 |
|
44 |
def model_arc():
|
45 |
model = tf.keras.Sequential([
|