Spaces:
Running on Zero
Running on Zero
Download common/fix_chumpy.py from LinzhouLi/RealDenseFace: direct link, hf CLI and curl.
- Browser
- Download file 675 Bytes
-
https://huggingface.co/spaces/LinzhouLi/RealDenseFace/resolve/main/common/fix_chumpy.py
- Command line
-
hf download hf://spaces/LinzhouLi/RealDenseFace/common/fix_chumpy.py
-
curl -L -o fix_chumpy.py https://huggingface.co/spaces/LinzhouLi/RealDenseFace/resolve/main/common/fix_chumpy.py
675 Bytes
| """Compatibility shims required before importing chumpy/FLAME.""" | |
| import inspect | |
| from collections import namedtuple | |
| import numpy as np | |
| for _name, _value in { | |
| "bool": bool, | |
| "int": int, | |
| "float": float, | |
| "complex": complex, | |
| "object": object, | |
| "unicode": str, | |
| "str": str, | |
| }.items(): | |
| if _name not in np.__dict__: | |
| setattr(np, _name, _value) | |
| if not hasattr(inspect, "getargspec"): | |
| _ArgSpec = namedtuple("ArgSpec", "args varargs keywords defaults") | |
| def _getargspec(func): | |
| spec = inspect.getfullargspec(func) | |
| return _ArgSpec(spec.args, spec.varargs, spec.varkw, spec.defaults) | |
| inspect.getargspec = _getargspec | |