CVHub520 / X-AnyLabeling

Effortless data labeling with AI support from Segment Anything and other awesome models.
GNU General Public License v3.0
3.82k stars 442 forks source link

The error in SAM2 video Tracking #650

Open GoldenFishes opened 6 days ago

GoldenFishes commented 6 days ago

Search before asking

X-AnyLabeling Component

No response

Bug

WARNING:root:Could not inference model WARNING:root:cannot import name '_C' from 'sam2' (/home/xiaoiron/workspace/x-anylabeling-sam2/segment-anything-2/sam2/__init__.py) Traceback (most recent call last): File "/home/xiaoiron/workspace/x-anylabeling-sam2/X-AnyLabeling/./anylabeling/services/auto_labeling/segment_anything_2_video.py", line 409, in predict_shapes shapes, replace = self.video_process(cv_image, filename) File "/home/xiaoiron/workspace/x-anylabeling-sam2/X-AnyLabeling/./anylabeling/services/auto_labeling/segment_anything_2_video.py", line 365, in video_process ) = self.video_predictor.add_new_prompt( File "/home/xiaoiron/workspace/x-anylabeling-sam2/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context return func(*args, **kwargs) File "/home/xiaoiron/workspace/x-anylabeling-sam2/segment-anything-2/sam2/sam2_camera_predictor.py", line 285, in add_new_prompt current_out, _ = self._run_single_frame_inference( File "/home/xiaoiron/workspace/x-anylabeling-sam2/segment-anything-2/sam2/sam2_camera_predictor.py", line 1012, in _run_single_frame_inference pred_masks_gpu = fill_holes_in_mask_scores( File "/home/xiaoiron/workspace/x-anylabeling-sam2/segment-anything-2/sam2/utils/misc.py", line 223, in fill_holes_in_mask_scores labels, areas = get_connected_components(mask <= 0) File "/home/xiaoiron/workspace/x-anylabeling-sam2/segment-anything-2/sam2/utils/misc.py", line 61, in get_connected_components from sam2 import _C ImportError: cannot import name '_C' from 'sam2' (/home/xiaoiron/workspace/x-anylabeling-sam2/segment-anything-2/sam2/__init__.py)

Information

`Package Version Editable project location


antlr4-python3-runtime 4.9.3 attrs 24.2.0 certifi 2024.8.30 charset-normalizer 3.3.2 coloredlogs 15.0.1 contourpy 1.3.0 cycler 0.12.1 Cython 3.0.11 filelock 3.16.1 filterpy 1.4.5 flatbuffers 24.3.25 fonttools 4.53.1 fsspec 2024.9.0 huggingface-hub 0.25.0 humanfriendly 10.0 hydra-core 1.3.2 idna 3.10 imgviz 1.5.0 importlib_metadata 8.5.0 iopath 0.1.10 Jinja2 3.1.4 jsonlines 4.0.0 kiwisolver 1.4.7 lapx 0.5.5 MarkupSafe 2.1.5 matplotlib 3.9.2 mpmath 1.3.0 natsort 8.1.0 networkx 3.3 numpy 1.26.4 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 9.1.0.70 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.6.68 nvidia-nvtx-cu12 12.1.105 omegaconf 2.3.0 onnx 1.16.2 onnxruntime 1.19.2 opencv-contrib-python-headless 4.10.0.84 packaging 24.1 pillow 10.4.0 pip 24.0 portalocker 2.10.1 protobuf 5.28.2 pyclipper 1.3.0.post5 pyparsing 3.1.4 PyQt5 5.15.7 PyQt5-Qt5 5.15.15 PyQt5_sip 12.15.0 python-dateutil 2.9.0.post0 PyYAML 6.0.2 qimage2ndarray 1.10.0 requests 2.32.3 SAM-2 1.0 /home/xiaoiron/workspace/x-anylabeling-sam2/segment-anything-2 scipy 1.14.1 setuptools 69.5.1 shapely 2.0.6 six 1.16.0 sympy 1.13.2 termcolor 1.1.0 tokenizers 0.20.0 torch 2.4.1 torchvision 0.19.1 tqdm 4.66.5 triton 3.0.0 typing_extensions 4.12.2 urllib3 2.2.3 wheel 0.43.0 zipp 3.20.2 `

Link to a Reproducible Demonstration Video

Screen-Recording-2024-09-26T07_09_31.433Z.zip

Execution Mode

Source Code

Additional

No response

Are you willing to submit a PR?

CVHub520 commented 6 days ago

Please consult the following link for detailed information: https://github.com/CVHub520/segment-anything-2/blob/camera/INSTALL.md. Should you require assistance, the provided guide will steers you through the installation process.