net_initialize->initialize_net

own
Bobholamovic 2 years ago
parent c9457a0d99
commit 0334a262c5
  1. 2
      paddlers/tasks/base.py
  2. 10
      paddlers/tasks/change_detector.py
  3. 2
      paddlers/tasks/classifier.py
  4. 2
      paddlers/tasks/object_detector.py
  5. 2
      paddlers/tasks/restorer.py
  6. 14
      paddlers/tasks/segmenter.py

@ -86,7 +86,7 @@ class BaseModel(metaclass=ModelMeta):
self.quant_config = None
self.fixed_input_shape = None
def net_initialize(self,
def initialize_net(self,
pretrain_weights=None,
save_dir='.',
resume_checkpoint=None,

@ -316,7 +316,7 @@ class BaseChangeDetector(BaseModel):
exit=True)
pretrained_dir = osp.join(save_dir, 'pretrain')
is_backbone_weights = pretrain_weights == 'IMAGENET'
self.net_initialize(
self.initialize_net(
pretrain_weights=pretrain_weights,
save_dir=pretrained_dir,
resume_checkpoint=resume_checkpoint,
@ -607,13 +607,13 @@ class BaseChangeDetector(BaseModel):
invalid_value (int, optional): Value that marks invalid pixels in output
image. Defaults to 255.
merge_strategy (str, optional): Strategy to merge overlapping blocks. Choices
are {'keep_first', 'keep_last', 'vote'}. 'keep_first' and 'keep_last'
are {'keep_first', 'keep_last', 'accum'}. 'keep_first' and 'keep_last'
means keeping the values of the first and the last block in traversal
order, respectively. 'vote' means applying a simple voting strategy when
there are conflicts in the overlapping pixels. Defaults to 'keep_last'.
order, respectively. 'accum' means determining the class of an overlapping
pixel according to accumulated probabilities. Defaults to 'keep_last'.
"""
slider_predict(self, img_files, save_dir, block_size, overlap,
slider_predict(self.predict, img_files, save_dir, block_size, overlap,
transforms, invalid_value, merge_strategy)
def preprocess(self, images, transforms, to_tensor=True):

@ -288,7 +288,7 @@ class BaseClassifier(BaseModel):
exit=True)
pretrained_dir = osp.join(save_dir, 'pretrain')
is_backbone_weights = False
self.net_initialize(
self.initialize_net(
pretrain_weights=pretrain_weights,
save_dir=pretrained_dir,
resume_checkpoint=resume_checkpoint,

@ -347,7 +347,7 @@ class BaseDetector(BaseModel):
"Invalid pretrained weights. Please specify a .pdparams file.",
exit=True)
pretrained_dir = osp.join(save_dir, 'pretrain')
self.net_initialize(
self.initialize_net(
pretrain_weights=pretrain_weights,
save_dir=pretrained_dir,
resume_checkpoint=resume_checkpoint,

@ -283,7 +283,7 @@ class BaseRestorer(BaseModel):
exit=True)
pretrained_dir = osp.join(save_dir, 'pretrain')
is_backbone_weights = pretrain_weights == 'IMAGENET'
self.net_initialize(
self.initialize_net(
pretrain_weights=pretrain_weights,
save_dir=pretrained_dir,
resume_checkpoint=resume_checkpoint,

@ -308,7 +308,7 @@ class BaseSegmenter(BaseModel):
exit=True)
pretrained_dir = osp.join(save_dir, 'pretrain')
is_backbone_weights = pretrain_weights == 'IMAGENET'
self.net_initialize(
self.initialize_net(
pretrain_weights=pretrain_weights,
save_dir=pretrained_dir,
resume_checkpoint=resume_checkpoint,
@ -579,15 +579,13 @@ class BaseSegmenter(BaseModel):
invalid_value (int, optional): Value that marks invalid pixels in output
image. Defaults to 255.
merge_strategy (str, optional): Strategy to merge overlapping blocks. Choices
are {'keep_first', 'keep_last', 'vote', 'accum'}. 'keep_first' and
'keep_last' means keeping the values of the first and the last block in
traversal order, respectively. 'vote' means applying a simple voting
strategy when there are conflicts in the overlapping pixels. 'accum'
means determining the class of an overlapping pixel according to
accumulated probabilities. Defaults to 'keep_last'.
are {'keep_first', 'keep_last', 'accum'}. 'keep_first' and 'keep_last'
means keeping the values of the first and the last block in traversal
order, respectively. 'accum' means determining the class of an overlapping
pixel according to accumulated probabilities. Defaults to 'keep_last'.
"""
slider_predict(self, img_file, save_dir, block_size, overlap,
slider_predict(self.predict, img_file, save_dir, block_size, overlap,
transforms, invalid_value, merge_strategy)
def preprocess(self, images, transforms, to_tensor=True):

Loading…
Cancel
Save