-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
63 additions
and
404 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
import importlib.metadata | ||
|
||
__version__ = importlib.metadata.version("osam") | ||
|
||
from . import _models # noqa: F401 | ||
from . import apis # noqa: F401 | ||
from . import types # noqa: F401 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,2 @@ | ||
from typing import Type | ||
|
||
from ._base import ModelBase # noqa: F401 | ||
from ._efficient_sam import EfficientSam10m | ||
from ._efficient_sam import EfficientSam25m | ||
from ._sam import Sam91m | ||
from ._sam import Sam308m | ||
from ._sam import Sam636m | ||
|
||
# TODO: Provide a better way to register models. | ||
# Currently, we have to manually add the model to the MODELS list. | ||
MODELS = [ | ||
EfficientSam10m, | ||
EfficientSam25m, | ||
Sam91m, | ||
Sam308m, | ||
Sam636m, | ||
] | ||
|
||
|
||
def get_model_class_by_name(name: str) -> Type[ModelBase]: | ||
model_name: str | ||
if ":" in name: | ||
model_name = name | ||
else: | ||
model_name = f"{name}:latest" | ||
|
||
for cls in MODELS: | ||
if cls.name == model_name: | ||
break | ||
else: | ||
raise ValueError(f"Model {name!r} not found.") | ||
return cls | ||
from osam._models import _efficient_sam # noqa: F401 | ||
from osam._models import _sam # noqa: F401 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.