Suweeraya commited on
Commit
dd55966
·
1 Parent(s): fed0169

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -1,16 +1,13 @@
1
  import gradio as gr
2
  from PIL import Image
3
- import tensorflow as tf
4
- from keras.models import Model
5
- from keras.layers import Input, Conv2D, MaxPooling2D, Conv2DTranspose, concatenate
6
- from keras.optimizers import Adam
7
 
8
  def build_model(input_shape):
9
- size=128
10
  model = build_model(input_shape=(size, size, 1))
11
- model.load_weights('BreastCancerSegmentation.h5')
12
  return model
13
-
14
  def preprocess_image(image, size: int=128):
15
  image = cv2.resize(image, (size,size))
16
  image = cv2.cvtColor(image, cv2.COLOR_RGB2GRAY)
 
1
  import gradio as gr
2
  from PIL import Image
3
+
4
+ size=128
5
+ model.load_weights('BreastCancerSegmentation.h5')
 
6
 
7
  def build_model(input_shape):
 
8
  model = build_model(input_shape=(size, size, 1))
 
9
  return model
10
+
11
  def preprocess_image(image, size: int=128):
12
  image = cv2.resize(image, (size,size))
13
  image = cv2.cvtColor(image, cv2.COLOR_RGB2GRAY)