ultralytics 8.0.191 fix yolo checks for missing packages (#5179)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Muhammad Rizwan Munawar <62513924+RizwanMunawar@users.noreply.github.com>
This commit is contained in:
parent
9aaa5d5ed0
commit
525c8b0294
17 changed files with 110 additions and 74 deletions
|
|
@ -148,11 +148,12 @@ sam_model_map = {
|
|||
def build_sam(ckpt='sam_b.pt'):
|
||||
"""Build a SAM model specified by ckpt."""
|
||||
model_builder = None
|
||||
ckpt = str(ckpt) # to allow Path ckpt types
|
||||
for k in sam_model_map.keys():
|
||||
if ckpt.endswith(k):
|
||||
model_builder = sam_model_map.get(k)
|
||||
|
||||
if not model_builder:
|
||||
raise FileNotFoundError(f'{ckpt} is not a supported sam model. Available models are: \n {sam_model_map.keys()}')
|
||||
raise FileNotFoundError(f'{ckpt} is not a supported SAM model. Available models are: \n {sam_model_map.keys()}')
|
||||
|
||||
return model_builder(ckpt)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue