summaryrefslogtreecommitdiff
path: root/models/model.py
diff options
context:
space:
mode:
authorJordan Gong <jordan.gong@protonmail.com>2021-02-18 18:34:06 +0800
committerJordan Gong <jordan.gong@protonmail.com>2021-02-18 18:34:06 +0800
commit84a3d5991f2f7272d1be54ad6cfe6ce695f915a0 (patch)
treef0ab13ef2118e773f10d77e9926012569e6611ec /models/model.py
parente6703e1fff20975bada71ce12644e0c8e58c1922 (diff)
Implement adjustable input size and change some default configs
Diffstat (limited to 'models/model.py')
-rw-r--r--models/model.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/models/model.py b/models/model.py
index 139fd59..3f5d283 100644
--- a/models/model.py
+++ b/models/model.py
@@ -55,6 +55,7 @@ class Model:
self.is_train: bool = True
self.in_channels: int = 3
+ self.in_size: tuple[int, int] = (64, 48)
self.pr: Optional[int] = None
self.k: Optional[int] = None
@@ -147,7 +148,7 @@ class Model:
hpm_optim_hp = optim_hp.pop('hpm', {})
fc_optim_hp = optim_hp.pop('fc', {})
sched_hp = self.hp.get('scheduler', {})
- self.rgb_pn = RGBPartNet(self.in_channels, **model_hp,
+ self.rgb_pn = RGBPartNet(self.in_channels, self.in_size, **model_hp,
image_log_on=self.image_log_on)
# Try to accelerate computation using CUDA or others
self.rgb_pn = self.rgb_pn.to(self.device)
@@ -299,7 +300,7 @@ class Model:
# Init models
model_hp = self.hp.get('model', {})
- self.rgb_pn = RGBPartNet(ae_in_channels=self.in_channels, **model_hp)
+ self.rgb_pn = RGBPartNet(self.in_channels, self.in_size, **model_hp)
# Try to accelerate computation using CUDA or others
self.rgb_pn = self.rgb_pn.to(self.device)
self.rgb_pn.eval()
@@ -459,6 +460,7 @@ class Model:
dataset_config: DatasetConfiguration
) -> Union[CASIAB]:
self.in_channels = dataset_config.get('num_input_channels', 3)
+ self.in_size = dataset_config.get('frame_size', (64, 48))
self._dataset_sig = self._make_signature(
dataset_config,
popped_keys=['root_dir', 'cache_on']