-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
43 lines (36 loc) · 1.22 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import os
from os.path import join, exists
from os import mkdir
from data_pre_proc import dataPreProcessor
from PIL import Image
import numpy as np
def main():
# target_path = 'J:\\Celebs_dataset\\small_celeba_cracked\\label\\000001.png'
# img = Image.open(target_path)
#
# kernelarr = np.array([[1,1,1,1,1],
# [1,0,0,0,1],
# [1,0,0,0,1],
# [1,0,0,0,1],
# [1,1,1,1,1]]) * 255
#
# kernel = Image.fromarray(kernelarr).convert("L")
#
# img.paste(kernel, (70, 70), mask=kernel)
#
# img.show()
DATA_SET_FOLDER = 'J:\Celebs_dataset\small_celeba'
OUT_DATA_FOLDER = 'J:\Celebs_dataset\small_celeba_cracked'
if not exists(OUT_DATA_FOLDER):
mkdir(OUT_DATA_FOLDER)
out_data_path = join(OUT_DATA_FOLDER, 'data')
out_label_path = join(OUT_DATA_FOLDER, 'label')
if not exists(out_data_path):
mkdir(out_data_path)
if not exists(out_label_path):
mkdir(out_label_path)
preproc = dataPreProcessor(DATA_SET_FOLDER,
out_path_data=out_data_path,
out_path_true=out_label_path)
preproc.pre_process()
main()