sammyview80 commited on
Commit
7790ebf
·
verified ·
1 Parent(s): 2c011da
Files changed (1) hide show
  1. flask_app.py +3 -3
flask_app.py CHANGED
@@ -21,8 +21,8 @@ def allowed_file(filename):
21
  return '.' in filename and \
22
  filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS
23
 
24
- @app.route('/rm-bg/<transparent>', methods=['GET', 'POST'])
25
- def upload_file(transparent):
26
  transparent = True if transparent == "true" else False
27
  if request.method == 'POST':
28
  if 'file' not in request.files:
@@ -39,7 +39,7 @@ def upload_file(transparent):
39
  img_base64 = img_base64.decode('utf-8')
40
  print('yes')
41
  image_bytes = base64.b64decode(img_base64)
42
- rm_image_path = example_inference(image_bytes, transparent)
43
  return rm_image_path
44
  return {
45
  "message": "Get Request not allowed"
 
21
  return '.' in filename and \
22
  filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS
23
 
24
+ @app.route('/rm-bg/<transparent>/<color>', methods=['GET', 'POST'])
25
+ def upload_file(transparent, color):
26
  transparent = True if transparent == "true" else False
27
  if request.method == 'POST':
28
  if 'file' not in request.files:
 
39
  img_base64 = img_base64.decode('utf-8')
40
  print('yes')
41
  image_bytes = base64.b64decode(img_base64)
42
+ rm_image_path = example_inference(image_bytes, transparent, color)
43
  return rm_image_path
44
  return {
45
  "message": "Get Request not allowed"