SysCV / sam-pt

SAM-PT: Extending SAM to zero-shot video segmentation with point-based tracking.
https://arxiv.org/abs/2307.01197
Apache License 2.0
950 stars 60 forks source link

Model creation outside repo directory #22

Open georgeYanch opened 10 months ago

georgeYanch commented 10 months ago

Hi, I need to create model outside sam-pt directory

For now I get the following error error locating target sam_pt.modelling.sam_pt.SamPt

How do I change _target_ in config in order this to work?

m43 commented 9 months ago

Hi @georgeYanch, a dirty workaround would be to add the root directory of SAM-PT to your PYTHONPATH. For example, this can be done by executing export PYTHONPATH="${PYTHONPATH}:/path/to/sam-pt" in your terminal. Replace /path/to/sam-pt with the actual path to your sam-pt root (not to the sam_pt subfolder, but the root of the cloned repo). This should allow Python to locate the sam_pt.modelling.sam_pt.SamPt module when running your script from outside the SAM-PT directory.

A clean solution would be to, for example, make sam-pt a package that can be installed via pip...