hkchengrex / XMem

[ECCV 2022] XMem: Long-Term Video Object Segmentation with an Atkinson-Shiffrin Memory Model
https://hkchengrex.com/XMem/
MIT License
1.72k stars 191 forks source link

resource_manager = ResourceManager(config) File "/hdd/code/segmentation/XMem/inference/interact/resource_manager.py", line 55, in __init__ raise NotImplementedError( NotImplementedError: Either images, video, or workspace has to be specified #99

Closed monajalal closed 1 year ago

monajalal commented 1 year ago

I followed the instructions in DEMO.md and getting started and got this error.

(xmem) mona@ard-gpu-01:/hdd/code/segmentation/XMem$ ./scripts/download_models_demo.sh 
--2023-06-29 20:41:49--  https://github.com/hkchengrex/XMem/releases/download/v1.0/XMem.pth
Resolving github.com (github.com)... 140.82.113.4
Connecting to github.com (github.com)|140.82.113.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/511262077/ea2968ee-04ab-4dee-8596-03319e8c7e9f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230630%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230630T004150Z&X-Amz-Expires=300&X-Amz-Signature=be8514bb9efe8d57b96eeff09bd5a3e14b15a56855d2291cbab05db4bda2fd8d&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=511262077&response-content-disposition=attachment%3B%20filename%3DXMem.pth&response-content-type=application%2Foctet-stream [following]
--2023-06-29 20:41:50--  https://objects.githubusercontent.com/github-production-release-asset-2e65be/511262077/ea2968ee-04ab-4dee-8596-03319e8c7e9f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230630%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230630T004150Z&X-Amz-Expires=300&X-Amz-Signature=be8514bb9efe8d57b96eeff09bd5a3e14b15a56855d2291cbab05db4bda2fd8d&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=511262077&response-content-disposition=attachment%3B%20filename%3DXMem.pth&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.110.133, 185.199.108.133, 185.199.111.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.110.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 249026057 (237M) [application/octet-stream]
Saving to: ‘./saves/XMem.pth’

XMem.pth                                             100%[=====================================================================================================================>] 237.49M  32.6MB/s    in 7.7s    

2023-06-29 20:41:58 (31.0 MB/s) - ‘./saves/XMem.pth’ saved [249026057/249026057]

--2023-06-29 20:41:58--  https://github.com/hkchengrex/XMem/releases/download/v1.0/fbrs.pth
Resolving github.com (github.com)... 140.82.113.4
Connecting to github.com (github.com)|140.82.113.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/511262077/114143d1-b773-4dbc-93ac-a4eb9544bb88?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230630%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230630T004200Z&X-Amz-Expires=300&X-Amz-Signature=5836e2300a50f1786d5cd0a9ec95945685894a242b9439f0bd85c1a296d893cd&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=511262077&response-content-disposition=attachment%3B%20filename%3Dfbrs.pth&response-content-type=application%2Foctet-stream [following]
--2023-06-29 20:42:00--  https://objects.githubusercontent.com/github-production-release-asset-2e65be/511262077/114143d1-b773-4dbc-93ac-a4eb9544bb88?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230630%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230630T004200Z&X-Amz-Expires=300&X-Amz-Signature=5836e2300a50f1786d5cd0a9ec95945685894a242b9439f0bd85c1a296d893cd&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=511262077&response-content-disposition=attachment%3B%20filename%3Dfbrs.pth&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.111.133, 185.199.108.133, 185.199.110.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.111.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 125871674 (120M) [application/octet-stream]
Saving to: ‘./saves/fbrs.pth’

fbrs.pth                                             100%[=====================================================================================================================>] 120.04M  14.7MB/s    in 13s     

2023-06-29 20:42:13 (9.15 MB/s) - ‘./saves/fbrs.pth’ saved [125871674/125871674]

--2023-06-29 20:42:13--  https://github.com/hkchengrex/XMem/releases/download/v1.0/s2m.pth
Resolving github.com (github.com)... 140.82.112.4
Connecting to github.com (github.com)|140.82.112.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/511262077/139db341-0c9a-4ef5-91dc-abc874b60972?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230630%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230630T004215Z&X-Amz-Expires=300&X-Amz-Signature=24819afaf5dbd100d721ab8aacd1cabe8087d15c12646aa0db3deca923966c87&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=511262077&response-content-disposition=attachment%3B%20filename%3Ds2m.pth&response-content-type=application%2Foctet-stream [following]
--2023-06-29 20:42:15--  https://objects.githubusercontent.com/github-production-release-asset-2e65be/511262077/139db341-0c9a-4ef5-91dc-abc874b60972?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230630%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230630T004215Z&X-Amz-Expires=300&X-Amz-Signature=24819afaf5dbd100d721ab8aacd1cabe8087d15c12646aa0db3deca923966c87&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=511262077&response-content-disposition=attachment%3B%20filename%3Ds2m.pth&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.110.133, 185.199.108.133, 185.199.111.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.110.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 159426143 (152M) [application/octet-stream]
Saving to: ‘./saves/s2m.pth’

s2m.pth                                              100%[=====================================================================================================================>] 152.04M  18.8MB/s    in 14s     

2023-06-29 20:42:29 (10.5 MB/s) - ‘./saves/s2m.pth’ saved [159426143/159426143]

(xmem) mona@ard-gpu-01:/hdd/code/segmentation/XMem$ python  in
inference/           interactive_demo.py  
(xmem) mona@ard-gpu-01:/hdd/code/segmentation/XMem$ python  interactive_demo.py 
/home/mona/anaconda3/envs/xmem/lib/python3.10/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /hdd/code/segmentation/XMem/inference/interact/fbrs/utils/cython/_get_dist_maps.pyx
  tree = Parsing.p_module(s, pxd, full_module_name)
In file included from /home/mona/anaconda3/envs/xmem/lib/python3.10/site-packages/numpy/core/include/numpy/ndarraytypes.h:1929,
                 from /home/mona/anaconda3/envs/xmem/lib/python3.10/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                 from /home/mona/anaconda3/envs/xmem/lib/python3.10/site-packages/numpy/core/include/numpy/arrayobject.h:5,
                 from /home/mona/.pyxbld/temp.linux-x86_64-cpython-310/pyrex/inference/interact/fbrs/utils/cython/_get_dist_maps.cpp:764:
/home/mona/anaconda3/envs/xmem/lib/python3.10/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
   17 | #warning "Using deprecated NumPy API, disable it with " \
      |  ^~~~~~~
Hyperparameters read from the model weights: C^k=64, C^v=512, C^h=64
Single object mode: False
Downloading: "https://download.pytorch.org/models/resnet50-19c8e357.pth" to /home/mona/.cache/torch/hub/checkpoints/resnet50-19c8e357.pth
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 97.8M/97.8M [00:03<00:00, 31.7MB/s]
Downloading: "https://download.pytorch.org/models/resnet18-5c106cde.pth" to /home/mona/.cache/torch/hub/checkpoints/resnet18-5c106cde.pth
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 44.7M/44.7M [00:01<00:00, 32.8MB/s]
Traceback (most recent call last):
  File "/hdd/code/segmentation/XMem/interactive_demo.py", line 91, in <module>
    resource_manager = ResourceManager(config)
  File "/hdd/code/segmentation/XMem/inference/interact/resource_manager.py", line 55, in __init__
    raise NotImplementedError(
NotImplementedError: Either images, video, or workspace has to be specified
(xmem) mona@ard-gpu-01:/hdd/code/segmentation/XMem$ python 
Python 3.10.11 (main, May 16 2023, 00:28:57) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
hkchengrex commented 1 year ago

This states that you need to provide the path to the input video, as suggested by the error message.