facebookresearch / CutLER

Code release for "Cut and Learn for Unsupervised Object Detection and Instance Segmentation" and "VideoCutLER: Surprisingly Simple Unsupervised Video Instance Segmentation"
Other
913 stars 90 forks source link

Colab and huggingface Demo not working #58

Closed thomasf1 closed 6 months ago

thomasf1 commented 7 months ago

The two demo links provided don´t seem to work currently, the huggingface demo (https://huggingface.co/spaces/facebook/CutLER) doesn´t seem to output anything and the colab model throws the following error:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
[<ipython-input-1-25397159b476>](https://localhost:8080/#) in <cell line: 15>()
     13 
     14 from crf import densecrf
---> 15 from maskcut import maskcut
     16 import matplotlib.pyplot as plt
     17 

[/content/CutLER/maskcut/maskcut.py](https://localhost:8080/#) in <module>
     23 import dino
     24 # modfied by Xudong Wang based on third_party/TokenCut
---> 25 from third_party.TokenCut.unsupervised_saliency_detection import utils, metric
     26 from third_party.TokenCut.unsupervised_saliency_detection.object_discovery import detect_box
     27 # bilateral_solver codes are modfied based on https://github.com/poolio/bilateral_solver/blob/master/notebooks/bilateral_solver.ipynb

ModuleNotFoundError: No module named 'third_party.TokenCut'
frank-xwang commented 6 months ago

Hi, to resolve the importing issues, you can update your code by replacing lines 25-26 with the following code snippet.

sys.path.append("../third_party")
from TokenCut.unsupervised_saliency_detection import utils, metric
from TokenCut.unsupervised_saliency_detection.object_discovery import detect_box

Let me know if it does not work!