-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
f3caa45
commit 7405a96
Showing
4 changed files
with
19 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,4 @@ | ||
from functools import partial | ||
|
||
import timm | ||
|
||
from ...registry import BACKBONES | ||
from .gpunet import GPUNet | ||
|
||
timm_models = timm.list_models() | ||
for name in timm_models: | ||
create_func = partial(timm.create_model, model_name=name) | ||
BACKBONES.register_module(f'timm_{name}', module=create_func) | ||
|
||
from .timm import * | ||
|
||
__all__ = ['GPUNet'] |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import timm | ||
import torch.nn as nn | ||
|
||
from ...registry import BACKBONES | ||
|
||
|
||
class Timm: | ||
@staticmethod | ||
def build_model(*args, **kwargs) -> nn.Module: | ||
return timm.create_model(*args, **kwargs) | ||
|
||
|
||
timm_models = timm.list_models() | ||
for name in timm_models: | ||
BACKBONES.register_module(f'timm_{name}', module=Timm.build_model) |
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