Proper List of Requirements

#5
by jaegermeister - opened

Could you update the list of requirements? I nonetheless get numpy errors upon running damv2 after installing the current list of requirements. What Python version, what numpy version, etc.

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.0 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last):  File "/home/username/depth-anything-v2/run_video.py", line 2, in <module>
    import cv2
  File "/home/username/anaconda3/envs/dam/lib/python3.11/site-packages/cv2/__init__.py", line 181, in <module>
    bootstrap()
  File "/home/username/anaconda3/envs/dam/lib/python3.11/site-packages/cv2/__init__.py", line 153, in bootstrap
    native_module = importlib.import_module("cv2")
  File "/home/username/anaconda3/envs/dam/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
AttributeError: _ARRAY_API not found
Traceback (most recent call last):
  File "/home/username/depth-anything-v2/run_video.py", line 2, in <module>
    import cv2
  File "/home/username/anaconda3/envs/dam/lib/python3.11/site-packages/cv2/__init__.py", line 181, in <module>
    bootstrap()
  File "/home/username/anaconda3/envs/dam/lib/python3.11/site-packages/cv2/__init__.py", line 153, in bootstrap
    native_module = importlib.import_module("cv2")
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/username/anaconda3/envs/dam/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: numpy.core.multiarray failed to import

I got it working by getting a conda environment with a Python 3.11.9 and installing the following requirements.txt:

aiofiles==23.2.1
altair==5.3.0
annotated-types==0.7.0
anyio==4.4.0
attrs==23.2.0
certifi==2024.6.2
charset-normalizer==3.3.2
click==8.1.7
contourpy==1.2.1
cycler==0.12.1
dnspython==2.6.1
email_validator==2.1.2
fastapi==0.111.0
fastapi-cli==0.0.4
ffmpy==0.3.2
filelock==3.15.1
fonttools==4.53.0
fsspec==2024.6.0
gradio==4.36.0
gradio_client==1.0.1
gradio_imageslider==0.0.20
h11==0.14.0
httpcore==1.0.5
httptools==0.6.1
httpx==0.27.0
huggingface-hub==0.23.4
idna==3.7
importlib_resources==6.4.0
Jinja2==3.1.4
jsonschema==4.22.0
jsonschema-specifications==2023.12.1
kiwisolver==1.4.5
markdown-it-py==3.0.0
MarkupSafe==2.1.5
matplotlib==3.9.0
mdurl==0.1.2
mpmath==1.3.0
networkx==3.3
numpy==1.23.5
nvidia-cublas-cu12==12.1.3.1
nvidia-cuda-cupti-cu12==12.1.105
nvidia-cuda-nvrtc-cu12==12.1.105
nvidia-cuda-runtime-cu12==12.1.105
nvidia-cudnn-cu12==8.9.2.26
nvidia-cufft-cu12==11.0.2.54
nvidia-curand-cu12==10.3.2.106
nvidia-cusolver-cu12==11.4.5.107
nvidia-cusparse-cu12==12.1.0.106
nvidia-nccl-cu12==2.20.5
nvidia-nvjitlink-cu12==12.5.40
nvidia-nvtx-cu12==12.1.105
opencv-python==4.10.0.82
orjson==3.10.5
packaging==24.1
pandas==2.2.2
pillow==10.3.0
pydantic==2.7.4
pydantic_core==2.18.4
pydub==0.25.1
Pygments==2.18.0
pyparsing==3.1.2
python-dateutil==2.9.0.post0
python-dotenv==1.0.1
python-multipart==0.0.9
pytz==2024.1
PyYAML==6.0.1
referencing==0.35.1
requests==2.32.3
rich==13.7.1
rpds-py==0.18.1
ruff==0.4.9
semantic-version==2.10.0
shellingham==1.5.4
six==1.16.0
sniffio==1.3.1
starlette==0.37.2
sympy==1.12.1
tomlkit==0.12.0
toolz==0.12.1
torch==2.3.1
torchvision==0.18.1
tqdm==4.66.4
triton==2.3.1
typer==0.12.3
typing_extensions==4.12.2
tzdata==2024.1
ujson==5.10.0
urllib3==2.2.1
uvicorn==0.30.1
uvloop==0.19.0
watchfiles==0.22.0
websockets==11.0.3

Thanks for this thread. I was able to get it to work locally on Windows 10 python 3.10 after copying this repo locally with the basic requirements and not having to downgrade numpy

gradio_imageslider
gradio==4.36.0
torch
torchvision
opencv-python
matplotlib
huggingface_hub
fastapi==0.111.0
starlette==0.37.2
pydantic==2.7.4
spaces

Sign up or log in to comment