Spaces:
Runtime error
Runtime error
Commit
·
68ff489
1
Parent(s):
3f4ba22
Update app.py
Browse files
app.py
CHANGED
@@ -21,7 +21,8 @@ def inference():
|
|
21 |
w,h = image.shape[1],image.shape[0]
|
22 |
os.system("uname -a")
|
23 |
#output = remove(image) # remove background
|
24 |
-
|
|
|
25 |
#output = cv2.resize(output,(int(w*.79),int(h*.79)))
|
26 |
#cv2.imwrite(secure_filename(file.filename).split('.')[0]+'.png',output)
|
27 |
print(secure_filename(file.filename).split('.'))
|
|
|
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('.'))
|