- import os
- import sys
- import random
- import math
- import numpy as np
- import skimage.io
- import matplotlib
- import matplotlib.pyplot as plt
- # import coco
- from mrcnn import utils
- from mrcnn import model as modellib
- from mrcnn import visualize
- from mrcnn.config import Config
- #%matplotlib inline
- # Root directory of the project
- ROOT_DIR = os.getcwd()
- # Directory to save logs and trained model
- MODEL_DIR = os.path.join(ROOT_DIR, "logs")
- # Local path to trained weights file
- COCO_MODEL_PATH = "mask_rcnn_shapes_0001.h5"
- # Directory of images to run detection on
- IMAGE_DIR = os.path.join(ROOT_DIR, "images")
- class ShapesConfig(Config):
- """Configuration for training on the toy shapes dataset.
- Derives from the base Config class and overrides values specific
- to the toy shapes dataset.
- """
- # Give the configuration a recognizable name
- NAME = "shapes"
来源: http://www.bubuko.com/infodetail-2733174.html