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

Inference #10

Closed
sumantha-NTS opened this issue Nov 30, 2022 · 7 comments
Closed

Inference #10

sumantha-NTS opened this issue Nov 30, 2022 · 7 comments
Labels
enhancement New feature or request

Comments

@sumantha-NTS
Copy link

sumantha-NTS commented Nov 30, 2022

Hi,
I want to perform inference for human parsing using this model. What are the inputs required apart from the input image...?

I have already added the input image in JPEGImages directory. While inferencing I am getting assertion error at below line
File "/content/drive/MyDrive/POCs/InvPT/data/pascal_context.py", line 165, in init
assert os.path.isfile(_edge)
AssertionError

@prismformore prismformore added the enhancement New feature or request label Nov 30, 2022
@prismformore
Copy link
Owner

prismformore commented Nov 30, 2022

@sumantha-NTS Thank you for your interest in our work. This model is very strong so it should perform well for multi-task learning in the real world. So far this project doesn't contain code for inference in the wild but I will consider adding it if more people are interested in it in future.

It is also easy for you to write the inference code based on main.py and utils/test_utils.py. The file-saving code is here: https://github.com/prismformore/InvPT/blob/3b70fcc5a4f7053a7e32a9f85da5dda670c18fba/evaluation/evaluate_utils.py#L69

Thank you.

@sumantha-NTS
Copy link
Author

sumantha-NTS commented Dec 2, 2022

Hi,
I have created script to run inference for human parsing using this model which is attached below.
inference.py

input image:
00891_00

output image:
human_parts

As you can observe, i am getting black output...
Can you provide suggestion to resolve this..?

@prismformore
Copy link
Owner

@sumantha-NTS Hi, can you show your code?

@sumantha-NTS
Copy link
Author

@sumantha-NTS Hi, can you show your code?

Already attached code above i.e., inference.py

@prismformore
Copy link
Owner

prismformore commented Dec 2, 2022

@sumantha-NTS Please check this commit https://github.com/prismformore/InvPT/blob/main/inference.py.

I implement multi-task prediction inference code for any image input using the PASCAL-Context checkpoint. I borrow a few lines of code from yours. Please check whether this is helpful to you.

An example:
CUDA_VISIBLE_DEVICES=0 python inference.py --image_path=IMAGE_PATH --ckp_path=CKP_PATH --save_dir=SAVE_DIR

@prismformore
Copy link
Owner

Some generated results.

semseg
edge
normals
sal
human_parts

@sumantha-NTS
Copy link
Author

Thank you..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants