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

SEGMENTATION with label masks: Value Error: cannot reshape array of size 1228800 into shape (409600,) #94

Open
lQingRu opened this issue Oct 5, 2019 · 1 comment

Comments

@lQingRu
Copy link

lQingRu commented Oct 5, 2019

Used .jpg for label maps, style image, and content image.
(demo_multipy.py is just a copied version of demo.py, just edited to suit multiple images)

Did changes mentioned in #55 (i.e. remove mode='RGB'), and also #56 (changing for t_cont_seg and t_styl_seg doesn't help since issue is on o_cont_mask) but issue persisted:

Elapsed time in stylization: 0.032001 Traceback (most recent call last): File "demo_multiple.py", line 116, in <module> no_post=args.no_post File "/home/user/repository/image_enhancement/FastPhotoStyle/process_stylization.py", line 140, in stylization File "/home/user/repository/image_enhancement/FastPhotoStyle/photo_wct.py", line 21, in transform self.__compute_label_info(cont_seg, styl_seg) File "/home/user/repository/image_enhancement/FastPhotoStyle/photo_wct.py", line 104, in __compute_label_info o_cont_mask = np.where(cont_seg.reshape(cont_seg.shape[0] * cont_seg.shape[1]) == l) ValueError: cannot reshape array of size 1228800 into shape (409600,)

Also tried changing the mode for segmentation image as mentioned in #56, but another issue arise:

Traceback (most recent call last): File "demo_multiple.py", line 116, in <module> no_post=args.no_post File "/home/user/repository/image_enhancement/FastPhotoStyle/process_stylization.py", line 107, in stylization File "/home/user/miniconda3/envs/fastphotostyle3/lib/python3.6/site-packages/PIL/Image.py", line 2661, in fromarray raise ValueError("Too many dimensions: %d > %d." % (ndim, ndmax)) ValueError: Too many dimensions: 3 > 2.

@lQingRu lQingRu changed the title SEGMENTATION with label masks: Value Error: cannot reshape array of size 19200 into shape (6400,) SEGMENTATION with label masks: Value Error: cannot reshape array of size 1228800 into shape (409600,) Oct 5, 2019
@smitheric95
Copy link

@lQingRu

Were you ever able to resolve this issue?

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