Skip to content

Commit

Permalink
update models init
Browse files Browse the repository at this point in the history
  • Loading branch information
Christina Bukas committed Mar 7, 2024
1 parent 726a9af commit 03273ad
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/server/dcp_server/models/custom_cellpose.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self,

# Initialize the cellpose model
# super().__init__(**model_config["segmentor"])
#nn.Module.__init__(self)
Model.__init__(self, model_name, model_config, data_config, train_config, eval_config)
models.CellposeModel.__init__(self, **model_config["segmentor"])
self.model_config = model_config
self.data_config = data_config
Expand Down
3 changes: 2 additions & 1 deletion src/server/dcp_server/models/inst_to_multi_seg.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ def __init__(self,
:param eval_config: Evaluation configuration.
:type eval_config: dict
"""
super().__init__()
#super().__init__()
Model.__init__(self, model_name, model_config, data_config, train_config, eval_config)

self.model_name = model_name
self.model_config = model_config
Expand Down
4 changes: 2 additions & 2 deletions src/server/dcp_server/models/multicellpose.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ def __init__(self,
:param eval_config: Evaluation configuration.
:type eval_config: dict
"""

Model.__init__(self, model_name, model_config, data_config, train_config, eval_config)

self.model_config = model_config
self.data_config = data_config
self.train_config = train_config
Expand Down Expand Up @@ -71,7 +72,6 @@ def train(self,
mask_class[1]!=(i+1)
] = 0
masks_class.append(mask_class)
print(masks_class[0].shape)
self.cellpose_models[i].train(imgs, masks_class)

self.metric = np.mean([self.cellpose_models[i].metric for i in range(self.num_of_channels)])
Expand Down
5 changes: 3 additions & 2 deletions src/server/dcp_server/models/unet.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ def __init__(self,
:param eval_config: Evaluation configuration.
:type eval_config: dict
"""

super().__init__()
Model.__init__(self, model_name, model_config, data_config, train_config, eval_config)
nn.Module.__init__(self)
#super().__init__()

self.model_name = model_name
self.model_config = model_config
Expand Down

0 comments on commit 03273ad

Please sign in to comment.