minghanqin / LangSplat

Official implementation of the paper "LangSplat: 3D Language Gaussian Splatting" [CVPR2024 Highlight]
https://langsplat.github.io/
Other
675 stars 72 forks source link

Preprocess Error #39

Closed Neal2020GitHub closed 6 months ago

Neal2020GitHub commented 7 months ago

Hi, I encountered such error when I ran preprocess.py. Any idea how to solve it? Thank you!

(langsplat) ➜  LangSplat git:(main) ✗ python preprocess.py --dataset_path ./data/snacks 
[ INFO ] Encountered quite large input images (>1080P), rescaling to 1080P.
 If this is not desired, please explicitly specify '--resolution/-r' as 1
Traceback (most recent call last):  
  File "preprocess.py", line 126, in create
    img_embed, seg_map = _embed_clip_sam_tiles(img.unsqueeze(0), sam_encoder)
  File "preprocess.py", line 178, in _embed_clip_sam_tiles
    seg_images, seg_map = sam_encoder(aug_imgs)
  File "preprocess.py", line 299, in sam_encoder
    masks_default, masks_s, masks_m, masks_l = mask_generator.generate(image)
ValueError: too many values to unpack (expected 4)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "preprocess.py", line 404, in <module>
    create(imgs, data_list, save_folder)
  File "preprocess.py", line 128, in create
    raise ValueError(timer)
ValueError: 1
Neal2020GitHub commented 7 months ago
image

In line 299, it seems that mask_generator.generate(image) returns a list of masks.

maybeLx commented 7 months ago

I also have the same problem

maybeLx commented 7 months ago

I have solved the problem, this is due to the reason that you have installed segment-anything before in your environment, you need to uninstall the segment-anything, and follow the README to install the segment-anything-langsplat author has provided. Then you can successfully run the code