本文整理汇总了Python中mrcnn.model.MaskRCNN方法的典型用法代码示例。如果您正苦于以下问题:Python model.MaskRCNN方法的具体用法?Python model.MaskRCNN怎么用?Python model.MaskRCNN使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mrcnn.model
的用法示例。
在下文中一共展示了model.MaskRCNN方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: load_network
# 需要导入模块: from mrcnn import model [as 别名]
# 或者: from mrcnn.model import MaskRCNN [as 别名]
def load_network(self):
config = Config()
config.NAME = 'predict'
config.NUM_CLASSES = 1 + 1
config.IMAGES_PER_GPU = 1
config.GPU_COUNT = 1
additional_info = json.load(open(self.config_path))
for i,j in additional_info.items():
try:
setattr(config,i,eval(j))
except:
setattr(config,i,j)
config.__init__()
from mrcnn import model as modellib
self.model = modellib.MaskRCNN(mode="inference", model_dir='./',config=config)
示例2: __init__
# 需要导入模块: from mrcnn import model [as 别名]
# 或者: from mrcnn.model import MaskRCNN [as 别名]
def __init__(self):
self.inference_config = ModelConfig()
self.model = modellib.MaskRCNN(mode="inference",
config=self.inference_config,
model_dir=MODEL_DIR)
self.model_path = self.model.find_last()[1]
self.model.load_weights(self.model_path, by_name=True)
# https://github.com/keras-team/keras/issues/2397
dummy_input = Image.new('RGB', (IMAGE_SIZE, IMAGE_SIZE))
self.detect(dummy_input)
示例3: load_network
# 需要导入模块: from mrcnn import model [as 别名]
# 或者: from mrcnn.model import MaskRCNN [as 别名]
def load_network(self):
from keras.applications.xception import Xception
from mrcnn import model as modellib
self.model = modellib.MaskRCNN(mode="inference", model_dir='./',config=config)
keras.applications.xception.Xception(include_top=True, weights='imagenet', input_tensor=None, input_shape=None, pooling=None, classes=1000)
示例4: get_network
# 需要导入模块: from mrcnn import model [as 别名]
# 或者: from mrcnn.model import MaskRCNN [as 别名]
def get_network():
print('hi')
from mrcnn import model as modellib
model = modellib.MaskRCNN(mode="inference", model_dir='./',config=config)
# model.load_weights(bundle_dir+os.sep+'assets'+os.sep+'elegans.h5', by_name=True)
return model