Ahsen Khaliq commited on
Commit
00a9bd1
1 Parent(s): be469ef

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -11,10 +11,9 @@ os.mkdir("data")
11
  os.mkdir("dataout")
12
  model = hub.Module(name='U2Net')
13
  def infer(img,mask,option):
14
- basewidth = 600
15
- wpercent = (basewidth/float(img.size[0]))
16
- hsize = int((float(img.size[1])*float(wpercent)))
17
- img = img.resize((basewidth,hsize), Image.ANTIALIAS)
18
  img.save("./data/data.png")
19
  if option == "automatic (U2net)":
20
  result = model.Segmentation(
 
11
  os.mkdir("dataout")
12
  model = hub.Module(name='U2Net')
13
  def infer(img,mask,option):
14
+ img = img.resize((600,600)) # image resizing
15
+
16
+ mask = mask.resize((600,600))
 
17
  img.save("./data/data.png")
18
  if option == "automatic (U2net)":
19
  result = model.Segmentation(