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