Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -43,11 +43,11 @@ def build_model(input_shape):
|
|
43 |
d4 = decoder_block(d3, s1, 64)
|
44 |
|
45 |
output_layer = Conv2D(1, 1, padding="same", activation="sigmoid")(d4)
|
46 |
-
model = build_model(input_shape=(size, size, 1))
|
47 |
model.compile(loss="binary_crossentropy", optimizer="Adam", metrics=["accuracy"])
|
48 |
-
model.load_weights('BreastCancerSegmentation.h5')
|
49 |
-
model = Model(input_layer, output_layer, name="U-Net")
|
50 |
return model
|
|
|
|
|
|
|
51 |
|
52 |
def preprocess_image(image, size=128):
|
53 |
image = cv2.resize(image, (size, size))
|
|
|
43 |
d4 = decoder_block(d3, s1, 64)
|
44 |
|
45 |
output_layer = Conv2D(1, 1, padding="same", activation="sigmoid")(d4)
|
|
|
46 |
model.compile(loss="binary_crossentropy", optimizer="Adam", metrics=["accuracy"])
|
|
|
|
|
47 |
return model
|
48 |
+
|
49 |
+
model.load_weights('path/to/BreastCancerSegmentation.h5')
|
50 |
+
model = build_model(input_shape=(size, size, 1))
|
51 |
|
52 |
def preprocess_image(image, size=128):
|
53 |
image = cv2.resize(image, (size, size))
|