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

alignment.py doesnt work #30

Closed
jujemu opened this issue Aug 29, 2022 · 5 comments
Closed

alignment.py doesnt work #30

jujemu opened this issue Aug 29, 2022 · 5 comments

Comments

@jujemu
Copy link

jujemu commented Aug 29, 2022

run:
!python alignment.py --image-folder /content/input --output-folder /content/output. ,

but I got

Traceback (most recent call last):
  File "alignment.py", line 221, in <module>
    run(cmd_args)
  File "alignment.py", line 144, in run
    comb, segmentation, bg, ori_img = human_seg.run(image,None)  #mybg) 
  File "/content/StyleGAN-Human/PP_HumanSeg/deploy/infer.py", line 100, in run
    processed_imgs, ori_shapes = self.preprocess(img)
  File "/content/StyleGAN-Human/PP_HumanSeg/deploy/infer.py", line 92, in preprocess
    processed_img = self.compose(img)[0]
  File "/usr/local/lib/python3.7/dist-packages/paddleseg/transforms/transforms.py", line 56, in __call__
    if 'img' not in data.keys():
AttributeError: 'numpy.ndarray' object has no attribute 'keys'

My environment

  • colab pro.
  • input folder: /content/input; only one image, of which size is (512, 1024), PIL image.
  • To solve module error, !pip install paddleseg paddlepaddle

and I believe, the problem is here, self.compose = T.Compose(self.cfg.transforms).
self.cfg.transforms wants to get dictionary having a key, 'img'.
but I cant get though it.

Plz help.

@xjdeng
Copy link

xjdeng commented Sep 2, 2022

Same here, I'm having this issue as well. Are we supposed to try older versions of paddleseg? I might do that and report back if it solves it.

@Lakshmanaraja
Copy link

same error coming. 3 months back when the alignment code was released , It was working perfectly fine. Is there any version mismatch?

File "alignment.py", line 221, in
run(cmd_args)
File "alignment.py", line 144, in run
comb, segmentation, bg, ori_img = human_seg.run(image,None) #mybg)
File "/content/StyleGAN-Human/PP_HumanSeg/deploy/infer.py", line 100, in run
processed_imgs, ori_shapes = self.preprocess(img)
File "/content/StyleGAN-Human/PP_HumanSeg/deploy/infer.py", line 92, in preprocess
processed_img = self.compose(img)[0]
File "/usr/local/lib/python3.7/dist-packages/paddleseg/transforms/transforms.py", line 56, in call
if 'img' not in data.keys():
AttributeError: 'numpy.ndarray' object has no attribute 'keys'

@xjdeng
Copy link

xjdeng commented Sep 14, 2022

I got it to work by downgrading paddleseg to version 2.5

@jujemu
Copy link
Author

jujemu commented Sep 14, 2022

I didnt check that it works, @xjdeng I believe, then it can close.

@jujemu jujemu closed this as completed Sep 14, 2022
@MisunJoo
Copy link

after I downgraded, I did PaddlePaddle/PaddleDetection#7629 (comment)
then it works

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