Created
January 29, 2020 15:37
-
-
Save emadehsan/137c6fe4bd0e937b82afc978e8484ad3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import random | |
import math | |
import numpy as np | |
import skimage.io | |
import matplotlib | |
import matplotlib.pyplot as plt | |
# Root directory of the project | |
ROOT_DIR = os.path.abspath("./Mask_RCNN/") | |
# Import Mask RCNN | |
sys.path.append(ROOT_DIR) # To find local version of the library | |
from mrcnn import utils | |
import mrcnn.model as modellib | |
from mrcnn import visualize | |
# Import COCO config | |
sys.path.append(os.path.join(ROOT_DIR, "samples/coco/")) # find local version | |
import coco | |
%matplotlib inline | |
# Directory to save logs and trained model | |
MODEL_DIR = os.path.join(ROOT_DIR, "logs") | |
# Local path to trained weights file | |
COCO_MODEL_PATH = os.path.join(ROOT_DIR, "mask_rcnn_coco.h5") | |
# Download COCO trained weights from Releases if needed | |
if not os.path.exists(COCO_MODEL_PATH): | |
utils.download_trained_weights(COCO_MODEL_PATH) | |
# Directory of images to run detection on | |
IMAGE_DIR = os.path.join(ROOT_DIR, "images") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great, thanks for share!!