SHI-Labs / VMFormer

[Preprint] VMFormer: End-to-End Video Matting with Transformer

Home Page:https://chrisjuniorli.github.io/project/VMFormer/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

inference_vm.py ERROR

infoengine1337 opened this issue · comments

Hello. Thank you for your great works.

I want to use this python code in Google Colab, but I received an error.

inference_vm.py:252: DeprecationWarning: `np.int` is a deprecated alias for the builtin `int`. To silence this warning, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  size = np.int(2 * half_size + 1)
/usr/local/lib/python3.7/dist-packages/numpy/core/fromnumeric.py:3441: RuntimeWarning: Mean of empty slice.
  out=out, **kwargs)
/usr/local/lib/python3.7/dist-packages/numpy/core/_methods.py:189: RuntimeWarning: invalid value encountered in double_scalars
  ret = ret.dtype.type(ret / rcount)
pha_mad:nan

pha_mse:nan

pha_grad:nan

pha_conn:nan

pha_dtssd:nan

Here is my jupyter cell.

!git clone https://github.com/SHI-Labs/VMFormer
!pip install  torch==1.9.0 torchvision==0.10.0

%cd VMFormer
!pip install -r requirements.txt

%cd ./models/ops
!bash ./make.sh
!python test.py

%cd ../../

!gdown https://drive.google.com/u/0/uc?id=1q2Rm-Rp42bQA4zIbCqPzJ9GG6P7SQGmq

!CUDA_VISIBLE_DEVICES=0 python inference_vm.py --model_path vmformer_mv3.pth --masks --num_frames 20 --img_path image_list_directory --query_temporal weight_sum --fpn_temporal

How I can do?

キャプチャ
Thank you.

I use a series of png converted from a mp4 video.
https://75.gigafile.nu/0127-c107d8e83676b17e8d88393e1118f73a7

キャプチャ

Here is my ipynb sample.
vmform_test.ipynb.txt

Thanks for posting this issue. We haven't tested on colab yet, it is in our to-do-list and we'll release a colab demo soon. Stay tuned, thanks!