Update app.py
Browse files
app.py
CHANGED
@@ -24,18 +24,19 @@ main.py
|
|
24 |
"""
|
25 |
|
26 |
|
27 |
-
def mainTest(
|
28 |
-
watermark = deep_nude_process(
|
29 |
-
watermark1 = cv2.cvtColor(watermark, cv2.COLOR_RGBA2BGRA)
|
30 |
-
cv2.imwrite(outpath, watermark1)
|
31 |
return watermark
|
32 |
#
|
33 |
|
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 |
h = dress.shape[0]
|
40 |
w = dress.shape[1]
|
41 |
dress = cv2.resize(dress, (512, 512), interpolation=cv2.INTER_CUBIC)
|
@@ -47,13 +48,13 @@ def deep_nude_process(item):
|
|
47 |
def inference(img):
|
48 |
global index
|
49 |
bgra = cv2.cvtColor(img, cv2.COLOR_RGBA2BGRA)
|
50 |
-
inputpath = "input_" + str(index) + ".jpg"
|
51 |
-
cv2.imwrite(inputpath, bgra)
|
52 |
|
53 |
outputpath = "out_" + str(index) + ".jpg"
|
54 |
index += 1
|
55 |
print(time.strftime("εΌε§!!!!!!!!! %Y-%m-%d %H:%M:%S", time.localtime()))
|
56 |
-
output = mainTest(
|
57 |
print(time.strftime("η»ζ!!!!!!!!! %Y-%m-%d %H:%M:%S", time.localtime()))
|
58 |
return output
|
59 |
|
|
|
24 |
"""
|
25 |
|
26 |
|
27 |
+
def mainTest(bgra, outpath):
|
28 |
+
watermark = deep_nude_process(bgra)
|
29 |
+
#watermark1 = cv2.cvtColor(watermark, cv2.COLOR_RGBA2BGRA)
|
30 |
+
#cv2.imwrite(outpath, watermark1)
|
31 |
return watermark
|
32 |
#
|
33 |
|
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(bgra, outputpath)
|
58 |
print(time.strftime("η»ζ!!!!!!!!! %Y-%m-%d %H:%M:%S", time.localtime()))
|
59 |
return output
|
60 |
|