You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@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:
xxt03.jpg:
but the result is:
but when i try https://www.fixmyphoto.ai/, it's correct.Why?
thanks lot
The text was updated successfully, but these errors were encountered:
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
@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:
xxt03.jpg:
but the result is:
but when i try https://www.fixmyphoto.ai/, it's correct.Why?
thanks lot
The text was updated successfully, but these errors were encountered: