MathiasGruber/PConv-Keras

There are white spots on the predicted picture corner

flyonok opened this issue · 4 comments

@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

I have tried many times and met the same problem.

Are you fix it?

I have tried many times and met the same problem.

Are you fix it?

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