Spaces:
Runtime error
Runtime error
muhammadzain
commited on
Commit
·
ea096d3
1
Parent(s):
b5c7c53
Update app.py
Browse files
app.py
CHANGED
@@ -20,11 +20,11 @@ def inference():
|
|
20 |
image = cv2.imread(secure_filename(file_name))
|
21 |
w,h = image.shape[1],image.shape[0]
|
22 |
image = cv2.resize(image,(int(w*.79),int(h*.79)))
|
23 |
-
cv2.imwrite(secure_filename(file.filename),image)
|
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")
|
|
|
20 |
image = cv2.imread(secure_filename(file_name))
|
21 |
w,h = image.shape[1],image.shape[0]
|
22 |
image = cv2.resize(image,(int(w*.79),int(h*.79)))
|
23 |
+
cv2.imwrite(secure_filename(file.filename).split('.')[0]+'.jpg',image)
|
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).split('.')[0]+'.jpg') + ' -m "u2net_human_seg" -o {name}'.format(name= outputName))
|
28 |
|
29 |
print(secure_filename(file.filename).split('.'))
|
30 |
os.system("ls -l")
|