File size: 1,428 Bytes
79cf6ef |
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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
import numpy as np
def test_base_transform(image, mean):
x = image.astype(np.float32)
x -= mean
x = x.astype(np.float32)
return x
class TestBaseTransform:
def __init__(self, mean):
self.mean = np.array(mean, dtype=np.float32)
def __call__(self, image):
return test_base_transform(image, self.mean)
widerface_640 = {
'num_classes': 2,
'feature_maps': [160, 80, 40, 20, 10, 5],
'min_dim': 640,
'steps': [4, 8, 16, 32, 64, 128], # stride
'variance': [0.1, 0.2],
'clip': True, # make default box in [0,1]
'name': 'WIDERFace',
'l2norm_scale': [10, 8, 5],
'base': [64, 64, 'M', 128, 128, 'M', 256, 256, 256, 'C', 512, 512, 512, 'M', 512, 512, 512],
'extras': [256, 'S', 512, 128, 'S', 256],
'mbox': [1, 1, 1, 1, 1, 1],
'min_sizes': [16, 32, 64, 128, 256, 512],
'max_sizes': [],
'aspect_ratios': [[1.5], [1.5], [1.5], [1.5], [1.5], [1.5]], # [1,2] default 1
'backbone': 'resnet152',
'feature_pyramid_network': True,
'bottom_up_path': False,
'feature_enhance_module': True,
'max_in_out': True,
'focal_loss': False,
'progressive_anchor': True,
'refinedet': False,
'max_out': False,
'anchor_compensation': False,
'data_anchor_sampling': False,
'overlap_thresh': [0.4],
'negpos_ratio': 3,
# test
'nms_thresh': 0.3,
'conf_thresh': 0.01,
'num_thresh': 5000,
}
|