VIBE复现过程,使用nvidia和libOpenGL.so渲染出错及解决方案

VIBE复现过程,使用nvidia和libOpenGL.so渲染出错及解决方案

VIBE全称是"Video Inference for Human Body Pose and Shape Estimation",是2020年CVPR(computer vision and pattern recognition)中关于人体姿态骨架的一篇论文。
论文地址:https://arxiv.org/abs/1912.05656
github源码地址:https://github.com/mkocabas/VIBE

问题描述

根据作者给出的源码,在复现过程中出现以下问题:

return self._finalCall( *args, **named ) 
TypeError: 'NoneType' object is not callable 

During handling of the above exception, another exception occurred: 
TypeError: startswith first arg must be bytes or a tuple of bytes, not str

在这里插入图片描述

解决方案

上述问题并不是VIBE本身的代码逻辑有问题,而是与nvidia驱动程序、OpenGL文件有关系。
这里给出了解决方案,也就是修改OpenGL/platform文件夹下的egl.py文件,将第36行的’GL’注释掉,换成’OpenGL’。
在这里插入图片描述

修改之后的egl.py完整文件如下:

import ctypes, ctypes.util
from OpenGL.platform import baseplatform, ctypesloader

class EGLPlatform( baseplatform.BasePlatform ):
    """EGL platform for opengl-es only platforms"""
    @baseplatform.lazy_property
    def GLES1(self):
        try:
            return ctypesloader.loadLibrary(
                ctypes.cdll,
                'GLESv1_CM', # ick
                mode=ctypes.RTLD_GLOBAL 
            )
        except OSError as err:
            return None
    @baseplatform.lazy_property
    def GLES2(self):
        try:
            return ctypesloader.loadLibrary(
                ctypes.cdll,
                'GLESv2', 
                mode=ctypes.RTLD_GLOBAL 
            )
        except OSError as err:
            return None
    @baseplatform.lazy_property
    def GLES3(self):
        # implementers guide says to use the same name for the DLL
        return self.GLES2
    @baseplatform.lazy_property
    def GL(self):
        try:
            return ctypesloader.loadLibrary(
                ctypes.cdll,
                #'GL', 
                'OpenGL',
                mode=ctypes.RTLD_GLOBAL 
            )
        except OSError as err:
            return self.GLES2 or self.GLES1
    @baseplatform.lazy_property
    def GLU(self):
        try:
            return ctypesloader.loadLibrary(
                ctypes.cdll,
                'GLU',
                mode=ctypes.RTLD_GLOBAL 
            )
        except OSError as err:
            return None
    @baseplatform.lazy_property
    def GLUT( self ):
        try:
            return ctypesloader.loadLibrary(
                ctypes.cdll,
                'glut', 
                mode=ctypes.RTLD_GLOBAL 
            )
        except OSError as err:
            return None
    @baseplatform.lazy_property
    def OpenGL(self): return self.GL
    
    @baseplatform.lazy_property
    def EGL(self):
        try:
            return ctypesloader.loadLibrary(
                ctypes.cdll,
                'EGL', 
                mode=ctypes.RTLD_GLOBAL 
            )
        except OSError as err:
            raise ImportError("Unable to load EGL library", *err.args)
    @baseplatform.lazy_property
    def getExtensionProcedure( self ):
        eglGetProcAddress = self.EGL.eglGetProcAddress
        eglGetProcAddress.restype = ctypes.c_void_p
        return eglGetProcAddress
    @baseplatform.lazy_property
    def GLE( self ):
        try:
            return ctypesloader.loadLibrary(
                ctypes.cdll,
                'gle', 
                mode=ctypes.RTLD_GLOBAL 
            )
        except OSError as err:
            return None

    DEFAULT_FUNCTION_TYPE = staticmethod( ctypes.CFUNCTYPE )
    @baseplatform.lazy_property
    def GetCurrentContext( self ):
        return self.EGL.eglGetCurrentContext
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值