Zhibinhong commited on
Commit
8b3181e
1 Parent(s): 809e94e

Update visual_chatgpt.py

Browse files
Files changed (1) hide show
  1. visual_chatgpt.py +8 -6
visual_chatgpt.py CHANGED
@@ -807,14 +807,16 @@ class Segmenting:
807
  def download_parameters(self):
808
  ##############
809
  print("getcwd",os.getcwd())
810
- print("ls-R",os.system("ls -R"))
811
- print("find",os.system("find ./ -name 'handler.py'"))
812
- print("finddir",os.system("find ./ -type d -iname 'checkpoints'"))
 
 
813
  url = "https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth"
814
- if not os.path.exists("/repository/checkpoints"):
815
- os.makedirs("/repository/checkpoints")
816
  # wget.download(url,out=self.model_checkpoint_path)
817
- wget.download(url,out="/repository/checkpoints/sam")
818
 
819
  def show_mask(self, mask, ax, random_color=False):
820
  if random_color:
 
807
  def download_parameters(self):
808
  ##############
809
  print("getcwd",os.getcwd())
810
+ REPO_DIR = os.path.dirname(__file__)
811
+ path=os.path.join(REPO_DIR, "checkpoints/sam")
812
+ # print("ls-R",os.system("ls -R"))
813
+ # print("find",os.system("find ./ -name 'handler.py'"))
814
+ print("finddir",os.system("find /repository -type d -iname 'checkpoints'"))
815
  url = "https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth"
816
+ if not os.path.exists(path):
817
+ os.makedirs(path)
818
  # wget.download(url,out=self.model_checkpoint_path)
819
+ wget.download(url,out=path)
820
 
821
  def show_mask(self, mask, ax, random_color=False):
822
  if random_color: