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

Error with imports when using the notebook demo for maskcut #54

Closed Copper76 closed 9 months ago

Copper76 commented 10 months ago

When I was trying out the demo for maskcut in jupyter notebook using the link in readme. I cannot seem to import the metric module from third_party.TokenCut.unsupervised_saliency_detection. The system path doesn't seem to work. I have tried work arounds but there is still an import in maskcut which I don't wish to disturb. Otherwise I haven't been able to find an elegant solution. Can you help me with it?

frank-xwang commented 9 months ago

Hey, duplicate of another issue. Please check #50.

Copper76 commented 9 months ago

Hi, I have checked it. However, the issue persists even after me checking that third party has been successfully cloned and exists. I am using the recursive command for the clone, which was the case in the demo

frank-xwang commented 9 months ago

Hi, can you add sys.path.insert(0, "../third_party") at the beginning of each file that imports third-party libraries? Additionally, change all instances of import third_party.ABC to simply import ABC. This should help resolve the issue. It appears to be related to using the latest Python version.

Let me know if this can fix your issue.

Copper76 commented 9 months ago

That does indeed solve the problem, thanks for the help.