Spaces:
Running
Running
up
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ def indexApi():
|
|
16 |
|
17 |
@app.route("/remove", methods = ['POST'])
|
18 |
def removeApi():
|
19 |
-
|
20 |
key = request.form.get("key")
|
21 |
model = request.form.get("model")
|
22 |
|
@@ -35,8 +35,9 @@ def removeApi():
|
|
35 |
|
36 |
# response = requests.get(image_url)
|
37 |
|
38 |
-
|
39 |
-
|
|
|
40 |
|
41 |
result = remove(image, session=new_session(model))
|
42 |
|
|
|
16 |
|
17 |
@app.route("/remove", methods = ['POST'])
|
18 |
def removeApi():
|
19 |
+
image_url = request.form.get("image_url")
|
20 |
key = request.form.get("key")
|
21 |
model = request.form.get("model")
|
22 |
|
|
|
35 |
|
36 |
# response = requests.get(image_url)
|
37 |
|
38 |
+
encoded_data = image_url.split(',')[1]
|
39 |
+
arr = np.fromstring(base64.b64decode(encoded_data), np.uint8)
|
40 |
+
image = cv2.imdecode(arr, cv2.IMREAD_COLOR)
|
41 |
|
42 |
result = remove(image, session=new_session(model))
|
43 |
|