Suweeraya commited on
Commit
9eafcc7
·
1 Parent(s): c67d1fb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -1,6 +1,8 @@
1
  import gradio as gr
2
  from PIL import Image
3
 
 
 
4
  def conv_block(input, num_filters):
5
  conv = Conv2D(num_filters, (3, 3), activation="relu", padding="same", kernel_initializer='he_normal')(input)
6
  conv = Conv2D(num_filters, (3, 3), activation="relu", padding="same", kernel_initializer='he_normal')(conv)
@@ -36,12 +38,9 @@ def build_model(input_shape):
36
  model = build_model(input_shape=(size, size, 1))
37
  model.compile(loss="binary_crossentropy", optimizer="Adam", metrics=["accuracy"])
38
  model.load_weights('BreastCancerSegmentation.h5')
39
- size = 128, size==size
40
  model = Model(input_layer, output_layer, name="U-Net")
41
  return model
42
 
43
-
44
-
45
  def preprocess_image(image, size=128):
46
  image = cv2.resize(image, (size, size))
47
  image = cv2.cvtColor(image, cv2.COLOR_RGB2GRAY)
 
1
  import gradio as gr
2
  from PIL import Image
3
 
4
+ size = 128, size==size
5
+
6
  def conv_block(input, num_filters):
7
  conv = Conv2D(num_filters, (3, 3), activation="relu", padding="same", kernel_initializer='he_normal')(input)
8
  conv = Conv2D(num_filters, (3, 3), activation="relu", padding="same", kernel_initializer='he_normal')(conv)
 
38
  model = build_model(input_shape=(size, size, 1))
39
  model.compile(loss="binary_crossentropy", optimizer="Adam", metrics=["accuracy"])
40
  model.load_weights('BreastCancerSegmentation.h5')
 
41
  model = Model(input_layer, output_layer, name="U-Net")
42
  return model
43
 
 
 
44
  def preprocess_image(image, size=128):
45
  image = cv2.resize(image, (size, size))
46
  image = cv2.cvtColor(image, cv2.COLOR_RGB2GRAY)