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

Python example #291

Closed
salvador-blanco opened this issue Jul 9, 2020 · 6 comments
Closed

Python example #291

salvador-blanco opened this issue Jul 9, 2020 · 6 comments
Assignees

Comments

@salvador-blanco
Copy link

Is there an example on how to make a prediction on an image using python?
If possible with all the associated data?

Heatmaps
Prediction bodyparts (x,y)
Image with a skeleton ?

@ganler
Copy link
Contributor

ganler commented Jul 9, 2020

Hi @salvador-blanco , you can do prediction using both python(only for training usage, therefore may not be efficient) and c++(highly optimized, but we have not implemented a python wrapper yet).

@Gyx-One Could you add an example of debugging/visualizing algorithms along with prediction API?

@Gyx-One
Copy link
Contributor

Gyx-One commented Jul 9, 2020

@salvador-blanco
Thank you for pointing out this issue!
currently we exposes preprocess, postprocess and visualize API seperately to help user assemble thier own pipeline.
using them, it is easy to infer on one image to debugging, I'll add an example python code soon.

@Gyx-One
Copy link
Contributor

Gyx-One commented Jul 14, 2020

@salvador-blanco
Hello! I have already add a python example about inferring using python customize APIs, It's on the infer.py.
Thanks for using our library

@electroendjneer
Copy link

electroendjneer commented Jul 23, 2020

Hello! I'm trying to run the hao28-pose345000.npz and the hao28-pose600000.npz models in infer.py, but I stumbled upon the following error:

KeyError: 'params is not a file in the archive'

If I replace line 15 in infer.py
model.load_weights(weight_path)

with:

model.load_weights(weight_path, format='npz_dict',skip = False)

but I have many warning like this:

[TL] WARNING: Weights named 'conv4_3_W' not found in network. Skip it.

How can I load a model in TF correctly?

@Gyx-One
Copy link
Contributor

Gyx-One commented Jul 24, 2020

Hello! I'm trying to run the hao28-pose345000.npz and the hao28-pose600000.npz models in infer.py, but I stumbled upon the following error:

KeyError: 'params is not a file in the archive'

If I replace line 15 in infer.py
model.load_weights(weight_path)

with:

model.load_weights(weight_path, format='npz_dict',skip = False)

but I have many warning like this:

[TL] WARNING: Weights named 'conv4_3_W' not found in network. Skip it.

How can I load a model in TF correctly?

Hello! The reason of the warning "[TL] WARNING: Weights named 'conv4_3_W' not found in network. Skip it." is that the two models hao28-pose345000.npz and hao28-pose600000.npz are trained by the first version of hyperpose which is compatible with tf 1.0, but now we update hyperpose to version 2.0 now where the network architectures are different from the old version, so load the these two npz models will lead to the mismatch in layers.(just as the warning said).

Thus to load a model, you should use the same model type (set by function set_model_type) and model backbone (set bu function set_model_backbone) as the training configuration that produces the .npz model file (in current hyperpose 2.0 API), then load the .npz file as the infer.py.

@carlosh93
Copy link

carlosh93 commented Aug 8, 2020

Hello. @Gyx-One I am having the same problem. Will you please provide the npz files for the new Hyperpose 2.0 implementation? I only need the pre-trained weights. Thanks in advance and thank you for this amazing project!

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

5 participants