File size: 872 Bytes
5637560
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from mrcnn.config import Config


class WheatDetectorConfig(Config):
    # Give the configuration a recognizable name
    NAME = "wheat"
    GPU_COUNT = 1
    IMAGES_PER_GPU = 2
    BACKBONE = "resnet101"
    NUM_CLASSES = 2
    IMAGE_RESIZE_MODE = "square"
    IMAGE_MIN_DIM = 1024
    IMAGE_MAX_DIM = 1024
    STEPS_PER_EPOCH = 120
    BACKBONE_STRIDES = [4, 8, 16, 32, 64]
    RPN_ANCHOR_SCALES = (16, 32, 64, 128, 256)
    LEARNING_RATE = 0.005
    WEIGHT_DECAY = 0.0005
    TRAIN_ROIS_PER_IMAGE = 350
    DETECTION_MIN_CONFIDENCE = 0.60
    VALIDATION_STEPS = 60
    MAX_GT_INSTANCES = 500
    LOSS_WEIGHTS = {
        "rpn_class_loss": 1.0,
        "rpn_bbox_loss": 1.0,
        "mrcnn_class_loss": 1.0,
        "mrcnn_bbox_loss": 1.0,
        "mrcnn_mask_loss": 1.0,
    }


class WheatInferenceConfig(WheatDetectorConfig):
    GPU_COUNT = 1
    IMAGES_PER_GPU = 1