vchoutas / smplify-x

Expressive Body Capture: 3D Hands, Face, and Body from a Single Image
https://smpl-x.is.tue.mpg.de/
Other
1.71k stars 335 forks source link

pyglet.gl.lib.MissingFunctionException: wglChoosePixelFormatARB is not exported by the available OpenGL driver. ARB_pixel_format is required for this functionality. #167

Open lucasjinreal opened 2 years ago

lucasjinreal commented 2 years ago
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\threading.py", line 973, in _bootstrap_inner
    self.run()
  File "C:\ProgramData\Anaconda3\lib\threading.py", line 910, in run
    self._target(*self._args, **self._kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pyrender\viewer.py", line 1016, in _init_and_start_app
    super(Viewer, self).__init__(config=conf, resizable=True,
  File "C:\ProgramData\Anaconda3\lib\site-packages\pyglet\window\win32\__init__.py", line 134, in __init__
    super(Win32Window, self).__init__(*args, **kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pyglet\window\__init__.py", line 612, in __init__
    config = screen.get_best_config(config)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pyglet\canvas\base.py", line 192, in get_best_config
    configs = self.get_matching_configs(template)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pyglet\canvas\win32.py", line 69, in get_matching_configs
    configs = template.match(canvas)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pyglet\gl\win32.py", line 57, in match
    return self._get_arb_pixel_format_matching_configs(canvas)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pyglet\gl\win32.py", line 128, in _get_arb_pixel_format_matching_configs
    wglext_arb.wglChoosePixelFormatARB(canvas.hdc, attrs, None, nformats, pformats, nformats)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pyglet\gl\lib_wgl.py", line 103, in __call__
    return self.func(*args, **kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pyglet\gl\lib.py", line 60, in MissingFunction
    raise MissingFunctionException(name, requires, suggestions)
pyglet.gl.lib.MissingFunctionException: wglChoosePixelFormatARB is not exported by the available OpenGL driver.  ARB_pixel_format is required for this functionality.
jufi2112 commented 2 years ago

Hi, were you able to fix this problem?

SchweitzerGAO commented 2 years ago

I also have this problem, so kind of you if you can provide a possible solution!

jufi2112 commented 2 years ago

Assuming that for you, the error also occurs if you want to visualize the created mesh on top of the original image (--visualize="True" option): I ended up copying some of the original visualization code and wrote my own routine that does this visualization after the fitting process is done, see https://github.com/jufi2112/smplify-x/blob/dc8d58c80430c629d00fd151f450f2d61fb4b132/vis_on_image.py

So I run SMPLify-X with visualization disabled, which, for me, prevents the error. If you are somehow dependent on having the visualization done during the fitting, I'm afraid I have no solution for you at this time. I will, however, come back here if I randomly stumble upon a solution.

As an interesting side note to this problem: If I only fit one image, I get no problems. The error only occurs after I try to fit multiple images. Therefore, I assume that something with the way the Viewer is handled is not correct. However, I use a system configuration different from the one the authors tested their code on, so this might have something to do with the problem.

SchweitzerGAO commented 2 years ago

Thanks @jufi2112 the problem was solved and it works well now!

y-71 commented 2 years ago

@SchweitzerGAO it still breaks for me

Is there any PR merged for this sake?

SchweitzerGAO commented 2 years ago

@y-71 Hi there, this has been long and I forgot about how I dealt with this concretely, sorry about that... Maybe I just disabled the visualization part and this worked.

y-71 commented 2 years ago

jufi2112 your code does not work for me!

(base) D:\work\gem\smpl\smplify-x>python vis_on_image.py -d ..\output_folder -i ..\data_folder\images -o .
Person Processing: 0it [00:00, ?it/s]                                                                                                                                                    | 0/2071 [00:00<?, ?it/s]
Image Processing:   0%|                                                                                                                                                                  | 0/2071 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "D:\work\gem\smpl\smplify-x\vis_on_image.py", line 266, in <module>
    main(args)
  File "D:\work\gem\smpl\smplify-x\vis_on_image.py", line 211, in main
    result['camera_center'],
KeyError: 'camera_center'
jufi2112 commented 2 years ago

You also need to add the following line: https://github.com/jufi2112/smplify-x/blob/8e594c1e521fbaed1a62e88ad945b36827130022/smplifyx/fit_single_frame.py#L469

This is because the camera center is not part of the original result dict

y-71 commented 2 years ago

@jufi2112 mmhhhhhmmmm, this means that I'll need to re-launch the inference again? :'(

Thank you for the fast feedback! I'll try this out!

jindong-jiang commented 2 years ago

I had this problem on Windows whenever the pyrender.Viewer was called a second time, my solution was setting run_in_thread=False in 54th line https://github.com/vchoutas/smplify-x/blob/master/smplifyx/mesh_viewer.py#:~:text=%3DFalse%2C-,run_in_thread%3DTrue%2C,-registered_keys%3Dregistered_keys