muhammadzain commited on
Commit
02d8f0f
·
1 Parent(s): 68ff489

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -19,12 +19,13 @@ def inference():
19
  file_name = file.filename
20
  image = cv2.imread(secure_filename(file_name))
21
  w,h = image.shape[1],image.shape[0]
 
 
22
  os.system("uname -a")
23
  #output = remove(image) # remove background
24
  outputName = secure_filename(file.filename).split('.')[0]+'.png'
25
  os.system('backgroundremover -i'+'{name}'.format(name= secure_filename(file.filename)) + ' -m "u2net_human_seg" -o {name}'.format(name= outputName))
26
- #output = cv2.resize(output,(int(w*.79),int(h*.79)))
27
- #cv2.imwrite(secure_filename(file.filename).split('.')[0]+'.png',output)
28
  print(secure_filename(file.filename).split('.'))
29
  os.system("ls -l")
30
  return send_file(secure_filename(file.filename).split('.')[0]+'.png',mimetype='image/png')
 
19
  file_name = file.filename
20
  image = cv2.imread(secure_filename(file_name))
21
  w,h = image.shape[1],image.shape[0]
22
+ output = cv2.resize(output,(int(w*.79),int(h*.79)))
23
+ cv2.imwrite(secure_filename(file.filename),output)
24
  os.system("uname -a")
25
  #output = remove(image) # remove background
26
  outputName = secure_filename(file.filename).split('.')[0]+'.png'
27
  os.system('backgroundremover -i'+'{name}'.format(name= secure_filename(file.filename)) + ' -m "u2net_human_seg" -o {name}'.format(name= outputName))
28
+
 
29
  print(secure_filename(file.filename).split('.'))
30
  os.system("ls -l")
31
  return send_file(secure_filename(file.filename).split('.')[0]+'.png',mimetype='image/png')