资源简介
Mask R-CNN源码,需要python3、tensorflow>=1.3 、Keras>=2.08、 h5py、 scipy、scikit-image、 cython 、numpy+mkl
代码片段和文件信息
“““
Mask R-CNN
Configurations and data loading code for MS COCO.
Copyright (c) 2017 Matterport Inc.
Licensed under the MIT License (see LICENSE for details)
Written by Waleed Abdulla
------------------------------------------------------------
Usage: import the module (see Jupyter notebooks for examples) or run from
the command line as such:
# Train a new model starting from pre-trained COCO weights
python3 coco.py train --dataset=/path/to/coco/ --model=coco
# Train a new model starting from ImageNet weights
python3 coco.py train --dataset=/path/to/coco/ --model=imagenet
# Continue training a model that you had trained earlier
python3 coco.py train --dataset=/path/to/coco/ --model=/path/to/weights.h5
# Continue training the last model you trained
python3 coco.py train --dataset=/path/to/coco/ --model=last
# Run COCO evaluatoin on the last model you trained
python3 coco.py evaluate --dataset=/path/to/coco/ --model=last
“““
import os
import time
import numpy as np
# Download and install the Python COCO tools from https://github.com/waleedka/coco
# That‘s a fork from the original https://github.com/pdollar/coco with a bug
# fix for Python 3.
# I submitted a pull request https://github.com/cocodataset/cocoapi/pull/50
# If the PR is merged then use the original repo.
# Note: Edit PythonAPI/Makefile and replace “python“ with “python3“.
from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOeval
from pycocotools import mask as maskUtils
import zipfile
import urllib.request
import shutil
from config import Config
import utils
import model as modellib
# Root directory of the project
ROOT_DIR = os.getcwd()
# Path to trained weights file
COCO_MODEL_PATH = os.path.join(ROOT_DIR “mask_rcnn_coco.h5“)
# Directory to save logs and model checkpoints if not provided
# through the command line argument --logs
DEFAULT_LOGS_DIR = os.path.join(ROOT_DIR “logs“)
DEFAULT_DATASET_YEAR = “2014“
############################################################
# Configurations
############################################################
class CocoConfig(Config):
“““Configuration for training on MS COCO.
Derives from the base Config class and overrides values specific
to the COCO dataset.
“““
# Give the configuration a recognizable name
NAME = “coco“
# We use a GPU with 12GB memory which can fit two images.
# Adjust down if you use a smaller GPU.
IMAGES_PER_GPU = 2
# Uncomment to train on 8 GPUs (default is 1)
# GPU_COUNT = 8
# Number of classes (including background)
NUM_CLASSES = 1 + 80 # COCO has 80 classes
############################################################
# Dataset
############################################################
class CocoDataset(utils.Dataset):
def load_coco(self dataset_dir subset year=DEFAULT_DATASET_YEAR class_ids=None
class_map=None return_coco=False auto_download=False):
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-12-24 07:25 Mask_RCNN-master\
文件 51 2017-12-24 07:25 Mask_RCNN-master\.gitignore
文件 1095 2017-12-24 07:25 Mask_RCNN-master\LICENSE
文件 10431 2017-12-24 07:25 Mask_RCNN-master\README.md
目录 0 2017-12-24 07:25 Mask_RCNN-master\assets\
文件 70770 2017-12-24 07:25 Mask_RCNN-master\assets\detection_activations.png
文件 764709 2017-12-24 07:25 Mask_RCNN-master\assets\detection_anchors.png
文件 908404 2017-12-24 07:25 Mask_RCNN-master\assets\detection_final.png
文件 13755 2017-12-24 07:25 Mask_RCNN-master\assets\detection_histograms.png
文件 9981 2017-12-24 07:25 Mask_RCNN-master\assets\detection_masks.png
文件 719616 2017-12-24 07:25 Mask_RCNN-master\assets\detection_refinement.png
文件 44117 2017-12-24 07:25 Mask_RCNN-master\assets\detection_tensorboard.png
文件 892357 2017-12-24 07:25 Mask_RCNN-master\assets\donuts.png
文件 951532 2017-12-24 07:25 Mask_RCNN-master\assets\sheep.png
文件 939244 2017-12-24 07:25 Mask_RCNN-master\assets\street.png
文件 20737 2017-12-24 07:25 Mask_RCNN-master\coco.py
文件 6192 2017-12-24 07:25 Mask_RCNN-master\config.py
文件 1551456 2017-12-24 07:25 Mask_RCNN-master\demo.ipynb
目录 0 2017-12-24 07:25 Mask_RCNN-master\images\
文件 140945 2017-12-24 07:25 Mask_RCNN-master\images\1045023827_4ec3e8ba5c_z.jpg
文件 68354 2017-12-24 07:25 Mask_RCNN-master\images\12283150_12d37e6389_z.jpg
文件 208110 2017-12-24 07:25 Mask_RCNN-master\images\2383514521_1fc8d7b0de_z.jpg
文件 133711 2017-12-24 07:25 Mask_RCNN-master\images\2502287818_41e4b0c4fb_z.jpg
文件 181227 2017-12-24 07:25 Mask_RCNN-master\images\2516944023_d00345997d_z.jpg
文件 180424 2017-12-24 07:25 Mask_RCNN-master\images\25691390_f9944f61b5_z.jpg
文件 124808 2017-12-24 07:25 Mask_RCNN-master\images\262985539_1709e54576_z.jpg
文件 173689 2017-12-24 07:25 Mask_RCNN-master\images\3132016470_c27baa00e8_z.jpg
文件 160935 2017-12-24 07:25 Mask_RCNN-master\images\3627527276_6fe8cd9bfe_z.jpg
文件 150547 2017-12-24 07:25 Mask_RCNN-master\images\3651581213_f81963d1dd_z.jpg
文件 122553 2017-12-24 07:25 Mask_RCNN-master\images\3800883468_12af3c0b50_z.jpg
文件 96266 2017-12-24 07:25 Mask_RCNN-master\images\3862500489_6fd195d183_z.jpg
............此处省略26个文件信息
- 上一篇:python深度学习-高清pdf-源码
- 下一篇:Networkx安装步骤及资源
评论
共有 条评论