Robert001 commited on
Commit
a929430
1 Parent(s): f2b84c4

first commit

Browse files
annotator/uniformer_base/__init__.py CHANGED
@@ -18,16 +18,16 @@ from annotator.uniformer_base.mmseg.core.evaluation import get_palette
18
  from annotator.util import annotator_ckpts_path
19
 
20
  import pdb
21
- checkpoint_file = "https://huggingface.co/Salesforce/UniControl/blob/main/annotator/ckpts/upernet_global_base.pth"
22
-
23
  class UniformerDetector:
24
  def __init__(self):
25
- modelpath = os.path.join(annotator_ckpts_path, "upernet_global_base.pth")
26
- if not os.path.exists(modelpath):
27
- from basicsr.utils.download_util import load_file_from_url
28
- load_file_from_url(checkpoint_file, model_dir=annotator_ckpts_path)
29
- raise ValueError("wrong ckpt path")
30
- #modelpath = checkpoint_file
31
  config_file = os.path.join(os.path.dirname(annotator_ckpts_path), "uniformer_base", "exp", "upernet_global_base", "config.py")
32
  self.model = init_segmentor(config_file, modelpath).cuda()
33
 
 
18
  from annotator.util import annotator_ckpts_path
19
 
20
  import pdb
21
+ #checkpoint_file = "https://huggingface.co/Salesforce/UniControl/blob/main/annotator/ckpts/upernet_global_base.pth"
22
+ checkpoint_file = "https://storage.googleapis.com/sfr-unicontrol-data-research/annotator/ckpts/upernet_global_base.pth"
23
  class UniformerDetector:
24
  def __init__(self):
25
+ #modelpath = os.path.join(annotator_ckpts_path, "upernet_global_base.pth")
26
+ #if not os.path.exists(modelpath):
27
+ # from basicsr.utils.download_util import load_file_from_url
28
+ # load_file_from_url(checkpoint_file, model_dir=annotator_ckpts_path)
29
+ # raise ValueError("wrong ckpt path")
30
+ modelpath = checkpoint_file
31
  config_file = os.path.join(os.path.dirname(annotator_ckpts_path), "uniformer_base", "exp", "upernet_global_base", "config.py")
32
  self.model = init_segmentor(config_file, modelpath).cuda()
33