Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -34,9 +34,9 @@ def mainTest(bgra, outpath):
|
|
| 34 |
|
| 35 |
def deep_nude_process(item):
|
| 36 |
# print('Processing {}'.format(item))
|
| 37 |
-
|
| 38 |
#dress = cv2.cvtColor(dress, cv2.COLOR_BGRA2RGBA)
|
| 39 |
-
dress = item
|
| 40 |
h = dress.shape[0]
|
| 41 |
w = dress.shape[1]
|
| 42 |
dress = cv2.resize(dress, (512, 512), interpolation=cv2.INTER_CUBIC)
|
|
@@ -48,13 +48,13 @@ def deep_nude_process(item):
|
|
| 48 |
def inference(img):
|
| 49 |
global index
|
| 50 |
bgra = cv2.cvtColor(img, cv2.COLOR_RGBA2BGRA)
|
| 51 |
-
|
| 52 |
-
|
| 53 |
|
| 54 |
outputpath = "out_" + str(index) + ".jpg"
|
| 55 |
index += 1
|
| 56 |
print(time.strftime("开始!!!!!!!!! %Y-%m-%d %H:%M:%S", time.localtime()))
|
| 57 |
-
output = mainTest(
|
| 58 |
print(time.strftime("结束!!!!!!!!! %Y-%m-%d %H:%M:%S", time.localtime()))
|
| 59 |
return output
|
| 60 |
|
|
|
|
| 34 |
|
| 35 |
def deep_nude_process(item):
|
| 36 |
# print('Processing {}'.format(item))
|
| 37 |
+
dress = cv2.imread(item)
|
| 38 |
#dress = cv2.cvtColor(dress, cv2.COLOR_BGRA2RGBA)
|
| 39 |
+
#dress = item
|
| 40 |
h = dress.shape[0]
|
| 41 |
w = dress.shape[1]
|
| 42 |
dress = cv2.resize(dress, (512, 512), interpolation=cv2.INTER_CUBIC)
|
|
|
|
| 48 |
def inference(img):
|
| 49 |
global index
|
| 50 |
bgra = cv2.cvtColor(img, cv2.COLOR_RGBA2BGRA)
|
| 51 |
+
inputpath = "input_" + str(index) + ".jpg"
|
| 52 |
+
cv2.imwrite(inputpath, bgra)
|
| 53 |
|
| 54 |
outputpath = "out_" + str(index) + ".jpg"
|
| 55 |
index += 1
|
| 56 |
print(time.strftime("开始!!!!!!!!! %Y-%m-%d %H:%M:%S", time.localtime()))
|
| 57 |
+
output = mainTest(inputpath, outputpath)
|
| 58 |
print(time.strftime("结束!!!!!!!!! %Y-%m-%d %H:%M:%S", time.localtime()))
|
| 59 |
return output
|
| 60 |
|