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

There are white spots on the predicted picture corner #32

Open
flyonok opened this issue May 5, 2019 · 4 comments
Open

There are white spots on the predicted picture corner #32

flyonok opened this issue May 5, 2019 · 4 comments

Comments

@flyonok
Copy link

flyonok commented May 5, 2019

@MathiasGruber
when I wrote following code:
`
import os
from copy import deepcopy
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
import cv2

if os.path.basename(os.getcwd()) != 'PConv-Keras-new':
os.chdir('..')

from libs.pconv_model import PConvUnet
from libs.util import MaskGenerator, ImageChunker
from libs.pconv_model import PConvUnet
model = PConvUnet(vgg_weights=None, inference_only=True)
model.load(r"D:\artAI\model\weights.26-1.07.h5", train_bn=False)
sample_image_file = os.path.dirname(os.path.realpath(file)) + '\xxt\my_bike_xxt03.jpg'
mask_image_file = os.path.dirname(os.path.realpath(file)) + '\xxt\xxt03.jpg'
img = cv2.imread(sample_image_file)
mask = cv2.imread(mask_image_file)
img = np.array(img)/255
mask = np.array(mask)/255
np.random.seed(16)
chunker = ImageChunker(512, 512, 30)
chunked_images = chunker.dimension_preprocess(deepcopy(img))
chunked_masks = chunker.dimension_preprocess(deepcopy(mask))
pred_imgs = model.predict([chunked_images, chunked_masks])
reconstructed_image = chunker.dimension_postprocess(pred_imgs, img)
reconstructed_image = np.array(reconstructed_image)*255
file_name = 'result{}.jpg'.format(np.random.randint(1,100))
cv2.imwrite(file_name, reconstructed_image)
`
my_bike_xxt03.jpg:
my_bike_xxt03
xxt03.jpg:
xxt03
but the result is:
result42
but when i try https://www.fixmyphoto.ai/, it's correct.Why?
thanks lot

@lhao0301
Copy link

I have tried many times and met the same problem.

@FighterFong
Copy link

Are you fix it?

@FighterFong
Copy link

I have tried many times and met the same problem.

Are you fix it?

@nywang2019
Copy link

my result images also have a white area at the upper left corner,and a black rect block at the upper right corner. why??? anyone can tell me? @MathiasGruber

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

4 participants