Spaces:
Runtime error
Runtime error
Nik Ska
commited on
Commit
β’
f2c3938
1
Parent(s):
5e81fde
added new bgs
Browse files- app.py +5 -2
- examples/bg_0.jpg +0 -0
- examples/bg_1.jpg +0 -0
- examples/{bg1.jpg β bg_10.jpg} +0 -0
- examples/bg_11.jpg +0 -0
- examples/bg_12.jpg +0 -0
- examples/bg_13.jpg +0 -0
- examples/bg_14.jpg +0 -0
- examples/bg_15.jpg +0 -0
- examples/bg_16.jpg +0 -0
- examples/bg_17.jpg +0 -0
- examples/bg_2.jpg +0 -0
- examples/bg_3.jpg +0 -0
- examples/bg_4.jpg +0 -0
- examples/bg_5.jpg +0 -0
- examples/bg_6.jpg +0 -0
- examples/bg_7.jpg +0 -0
- examples/bg_8.jpg +0 -0
- examples/bg_9.jpg +0 -0
app.py
CHANGED
@@ -10,6 +10,7 @@ import base64
|
|
10 |
import numpy as np
|
11 |
import io
|
12 |
import os
|
|
|
13 |
|
14 |
|
15 |
def get_mask(img_in):
|
@@ -34,8 +35,10 @@ def get_mask(img_in):
|
|
34 |
result = response.json()
|
35 |
print('Result:', result)
|
36 |
|
37 |
-
|
38 |
-
|
|
|
|
|
39 |
|
40 |
bg_img = ImageOps.fit(
|
41 |
bg_img,
|
|
|
10 |
import numpy as np
|
11 |
import io
|
12 |
import os
|
13 |
+
from random import choice
|
14 |
|
15 |
|
16 |
def get_mask(img_in):
|
|
|
35 |
result = response.json()
|
36 |
print('Result:', result)
|
37 |
|
38 |
+
all_bgs = list(Path("examples").glob("*.jpg"))
|
39 |
+
|
40 |
+
bg_img = Image.open(choice(all_bgs)).convert(
|
41 |
+
"RGBA").resize(img_in.size)
|
42 |
|
43 |
bg_img = ImageOps.fit(
|
44 |
bg_img,
|
examples/bg_0.jpg
ADDED
![]() |
examples/bg_1.jpg
ADDED
![]() |
examples/{bg1.jpg β bg_10.jpg}
RENAMED
File without changes
|
examples/bg_11.jpg
ADDED
![]() |
examples/bg_12.jpg
ADDED
![]() |
examples/bg_13.jpg
ADDED
![]() |
examples/bg_14.jpg
ADDED
![]() |
examples/bg_15.jpg
ADDED
![]() |
examples/bg_16.jpg
ADDED
![]() |
examples/bg_17.jpg
ADDED
![]() |
examples/bg_2.jpg
ADDED
![]() |
examples/bg_3.jpg
ADDED
![]() |
examples/bg_4.jpg
ADDED
![]() |
examples/bg_5.jpg
ADDED
![]() |
examples/bg_6.jpg
ADDED
![]() |
examples/bg_7.jpg
ADDED
![]() |
examples/bg_8.jpg
ADDED
![]() |
examples/bg_9.jpg
ADDED
![]() |