Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do you have a link to download the data set? Can you explain the training steps? #3

Open
fangliangs opened this issue Mar 18, 2020 · 2 comments

Comments

@fangliangs
Copy link

No description provided.

@zhaipro
Copy link
Owner

zhaipro commented Mar 20, 2020

图片是爬取来的,具体来源基本都忘了。mask是调用美图获取的。
https://drive.google.com/drive/folders/1SFZgEaw0x3Z8F7_-SgVz5zs2-iTaTMPa?usp=sharing

@fangliangs
Copy link
Author

ERR when checking input: expected input_1 to have 4 dimensions, but got array with shape (1, 1)

def data_generator(path, batch_size=2):
'''data generator for fit_generator'''
n = 3000
i = 0
idxs = np.arange(n)
while True:
x, y = [], []
for b in range(batch_size):
if i % n == 0:
np.random.shuffle(idxs)
fn = f'{path}/x/{idxs[i]}.jpg'
im = cv2.imread(fn)
x.append(im)
fn = f'{path}/y/{idxs[i]}.jpg'
im = cv2.imread(fn, 0)
y.append(im)
i = (i + 1) % n
x = np.array(x, dtype='float32') / 255
y = np.array(y, dtype='float32') / 255
y.shape = y.shape + (1,)
yield x, y

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants