-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
a58a126
commit 485e6ca
Showing
20 changed files
with
1,722 additions
and
1,126 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
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from dataclasses import dataclass, field | ||
from pathlib import Path | ||
from typing import Any, Dict, List, Optional, Union | ||
|
||
from omegaconf import MISSING | ||
|
||
|
||
@dataclass | ||
class ArchitectureConfig: | ||
full: Optional[Dict[str, Any]] = None | ||
backbone: Optional[Dict[str, Any]] = None | ||
neck: Optional[Dict[str, Any]] = None | ||
head: Optional[Dict[str, Any]] = None | ||
|
||
def __post_init__(self): | ||
assert bool(self.full) != bool(self.backbone), "Only one of full or backbone should be given." | ||
|
||
|
||
@dataclass | ||
class CheckpointConfig: | ||
use_pretrained: bool = True | ||
load_head: bool = False | ||
path: Optional[Union[Path, str]] = None | ||
fx_model_path: Optional[Union[Path, str]] = None | ||
optimizer_path: Optional[Union[Path, str]] = None | ||
|
||
|
||
@dataclass | ||
class ModelConfig: | ||
task: str = MISSING | ||
name: str = MISSING | ||
checkpoint: CheckpointConfig = field(default_factory=lambda: CheckpointConfig()) | ||
freeze_backbone: bool = False | ||
architecture: ArchitectureConfig = field(default_factory=lambda: ArchitectureConfig()) | ||
losses: Optional[List[Dict[str, Any]]] = None |
Oops, something went wrong.