Robert001 commited on
Commit
f2b84c4
·
1 Parent(s): 11b57f1

first commit

Browse files
annotator/uniformer_base/__init__.py CHANGED
@@ -22,12 +22,12 @@ checkpoint_file = "https://huggingface.co/Salesforce/UniControl/blob/main/annota
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
 
 
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