├── README.md ├── cython ├── .gitignore ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-36.pyc │ └── __init__.cpython-37.pyc ├── anchors.pyx ├── bbox.pyx ├── build │ └── temp.macosx-10.7-x86_64-3.6 │ │ ├── anchors.o │ │ ├── bbox.o │ │ └── cpu_nms.o ├── cpu_nms.pyx ├── gpu_nms.hpp ├── gpu_nms.pyx ├── nms_kernel.cu └── setup.py ├── detector.py ├── inference.py ├── mnet.25-0000.params ├── mnet.25-symbol.json ├── retinaface.py ├── test_images ├── t1.jpg ├── t2.jpg ├── t3.jpg ├── t4.jpg ├── t5.jpg └── t6.jpg ├── test_results ├── t1.jpg ├── t2.jpg ├── t3.jpg ├── t4.jpg ├── t5.jpg └── t6.jpg └── utils.py /README.md: -------------------------------------------------------------------------------- 1 | # Inference Code for RetinaFace with MobileNet Backend in PyTorch 2 | 3 | ### Step 1: 4 | ```Shell 5 | cd cython 6 | python setup.py build_ext --inplace 7 | ``` 8 | 9 | ### Step 2: 10 | ```Shell 11 | python inference.py 12 | ``` 13 | 14 | ### Evaluation(WIDERFACE): 15 | Easy Val AP: 0.8872715908531869 16 |
17 | Medium Val AP: 0.8663337842229522 18 |
19 | Hard Val AP: 0.771796729363941 20 |
21 | 22 | ### Test Results: 23 | 24 | 25 | 26 | ### References: 27 | @inproceedings{deng2019retinaface, title={RetinaFace: Single-stage Dense Face Localisation in the Wild}, author={Deng, Jiankang and Guo, Jia and Yuxiang, Zhou and Jinke Yu and Irene Kotsia and Zafeiriou, Stefanos}, booktitle={arxiv}, year={2019} } 28 | -------------------------------------------------------------------------------- /cython/.gitignore: -------------------------------------------------------------------------------- 1 | *.c 2 | *.cpp 3 | *.so 4 | -------------------------------------------------------------------------------- /cython/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bogireddytejareddy/retinaface-pytorch/21f4bff49b0a7eff00559d523e9228d60300eda9/cython/__init__.py -------------------------------------------------------------------------------- /cython/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bogireddytejareddy/retinaface-pytorch/21f4bff49b0a7eff00559d523e9228d60300eda9/cython/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /cython/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bogireddytejareddy/retinaface-pytorch/21f4bff49b0a7eff00559d523e9228d60300eda9/cython/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /cython/anchors.pyx: -------------------------------------------------------------------------------- 1 | cimport cython 2 | import numpy as np 3 | cimport numpy as np 4 | 5 | DTYPE = np.float32 6 | ctypedef np.float32_t DTYPE_t 7 | 8 | def anchors_cython(int height, int width, int stride, np.ndarray[DTYPE_t, ndim=2] base_anchors): 9 | """ 10 | Parameters 11 | ---------- 12 | height: height of plane 13 | width: width of plane 14 | stride: stride ot the original image 15 | anchors_base: (A, 4) a base set of anchors 16 | Returns 17 | ------- 18 | all_anchors: (height, width, A, 4) ndarray of anchors spreading over the plane 19 | """ 20 | cdef unsigned int A = base_anchors.shape[0] 21 | cdef np.ndarray[DTYPE_t, ndim=4] all_anchors = np.zeros((height, width, A, 4), dtype=DTYPE) 22 | cdef unsigned int iw, ih 23 | cdef unsigned int k 24 | cdef unsigned int sh 25 | cdef unsigned int sw 26 | for iw in range(width): 27 | sw = iw * stride 28 | for ih in range(height): 29 | sh = ih * stride 30 | for k in range(A): 31 | all_anchors[ih, iw, k, 0] = base_anchors[k, 0] + sw 32 | all_anchors[ih, iw, k, 1] = base_anchors[k, 1] + sh 33 | all_anchors[ih, iw, k, 2] = base_anchors[k, 2] + sw 34 | all_anchors[ih, iw, k, 3] = base_anchors[k, 3] + sh 35 | return all_anchors -------------------------------------------------------------------------------- /cython/bbox.pyx: -------------------------------------------------------------------------------- 1 | # -------------------------------------------------------- 2 | # Fast R-CNN 3 | # Copyright (c) 2015 Microsoft 4 | # Licensed under The MIT License [see LICENSE for details] 5 | # Written by Sergey Karayev 6 | # -------------------------------------------------------- 7 | 8 | cimport cython 9 | import numpy as np 10 | cimport numpy as np 11 | 12 | DTYPE = np.float 13 | ctypedef np.float_t DTYPE_t 14 | 15 | def bbox_overlaps_cython( 16 | np.ndarray[DTYPE_t, ndim=2] boxes, 17 | np.ndarray[DTYPE_t, ndim=2] query_boxes): 18 | """ 19 | Parameters 20 | ---------- 21 | boxes: (N, 4) ndarray of float 22 | query_boxes: (K, 4) ndarray of float 23 | Returns 24 | ------- 25 | overlaps: (N, K) ndarray of overlap between boxes and query_boxes 26 | """ 27 | cdef unsigned int N = boxes.shape[0] 28 | cdef unsigned int K = query_boxes.shape[0] 29 | cdef np.ndarray[DTYPE_t, ndim=2] overlaps = np.zeros((N, K), dtype=DTYPE) 30 | cdef DTYPE_t iw, ih, box_area 31 | cdef DTYPE_t ua 32 | cdef unsigned int k, n 33 | for k in range(K): 34 | box_area = ( 35 | (query_boxes[k, 2] - query_boxes[k, 0] + 1) * 36 | (query_boxes[k, 3] - query_boxes[k, 1] + 1) 37 | ) 38 | for n in range(N): 39 | iw = ( 40 | min(boxes[n, 2], query_boxes[k, 2]) - 41 | max(boxes[n, 0], query_boxes[k, 0]) + 1 42 | ) 43 | if iw > 0: 44 | ih = ( 45 | min(boxes[n, 3], query_boxes[k, 3]) - 46 | max(boxes[n, 1], query_boxes[k, 1]) + 1 47 | ) 48 | if ih > 0: 49 | ua = float( 50 | (boxes[n, 2] - boxes[n, 0] + 1) * 51 | (boxes[n, 3] - boxes[n, 1] + 1) + 52 | box_area - iw * ih 53 | ) 54 | overlaps[n, k] = iw * ih / ua 55 | return overlaps 56 | -------------------------------------------------------------------------------- /cython/build/temp.macosx-10.7-x86_64-3.6/anchors.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bogireddytejareddy/retinaface-pytorch/21f4bff49b0a7eff00559d523e9228d60300eda9/cython/build/temp.macosx-10.7-x86_64-3.6/anchors.o -------------------------------------------------------------------------------- /cython/build/temp.macosx-10.7-x86_64-3.6/bbox.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bogireddytejareddy/retinaface-pytorch/21f4bff49b0a7eff00559d523e9228d60300eda9/cython/build/temp.macosx-10.7-x86_64-3.6/bbox.o -------------------------------------------------------------------------------- /cython/build/temp.macosx-10.7-x86_64-3.6/cpu_nms.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bogireddytejareddy/retinaface-pytorch/21f4bff49b0a7eff00559d523e9228d60300eda9/cython/build/temp.macosx-10.7-x86_64-3.6/cpu_nms.o -------------------------------------------------------------------------------- /cython/cpu_nms.pyx: -------------------------------------------------------------------------------- 1 | # -------------------------------------------------------- 2 | # Fast R-CNN 3 | # Copyright (c) 2015 Microsoft 4 | # Licensed under The MIT License [see LICENSE for details] 5 | # Written by Ross Girshick 6 | # -------------------------------------------------------- 7 | 8 | import numpy as np 9 | cimport numpy as np 10 | 11 | cdef inline np.float32_t max(np.float32_t a, np.float32_t b): 12 | return a if a >= b else b 13 | 14 | cdef inline np.float32_t min(np.float32_t a, np.float32_t b): 15 | return a if a <= b else b 16 | 17 | def cpu_nms(np.ndarray[np.float32_t, ndim=2] dets, np.float thresh): 18 | cdef np.ndarray[np.float32_t, ndim=1] x1 = dets[:, 0] 19 | cdef np.ndarray[np.float32_t, ndim=1] y1 = dets[:, 1] 20 | cdef np.ndarray[np.float32_t, ndim=1] x2 = dets[:, 2] 21 | cdef np.ndarray[np.float32_t, ndim=1] y2 = dets[:, 3] 22 | cdef np.ndarray[np.float32_t, ndim=1] scores = dets[:, 4] 23 | 24 | cdef np.ndarray[np.float32_t, ndim=1] areas = (x2 - x1 + 1) * (y2 - y1 + 1) 25 | cdef np.ndarray[np.int_t, ndim=1] order = scores.argsort()[::-1] 26 | 27 | cdef int ndets = dets.shape[0] 28 | cdef np.ndarray[np.int_t, ndim=1] suppressed = \ 29 | np.zeros((ndets), dtype=np.int) 30 | 31 | # nominal indices 32 | cdef int _i, _j 33 | # sorted indices 34 | cdef int i, j 35 | # temp variables for box i's (the box currently under consideration) 36 | cdef np.float32_t ix1, iy1, ix2, iy2, iarea 37 | # variables for computing overlap with box j (lower scoring box) 38 | cdef np.float32_t xx1, yy1, xx2, yy2 39 | cdef np.float32_t w, h 40 | cdef np.float32_t inter, ovr 41 | 42 | keep = [] 43 | for _i in range(ndets): 44 | i = order[_i] 45 | if suppressed[i] == 1: 46 | continue 47 | keep.append(i) 48 | ix1 = x1[i] 49 | iy1 = y1[i] 50 | ix2 = x2[i] 51 | iy2 = y2[i] 52 | iarea = areas[i] 53 | for _j in range(_i + 1, ndets): 54 | j = order[_j] 55 | if suppressed[j] == 1: 56 | continue 57 | xx1 = max(ix1, x1[j]) 58 | yy1 = max(iy1, y1[j]) 59 | xx2 = min(ix2, x2[j]) 60 | yy2 = min(iy2, y2[j]) 61 | w = max(0.0, xx2 - xx1 + 1) 62 | h = max(0.0, yy2 - yy1 + 1) 63 | inter = w * h 64 | ovr = inter / (iarea + areas[j] - inter) 65 | if ovr >= thresh: 66 | suppressed[j] = 1 67 | 68 | return keep 69 | -------------------------------------------------------------------------------- /cython/gpu_nms.hpp: -------------------------------------------------------------------------------- 1 | void _nms(int* keep_out, int* num_out, const float* boxes_host, int boxes_num, 2 | int boxes_dim, float nms_overlap_thresh, int device_id); 3 | -------------------------------------------------------------------------------- /cython/gpu_nms.pyx: -------------------------------------------------------------------------------- 1 | # -------------------------------------------------------- 2 | # Faster R-CNN 3 | # Copyright (c) 2015 Microsoft 4 | # Licensed under The MIT License [see LICENSE for details] 5 | # Written by Ross Girshick 6 | # -------------------------------------------------------- 7 | 8 | import numpy as np 9 | cimport numpy as np 10 | 11 | assert sizeof(int) == sizeof(np.int32_t) 12 | 13 | cdef extern from "gpu_nms.hpp": 14 | void _nms(np.int32_t*, int*, np.float32_t*, int, int, float, int) 15 | 16 | def gpu_nms(np.ndarray[np.float32_t, ndim=2] dets, np.float thresh, 17 | np.int32_t device_id=0): 18 | cdef int boxes_num = dets.shape[0] 19 | cdef int boxes_dim = dets.shape[1] 20 | cdef int num_out 21 | cdef np.ndarray[np.int32_t, ndim=1] \ 22 | keep = np.zeros(boxes_num, dtype=np.int32) 23 | cdef np.ndarray[np.float32_t, ndim=1] \ 24 | scores = dets[:, 4] 25 | cdef np.ndarray[np.int_t, ndim=1] \ 26 | order = scores.argsort()[::-1] 27 | cdef np.ndarray[np.float32_t, ndim=2] \ 28 | sorted_dets = dets[order, :] 29 | _nms(&keep[0], &num_out, &sorted_dets[0, 0], boxes_num, boxes_dim, thresh, device_id) 30 | keep = keep[:num_out] 31 | return list(order[keep]) 32 | -------------------------------------------------------------------------------- /cython/nms_kernel.cu: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------ 2 | // Faster R-CNN 3 | // Copyright (c) 2015 Microsoft 4 | // Licensed under The MIT License [see fast-rcnn/LICENSE for details] 5 | // Written by Shaoqing Ren 6 | // ------------------------------------------------------------------ 7 | 8 | #include "gpu_nms.hpp" 9 | #include 10 | #include 11 | 12 | #define CUDA_CHECK(condition) \ 13 | /* Code block avoids redefinition of cudaError_t error */ \ 14 | do { \ 15 | cudaError_t error = condition; \ 16 | if (error != cudaSuccess) { \ 17 | std::cout << cudaGetErrorString(error) << std::endl; \ 18 | } \ 19 | } while (0) 20 | 21 | #define DIVUP(m,n) ((m) / (n) + ((m) % (n) > 0)) 22 | int const threadsPerBlock = sizeof(unsigned long long) * 8; 23 | 24 | __device__ inline float devIoU(float const * const a, float const * const b) { 25 | float left = max(a[0], b[0]), right = min(a[2], b[2]); 26 | float top = max(a[1], b[1]), bottom = min(a[3], b[3]); 27 | float width = max(right - left + 1, 0.f), height = max(bottom - top + 1, 0.f); 28 | float interS = width * height; 29 | float Sa = (a[2] - a[0] + 1) * (a[3] - a[1] + 1); 30 | float Sb = (b[2] - b[0] + 1) * (b[3] - b[1] + 1); 31 | return interS / (Sa + Sb - interS); 32 | } 33 | 34 | __global__ void nms_kernel(const int n_boxes, const float nms_overlap_thresh, 35 | const float *dev_boxes, unsigned long long *dev_mask) { 36 | const int row_start = blockIdx.y; 37 | const int col_start = blockIdx.x; 38 | 39 | // if (row_start > col_start) return; 40 | 41 | const int row_size = 42 | min(n_boxes - row_start * threadsPerBlock, threadsPerBlock); 43 | const int col_size = 44 | min(n_boxes - col_start * threadsPerBlock, threadsPerBlock); 45 | 46 | __shared__ float block_boxes[threadsPerBlock * 5]; 47 | if (threadIdx.x < col_size) { 48 | block_boxes[threadIdx.x * 5 + 0] = 49 | dev_boxes[(threadsPerBlock * col_start + threadIdx.x) * 5 + 0]; 50 | block_boxes[threadIdx.x * 5 + 1] = 51 | dev_boxes[(threadsPerBlock * col_start + threadIdx.x) * 5 + 1]; 52 | block_boxes[threadIdx.x * 5 + 2] = 53 | dev_boxes[(threadsPerBlock * col_start + threadIdx.x) * 5 + 2]; 54 | block_boxes[threadIdx.x * 5 + 3] = 55 | dev_boxes[(threadsPerBlock * col_start + threadIdx.x) * 5 + 3]; 56 | block_boxes[threadIdx.x * 5 + 4] = 57 | dev_boxes[(threadsPerBlock * col_start + threadIdx.x) * 5 + 4]; 58 | } 59 | __syncthreads(); 60 | 61 | if (threadIdx.x < row_size) { 62 | const int cur_box_idx = threadsPerBlock * row_start + threadIdx.x; 63 | const float *cur_box = dev_boxes + cur_box_idx * 5; 64 | int i = 0; 65 | unsigned long long t = 0; 66 | int start = 0; 67 | if (row_start == col_start) { 68 | start = threadIdx.x + 1; 69 | } 70 | for (i = start; i < col_size; i++) { 71 | if (devIoU(cur_box, block_boxes + i * 5) > nms_overlap_thresh) { 72 | t |= 1ULL << i; 73 | } 74 | } 75 | const int col_blocks = DIVUP(n_boxes, threadsPerBlock); 76 | dev_mask[cur_box_idx * col_blocks + col_start] = t; 77 | } 78 | } 79 | 80 | void _set_device(int device_id) { 81 | int current_device; 82 | CUDA_CHECK(cudaGetDevice(¤t_device)); 83 | if (current_device == device_id) { 84 | return; 85 | } 86 | // The call to cudaSetDevice must come before any calls to Get, which 87 | // may perform initialization using the GPU. 88 | CUDA_CHECK(cudaSetDevice(device_id)); 89 | } 90 | 91 | void _nms(int* keep_out, int* num_out, const float* boxes_host, int boxes_num, 92 | int boxes_dim, float nms_overlap_thresh, int device_id) { 93 | _set_device(device_id); 94 | 95 | float* boxes_dev = NULL; 96 | unsigned long long* mask_dev = NULL; 97 | 98 | const int col_blocks = DIVUP(boxes_num, threadsPerBlock); 99 | 100 | CUDA_CHECK(cudaMalloc(&boxes_dev, 101 | boxes_num * boxes_dim * sizeof(float))); 102 | CUDA_CHECK(cudaMemcpy(boxes_dev, 103 | boxes_host, 104 | boxes_num * boxes_dim * sizeof(float), 105 | cudaMemcpyHostToDevice)); 106 | 107 | CUDA_CHECK(cudaMalloc(&mask_dev, 108 | boxes_num * col_blocks * sizeof(unsigned long long))); 109 | 110 | dim3 blocks(DIVUP(boxes_num, threadsPerBlock), 111 | DIVUP(boxes_num, threadsPerBlock)); 112 | dim3 threads(threadsPerBlock); 113 | nms_kernel<<>>(boxes_num, 114 | nms_overlap_thresh, 115 | boxes_dev, 116 | mask_dev); 117 | 118 | std::vector mask_host(boxes_num * col_blocks); 119 | CUDA_CHECK(cudaMemcpy(&mask_host[0], 120 | mask_dev, 121 | sizeof(unsigned long long) * boxes_num * col_blocks, 122 | cudaMemcpyDeviceToHost)); 123 | 124 | std::vector remv(col_blocks); 125 | memset(&remv[0], 0, sizeof(unsigned long long) * col_blocks); 126 | 127 | int num_to_keep = 0; 128 | for (int i = 0; i < boxes_num; i++) { 129 | int nblock = i / threadsPerBlock; 130 | int inblock = i % threadsPerBlock; 131 | 132 | if (!(remv[nblock] & (1ULL << inblock))) { 133 | keep_out[num_to_keep++] = i; 134 | unsigned long long *p = &mask_host[0] + i * col_blocks; 135 | for (int j = nblock; j < col_blocks; j++) { 136 | remv[j] |= p[j]; 137 | } 138 | } 139 | } 140 | *num_out = num_to_keep; 141 | 142 | CUDA_CHECK(cudaFree(boxes_dev)); 143 | CUDA_CHECK(cudaFree(mask_dev)); 144 | } 145 | -------------------------------------------------------------------------------- /cython/setup.py: -------------------------------------------------------------------------------- 1 | # -------------------------------------------------------- 2 | # Fast R-CNN 3 | # Copyright (c) 2015 Microsoft 4 | # Licensed under The MIT License [see LICENSE for details] 5 | # Written by Ross Girshick 6 | # -------------------------------------------------------- 7 | 8 | import os 9 | from os.path import join as pjoin 10 | from setuptools import setup 11 | from distutils.extension import Extension 12 | from Cython.Distutils import build_ext 13 | import numpy as np 14 | 15 | 16 | def find_in_path(name, path): 17 | "Find a file in a search path" 18 | # Adapted fom 19 | # http://code.activestate.com/recipes/52224-find-a-file-given-a-search-path/ 20 | for dir in path.split(os.pathsep): 21 | binpath = pjoin(dir, name) 22 | if os.path.exists(binpath): 23 | return os.path.abspath(binpath) 24 | return None 25 | 26 | 27 | def locate_cuda(): 28 | """Locate the CUDA environment on the system 29 | 30 | Returns a dict with keys 'home', 'nvcc', 'include', and 'lib64' 31 | and values giving the absolute path to each directory. 32 | 33 | Starts by looking for the CUDAHOME env variable. If not found, everything 34 | is based on finding 'nvcc' in the PATH. 35 | """ 36 | 37 | # first check if the CUDAHOME env variable is in use 38 | if 'CUDAHOME' in os.environ: 39 | home = os.environ['CUDAHOME'] 40 | nvcc = pjoin(home, 'bin', 'nvcc') 41 | else: 42 | # otherwise, search the PATH for NVCC 43 | default_path = pjoin(os.sep, 'usr', 'local', 'cuda', 'bin') 44 | nvcc = find_in_path('nvcc', os.environ['PATH'] + os.pathsep + default_path) 45 | if nvcc is None: 46 | raise EnvironmentError('The nvcc binary could not be ' 47 | 'located in your $PATH. Either add it to your path, or set $CUDAHOME') 48 | home = os.path.dirname(os.path.dirname(nvcc)) 49 | 50 | cudaconfig = {'home':home, 'nvcc':nvcc, 51 | 'include': pjoin(home, 'include'), 52 | 'lib64': pjoin(home, 'lib64')} 53 | for k, v in cudaconfig.items(): 54 | if not os.path.exists(v): 55 | raise EnvironmentError('The CUDA %s path could not be located in %s' % (k, v)) 56 | 57 | return cudaconfig 58 | 59 | 60 | # Test if cuda could be foun 61 | try: 62 | CUDA = locate_cuda() 63 | except EnvironmentError: 64 | CUDA = None 65 | 66 | 67 | # Obtain the numpy include directory. This logic works across numpy versions. 68 | try: 69 | numpy_include = np.get_include() 70 | except AttributeError: 71 | numpy_include = np.get_numpy_include() 72 | 73 | 74 | def customize_compiler_for_nvcc(self): 75 | """inject deep into distutils to customize how the dispatch 76 | to gcc/nvcc works. 77 | 78 | If you subclass UnixCCompiler, it's not trivial to get your subclass 79 | injected in, and still have the right customizations (i.e. 80 | distutils.sysconfig.customize_compiler) run on it. So instead of going 81 | the OO route, I have this. Note, it's kindof like a wierd functional 82 | subclassing going on.""" 83 | 84 | # tell the compiler it can processes .cu 85 | self.src_extensions.append('.cu') 86 | 87 | # save references to the default compiler_so and _comple methods 88 | default_compiler_so = self.compiler_so 89 | super = self._compile 90 | 91 | # now redefine the _compile method. This gets executed for each 92 | # object but distutils doesn't have the ability to change compilers 93 | # based on source extension: we add it. 94 | def _compile(obj, src, ext, cc_args, extra_postargs, pp_opts): 95 | if os.path.splitext(src)[1] == '.cu': 96 | # use the cuda for .cu files 97 | self.set_executable('compiler_so', CUDA['nvcc']) 98 | # use only a subset of the extra_postargs, which are 1-1 translated 99 | # from the extra_compile_args in the Extension class 100 | postargs = extra_postargs['nvcc'] 101 | else: 102 | postargs = extra_postargs['gcc'] 103 | 104 | super(obj, src, ext, cc_args, postargs, pp_opts) 105 | # reset the default compiler_so, which we might have changed for cuda 106 | self.compiler_so = default_compiler_so 107 | 108 | # inject our redefined _compile method into the class 109 | self._compile = _compile 110 | 111 | 112 | # run the customize_compiler 113 | class custom_build_ext(build_ext): 114 | def build_extensions(self): 115 | customize_compiler_for_nvcc(self.compiler) 116 | build_ext.build_extensions(self) 117 | 118 | 119 | ext_modules = [ 120 | Extension( 121 | "bbox", 122 | ["bbox.pyx"], 123 | extra_compile_args={'gcc': ["-Wno-cpp", "-Wno-unused-function"]}, 124 | include_dirs=[numpy_include] 125 | ), 126 | Extension( 127 | "anchors", 128 | ["anchors.pyx"], 129 | extra_compile_args={'gcc': ["-Wno-cpp", "-Wno-unused-function"]}, 130 | include_dirs=[numpy_include] 131 | ), 132 | Extension( 133 | "cpu_nms", 134 | ["cpu_nms.pyx"], 135 | extra_compile_args={'gcc': ["-Wno-cpp", "-Wno-unused-function"]}, 136 | include_dirs = [numpy_include] 137 | ), 138 | ] 139 | 140 | if CUDA is not None: 141 | ext_modules.append( 142 | Extension('gpu_nms', 143 | ['nms_kernel.cu', 'gpu_nms.pyx'], 144 | library_dirs=[CUDA['lib64']], 145 | libraries=['cudart'], 146 | language='c++', 147 | runtime_library_dirs=[CUDA['lib64']], 148 | # this syntax is specific to this build system 149 | # we're only going to use certain compiler args with nvcc and not with 150 | # gcc the implementation of this trick is in customize_compiler() below 151 | extra_compile_args={'gcc': ["-Wno-unused-function"], 152 | 'nvcc': ['-arch=sm_35', 153 | '--ptxas-options=-v', 154 | '-c', 155 | '--compiler-options', 156 | "'-fPIC'"]}, 157 | include_dirs = [numpy_include, CUDA['include']] 158 | ) 159 | ) 160 | else: 161 | print('Skipping GPU_NMS') 162 | 163 | 164 | setup( 165 | name='frcnn_cython', 166 | ext_modules=ext_modules, 167 | # inject our custom trigger 168 | cmdclass={'build_ext': custom_build_ext}, 169 | ) 170 | -------------------------------------------------------------------------------- /detector.py: -------------------------------------------------------------------------------- 1 | import os 2 | import numpy as np 3 | import cv2 4 | import torch 5 | from torch.autograd import Variable 6 | from retinaface import load_retinaface_mbnet 7 | from utils import RetinaFace_Utils 8 | 9 | class Retinaface_Detector(object): 10 | def __init__(self): 11 | self.threshold = 0.8 12 | self.model = load_retinaface_mbnet() 13 | self.pixel_means = np.array([0.0, 0.0, 0.0], dtype=np.float32) 14 | self.pixel_stds = np.array([1.0, 1.0, 1.0], dtype=np.float32) 15 | self.pixel_scale = float(1.0) 16 | self.utils = RetinaFace_Utils() 17 | 18 | def img_process(self, img): 19 | target_size = 1024 20 | max_size = 1980 21 | im_shape = img.shape 22 | im_size_min = np.min(im_shape[0:2]) 23 | im_size_max = np.max(im_shape[0:2]) 24 | im_scale = float(target_size) / float(im_size_min) 25 | if np.round(im_scale * im_size_max) > max_size: 26 | im_scale = float(max_size) / float(im_size_max) 27 | im = cv2.resize(img, None, None, fx=im_scale, fy=im_scale, interpolation=cv2.INTER_LINEAR) 28 | im = im.astype(np.float32) 29 | 30 | im_tensor = np.zeros((1, 3, im.shape[0], im.shape[1]), dtype=np.float32) 31 | for i in range(3): 32 | im_tensor[0, i, :, :] = (im[:, :, 2 - i] / self.pixel_scale - self.pixel_means[2 - i]) / \ 33 | self.pixel_stds[2 - i] 34 | return im_tensor, im_scale 35 | 36 | def detect(self, img): 37 | results = [] 38 | im, im_scale = self.img_process(img) 39 | im = torch.from_numpy(im) 40 | im_tensor = Variable(im) 41 | output = self.model(im_tensor) 42 | faces, landmarks = self.utils.detect(im, output, self.threshold, im_scale) 43 | 44 | if faces is None or landmarks is None: 45 | return results 46 | 47 | for face, landmark in zip(faces, landmarks): 48 | face = face.astype(np.int) 49 | landmark = landmark.astype(np.int) 50 | results.append([face, landmark]) 51 | 52 | return results 53 | 54 | -------------------------------------------------------------------------------- /inference.py: -------------------------------------------------------------------------------- 1 | import os 2 | import cv2 3 | from detector import Retinaface_Detector 4 | 5 | detector = Retinaface_Detector() 6 | test_images = os.listdir('./test_images') 7 | 8 | for image in test_images: 9 | imgpath = os.path.join('./test_images', image) 10 | print (imgpath) 11 | 12 | img = cv2.imread(imgpath) 13 | results = detector.detect(img) 14 | 15 | print (len(results), ' faces found.') 16 | 17 | if len(results) == 0: 18 | continue 19 | 20 | for result in results: 21 | face = result[0] 22 | landmark = result[1] 23 | 24 | color = (0, 0, 255) 25 | cv2.rectangle(img, (face[0], face[1]), (face[2], face[3]), color, 2) 26 | 27 | for l in range(landmark.shape[0]): 28 | color = (0, 0, 255) 29 | if l == 0 or l == 3: 30 | color = (0, 255, 0) 31 | cv2.circle(img, (landmark[l][0], landmark[l][1]), 1, color, 2) 32 | 33 | cv2.imwrite('./test_results/' + image, img) 34 | -------------------------------------------------------------------------------- /mnet.25-0000.params: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bogireddytejareddy/retinaface-pytorch/21f4bff49b0a7eff00559d523e9228d60300eda9/mnet.25-0000.params -------------------------------------------------------------------------------- /mnet.25-symbol.json: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": [ 3 | { 4 | "op": "null", 5 | "name": "data", 6 | "inputs": [] 7 | }, 8 | { 9 | "op": "null", 10 | "name": "mobilenet0_conv0_weight", 11 | "attrs": { 12 | "__dtype__": "0", 13 | "__lr_mult__": "1.0", 14 | "__shape__": "(8L, 3L, 3L, 3L)", 15 | "__storage_type__": "0", 16 | "__wd_mult__": "1.0" 17 | }, 18 | "inputs": [] 19 | }, 20 | { 21 | "op": "Convolution", 22 | "name": "mobilenet0_conv0_fwd", 23 | "attrs": { 24 | "dilate": "(1, 1)", 25 | "kernel": "(3, 3)", 26 | "layout": "NCHW", 27 | "no_bias": "True", 28 | "num_filter": "8", 29 | "num_group": "1", 30 | "pad": "(1, 1)", 31 | "stride": "(2, 2)" 32 | }, 33 | "inputs": [[0, 0, 0], [1, 0, 0]] 34 | }, 35 | { 36 | "op": "null", 37 | "name": "mobilenet0_batchnorm0_gamma", 38 | "attrs": { 39 | "__dtype__": "0", 40 | "__init__": "ones", 41 | "__lr_mult__": "1.0", 42 | "__shape__": "(8L,)", 43 | "__storage_type__": "0", 44 | "__wd_mult__": "1.0" 45 | }, 46 | "inputs": [] 47 | }, 48 | { 49 | "op": "null", 50 | "name": "mobilenet0_batchnorm0_beta", 51 | "attrs": { 52 | "__dtype__": "0", 53 | "__init__": "zeros", 54 | "__lr_mult__": "1.0", 55 | "__shape__": "(8L,)", 56 | "__storage_type__": "0", 57 | "__wd_mult__": "1.0" 58 | }, 59 | "inputs": [] 60 | }, 61 | { 62 | "op": "null", 63 | "name": "mobilenet0_batchnorm0_running_mean", 64 | "attrs": { 65 | "__dtype__": "0", 66 | "__init__": "zeros", 67 | "__lr_mult__": "1.0", 68 | "__shape__": "(8L,)", 69 | "__storage_type__": "0", 70 | "__wd_mult__": "1.0" 71 | }, 72 | "inputs": [] 73 | }, 74 | { 75 | "op": "null", 76 | "name": "mobilenet0_batchnorm0_running_var", 77 | "attrs": { 78 | "__dtype__": "0", 79 | "__init__": "ones", 80 | "__lr_mult__": "1.0", 81 | "__shape__": "(8L,)", 82 | "__storage_type__": "0", 83 | "__wd_mult__": "1.0" 84 | }, 85 | "inputs": [] 86 | }, 87 | { 88 | "op": "BatchNorm", 89 | "name": "mobilenet0_batchnorm0_fwd", 90 | "attrs": { 91 | "axis": "1", 92 | "eps": "1e-05", 93 | "fix_gamma": "False", 94 | "momentum": "0.9", 95 | "use_global_stats": "False" 96 | }, 97 | "inputs": [[2, 0, 0], [3, 0, 0], [4, 0, 0], [5, 0, 1], [6, 0, 1]] 98 | }, 99 | { 100 | "op": "Activation", 101 | "name": "mobilenet0_relu0_fwd", 102 | "attrs": {"act_type": "relu"}, 103 | "inputs": [[7, 0, 0]] 104 | }, 105 | { 106 | "op": "null", 107 | "name": "mobilenet0_conv1_weight", 108 | "attrs": { 109 | "__dtype__": "0", 110 | "__lr_mult__": "1.0", 111 | "__shape__": "(8L, 1L, 3L, 3L)", 112 | "__storage_type__": "0", 113 | "__wd_mult__": "1.0" 114 | }, 115 | "inputs": [] 116 | }, 117 | { 118 | "op": "Convolution", 119 | "name": "mobilenet0_conv1_fwd", 120 | "attrs": { 121 | "dilate": "(1, 1)", 122 | "kernel": "(3, 3)", 123 | "layout": "NCHW", 124 | "no_bias": "True", 125 | "num_filter": "8", 126 | "num_group": "8", 127 | "pad": "(1, 1)", 128 | "stride": "(1, 1)" 129 | }, 130 | "inputs": [[8, 0, 0], [9, 0, 0]] 131 | }, 132 | { 133 | "op": "null", 134 | "name": "mobilenet0_batchnorm1_gamma", 135 | "attrs": { 136 | "__dtype__": "0", 137 | "__init__": "ones", 138 | "__lr_mult__": "1.0", 139 | "__shape__": "(8L,)", 140 | "__storage_type__": "0", 141 | "__wd_mult__": "1.0" 142 | }, 143 | "inputs": [] 144 | }, 145 | { 146 | "op": "null", 147 | "name": "mobilenet0_batchnorm1_beta", 148 | "attrs": { 149 | "__dtype__": "0", 150 | "__init__": "zeros", 151 | "__lr_mult__": "1.0", 152 | "__shape__": "(8L,)", 153 | "__storage_type__": "0", 154 | "__wd_mult__": "1.0" 155 | }, 156 | "inputs": [] 157 | }, 158 | { 159 | "op": "null", 160 | "name": "mobilenet0_batchnorm1_running_mean", 161 | "attrs": { 162 | "__dtype__": "0", 163 | "__init__": "zeros", 164 | "__lr_mult__": "1.0", 165 | "__shape__": "(8L,)", 166 | "__storage_type__": "0", 167 | "__wd_mult__": "1.0" 168 | }, 169 | "inputs": [] 170 | }, 171 | { 172 | "op": "null", 173 | "name": "mobilenet0_batchnorm1_running_var", 174 | "attrs": { 175 | "__dtype__": "0", 176 | "__init__": "ones", 177 | "__lr_mult__": "1.0", 178 | "__shape__": "(8L,)", 179 | "__storage_type__": "0", 180 | "__wd_mult__": "1.0" 181 | }, 182 | "inputs": [] 183 | }, 184 | { 185 | "op": "BatchNorm", 186 | "name": "mobilenet0_batchnorm1_fwd", 187 | "attrs": { 188 | "axis": "1", 189 | "eps": "1e-05", 190 | "fix_gamma": "False", 191 | "momentum": "0.9", 192 | "use_global_stats": "False" 193 | }, 194 | "inputs": [[10, 0, 0], [11, 0, 0], [12, 0, 0], [13, 0, 1], [14, 0, 1]] 195 | }, 196 | { 197 | "op": "Activation", 198 | "name": "mobilenet0_relu1_fwd", 199 | "attrs": {"act_type": "relu"}, 200 | "inputs": [[15, 0, 0]] 201 | }, 202 | { 203 | "op": "null", 204 | "name": "mobilenet0_conv2_weight", 205 | "attrs": { 206 | "__dtype__": "0", 207 | "__lr_mult__": "1.0", 208 | "__shape__": "(16L, 8L, 1L, 1L)", 209 | "__storage_type__": "0", 210 | "__wd_mult__": "1.0" 211 | }, 212 | "inputs": [] 213 | }, 214 | { 215 | "op": "Convolution", 216 | "name": "mobilenet0_conv2_fwd", 217 | "attrs": { 218 | "dilate": "(1, 1)", 219 | "kernel": "(1, 1)", 220 | "layout": "NCHW", 221 | "no_bias": "True", 222 | "num_filter": "16", 223 | "num_group": "1", 224 | "pad": "(0, 0)", 225 | "stride": "(1, 1)" 226 | }, 227 | "inputs": [[16, 0, 0], [17, 0, 0]] 228 | }, 229 | { 230 | "op": "null", 231 | "name": "mobilenet0_batchnorm2_gamma", 232 | "attrs": { 233 | "__dtype__": "0", 234 | "__init__": "ones", 235 | "__lr_mult__": "1.0", 236 | "__shape__": "(16L,)", 237 | "__storage_type__": "0", 238 | "__wd_mult__": "1.0" 239 | }, 240 | "inputs": [] 241 | }, 242 | { 243 | "op": "null", 244 | "name": "mobilenet0_batchnorm2_beta", 245 | "attrs": { 246 | "__dtype__": "0", 247 | "__init__": "zeros", 248 | "__lr_mult__": "1.0", 249 | "__shape__": "(16L,)", 250 | "__storage_type__": "0", 251 | "__wd_mult__": "1.0" 252 | }, 253 | "inputs": [] 254 | }, 255 | { 256 | "op": "null", 257 | "name": "mobilenet0_batchnorm2_running_mean", 258 | "attrs": { 259 | "__dtype__": "0", 260 | "__init__": "zeros", 261 | "__lr_mult__": "1.0", 262 | "__shape__": "(16L,)", 263 | "__storage_type__": "0", 264 | "__wd_mult__": "1.0" 265 | }, 266 | "inputs": [] 267 | }, 268 | { 269 | "op": "null", 270 | "name": "mobilenet0_batchnorm2_running_var", 271 | "attrs": { 272 | "__dtype__": "0", 273 | "__init__": "ones", 274 | "__lr_mult__": "1.0", 275 | "__shape__": "(16L,)", 276 | "__storage_type__": "0", 277 | "__wd_mult__": "1.0" 278 | }, 279 | "inputs": [] 280 | }, 281 | { 282 | "op": "BatchNorm", 283 | "name": "mobilenet0_batchnorm2_fwd", 284 | "attrs": { 285 | "axis": "1", 286 | "eps": "1e-05", 287 | "fix_gamma": "False", 288 | "momentum": "0.9", 289 | "use_global_stats": "False" 290 | }, 291 | "inputs": [[18, 0, 0], [19, 0, 0], [20, 0, 0], [21, 0, 1], [22, 0, 1]] 292 | }, 293 | { 294 | "op": "Activation", 295 | "name": "mobilenet0_relu2_fwd", 296 | "attrs": {"act_type": "relu"}, 297 | "inputs": [[23, 0, 0]] 298 | }, 299 | { 300 | "op": "null", 301 | "name": "mobilenet0_conv3_weight", 302 | "attrs": { 303 | "__dtype__": "0", 304 | "__lr_mult__": "1.0", 305 | "__shape__": "(16L, 1L, 3L, 3L)", 306 | "__storage_type__": "0", 307 | "__wd_mult__": "1.0" 308 | }, 309 | "inputs": [] 310 | }, 311 | { 312 | "op": "Convolution", 313 | "name": "mobilenet0_conv3_fwd", 314 | "attrs": { 315 | "dilate": "(1, 1)", 316 | "kernel": "(3, 3)", 317 | "layout": "NCHW", 318 | "no_bias": "True", 319 | "num_filter": "16", 320 | "num_group": "16", 321 | "pad": "(1, 1)", 322 | "stride": "(2, 2)" 323 | }, 324 | "inputs": [[24, 0, 0], [25, 0, 0]] 325 | }, 326 | { 327 | "op": "null", 328 | "name": "mobilenet0_batchnorm3_gamma", 329 | "attrs": { 330 | "__dtype__": "0", 331 | "__init__": "ones", 332 | "__lr_mult__": "1.0", 333 | "__shape__": "(16L,)", 334 | "__storage_type__": "0", 335 | "__wd_mult__": "1.0" 336 | }, 337 | "inputs": [] 338 | }, 339 | { 340 | "op": "null", 341 | "name": "mobilenet0_batchnorm3_beta", 342 | "attrs": { 343 | "__dtype__": "0", 344 | "__init__": "zeros", 345 | "__lr_mult__": "1.0", 346 | "__shape__": "(16L,)", 347 | "__storage_type__": "0", 348 | "__wd_mult__": "1.0" 349 | }, 350 | "inputs": [] 351 | }, 352 | { 353 | "op": "null", 354 | "name": "mobilenet0_batchnorm3_running_mean", 355 | "attrs": { 356 | "__dtype__": "0", 357 | "__init__": "zeros", 358 | "__lr_mult__": "1.0", 359 | "__shape__": "(16L,)", 360 | "__storage_type__": "0", 361 | "__wd_mult__": "1.0" 362 | }, 363 | "inputs": [] 364 | }, 365 | { 366 | "op": "null", 367 | "name": "mobilenet0_batchnorm3_running_var", 368 | "attrs": { 369 | "__dtype__": "0", 370 | "__init__": "ones", 371 | "__lr_mult__": "1.0", 372 | "__shape__": "(16L,)", 373 | "__storage_type__": "0", 374 | "__wd_mult__": "1.0" 375 | }, 376 | "inputs": [] 377 | }, 378 | { 379 | "op": "BatchNorm", 380 | "name": "mobilenet0_batchnorm3_fwd", 381 | "attrs": { 382 | "axis": "1", 383 | "eps": "1e-05", 384 | "fix_gamma": "False", 385 | "momentum": "0.9", 386 | "use_global_stats": "False" 387 | }, 388 | "inputs": [[26, 0, 0], [27, 0, 0], [28, 0, 0], [29, 0, 1], [30, 0, 1]] 389 | }, 390 | { 391 | "op": "Activation", 392 | "name": "mobilenet0_relu3_fwd", 393 | "attrs": {"act_type": "relu"}, 394 | "inputs": [[31, 0, 0]] 395 | }, 396 | { 397 | "op": "null", 398 | "name": "mobilenet0_conv4_weight", 399 | "attrs": { 400 | "__dtype__": "0", 401 | "__lr_mult__": "1.0", 402 | "__shape__": "(32L, 16L, 1L, 1L)", 403 | "__storage_type__": "0", 404 | "__wd_mult__": "1.0" 405 | }, 406 | "inputs": [] 407 | }, 408 | { 409 | "op": "Convolution", 410 | "name": "mobilenet0_conv4_fwd", 411 | "attrs": { 412 | "dilate": "(1, 1)", 413 | "kernel": "(1, 1)", 414 | "layout": "NCHW", 415 | "no_bias": "True", 416 | "num_filter": "32", 417 | "num_group": "1", 418 | "pad": "(0, 0)", 419 | "stride": "(1, 1)" 420 | }, 421 | "inputs": [[32, 0, 0], [33, 0, 0]] 422 | }, 423 | { 424 | "op": "null", 425 | "name": "mobilenet0_batchnorm4_gamma", 426 | "attrs": { 427 | "__dtype__": "0", 428 | "__init__": "ones", 429 | "__lr_mult__": "1.0", 430 | "__shape__": "(32L,)", 431 | "__storage_type__": "0", 432 | "__wd_mult__": "1.0" 433 | }, 434 | "inputs": [] 435 | }, 436 | { 437 | "op": "null", 438 | "name": "mobilenet0_batchnorm4_beta", 439 | "attrs": { 440 | "__dtype__": "0", 441 | "__init__": "zeros", 442 | "__lr_mult__": "1.0", 443 | "__shape__": "(32L,)", 444 | "__storage_type__": "0", 445 | "__wd_mult__": "1.0" 446 | }, 447 | "inputs": [] 448 | }, 449 | { 450 | "op": "null", 451 | "name": "mobilenet0_batchnorm4_running_mean", 452 | "attrs": { 453 | "__dtype__": "0", 454 | "__init__": "zeros", 455 | "__lr_mult__": "1.0", 456 | "__shape__": "(32L,)", 457 | "__storage_type__": "0", 458 | "__wd_mult__": "1.0" 459 | }, 460 | "inputs": [] 461 | }, 462 | { 463 | "op": "null", 464 | "name": "mobilenet0_batchnorm4_running_var", 465 | "attrs": { 466 | "__dtype__": "0", 467 | "__init__": "ones", 468 | "__lr_mult__": "1.0", 469 | "__shape__": "(32L,)", 470 | "__storage_type__": "0", 471 | "__wd_mult__": "1.0" 472 | }, 473 | "inputs": [] 474 | }, 475 | { 476 | "op": "BatchNorm", 477 | "name": "mobilenet0_batchnorm4_fwd", 478 | "attrs": { 479 | "axis": "1", 480 | "eps": "1e-05", 481 | "fix_gamma": "False", 482 | "momentum": "0.9", 483 | "use_global_stats": "False" 484 | }, 485 | "inputs": [[34, 0, 0], [35, 0, 0], [36, 0, 0], [37, 0, 1], [38, 0, 1]] 486 | }, 487 | { 488 | "op": "Activation", 489 | "name": "mobilenet0_relu4_fwd", 490 | "attrs": {"act_type": "relu"}, 491 | "inputs": [[39, 0, 0]] 492 | }, 493 | { 494 | "op": "null", 495 | "name": "mobilenet0_conv5_weight", 496 | "attrs": { 497 | "__dtype__": "0", 498 | "__lr_mult__": "1.0", 499 | "__shape__": "(32L, 1L, 3L, 3L)", 500 | "__storage_type__": "0", 501 | "__wd_mult__": "1.0" 502 | }, 503 | "inputs": [] 504 | }, 505 | { 506 | "op": "Convolution", 507 | "name": "mobilenet0_conv5_fwd", 508 | "attrs": { 509 | "dilate": "(1, 1)", 510 | "kernel": "(3, 3)", 511 | "layout": "NCHW", 512 | "no_bias": "True", 513 | "num_filter": "32", 514 | "num_group": "32", 515 | "pad": "(1, 1)", 516 | "stride": "(1, 1)" 517 | }, 518 | "inputs": [[40, 0, 0], [41, 0, 0]] 519 | }, 520 | { 521 | "op": "null", 522 | "name": "mobilenet0_batchnorm5_gamma", 523 | "attrs": { 524 | "__dtype__": "0", 525 | "__init__": "ones", 526 | "__lr_mult__": "1.0", 527 | "__shape__": "(32L,)", 528 | "__storage_type__": "0", 529 | "__wd_mult__": "1.0" 530 | }, 531 | "inputs": [] 532 | }, 533 | { 534 | "op": "null", 535 | "name": "mobilenet0_batchnorm5_beta", 536 | "attrs": { 537 | "__dtype__": "0", 538 | "__init__": "zeros", 539 | "__lr_mult__": "1.0", 540 | "__shape__": "(32L,)", 541 | "__storage_type__": "0", 542 | "__wd_mult__": "1.0" 543 | }, 544 | "inputs": [] 545 | }, 546 | { 547 | "op": "null", 548 | "name": "mobilenet0_batchnorm5_running_mean", 549 | "attrs": { 550 | "__dtype__": "0", 551 | "__init__": "zeros", 552 | "__lr_mult__": "1.0", 553 | "__shape__": "(32L,)", 554 | "__storage_type__": "0", 555 | "__wd_mult__": "1.0" 556 | }, 557 | "inputs": [] 558 | }, 559 | { 560 | "op": "null", 561 | "name": "mobilenet0_batchnorm5_running_var", 562 | "attrs": { 563 | "__dtype__": "0", 564 | "__init__": "ones", 565 | "__lr_mult__": "1.0", 566 | "__shape__": "(32L,)", 567 | "__storage_type__": "0", 568 | "__wd_mult__": "1.0" 569 | }, 570 | "inputs": [] 571 | }, 572 | { 573 | "op": "BatchNorm", 574 | "name": "mobilenet0_batchnorm5_fwd", 575 | "attrs": { 576 | "axis": "1", 577 | "eps": "1e-05", 578 | "fix_gamma": "False", 579 | "momentum": "0.9", 580 | "use_global_stats": "False" 581 | }, 582 | "inputs": [[42, 0, 0], [43, 0, 0], [44, 0, 0], [45, 0, 1], [46, 0, 1]] 583 | }, 584 | { 585 | "op": "Activation", 586 | "name": "mobilenet0_relu5_fwd", 587 | "attrs": {"act_type": "relu"}, 588 | "inputs": [[47, 0, 0]] 589 | }, 590 | { 591 | "op": "null", 592 | "name": "mobilenet0_conv6_weight", 593 | "attrs": { 594 | "__dtype__": "0", 595 | "__lr_mult__": "1.0", 596 | "__shape__": "(32L, 32L, 1L, 1L)", 597 | "__storage_type__": "0", 598 | "__wd_mult__": "1.0" 599 | }, 600 | "inputs": [] 601 | }, 602 | { 603 | "op": "Convolution", 604 | "name": "mobilenet0_conv6_fwd", 605 | "attrs": { 606 | "dilate": "(1, 1)", 607 | "kernel": "(1, 1)", 608 | "layout": "NCHW", 609 | "no_bias": "True", 610 | "num_filter": "32", 611 | "num_group": "1", 612 | "pad": "(0, 0)", 613 | "stride": "(1, 1)" 614 | }, 615 | "inputs": [[48, 0, 0], [49, 0, 0]] 616 | }, 617 | { 618 | "op": "null", 619 | "name": "mobilenet0_batchnorm6_gamma", 620 | "attrs": { 621 | "__dtype__": "0", 622 | "__init__": "ones", 623 | "__lr_mult__": "1.0", 624 | "__shape__": "(32L,)", 625 | "__storage_type__": "0", 626 | "__wd_mult__": "1.0" 627 | }, 628 | "inputs": [] 629 | }, 630 | { 631 | "op": "null", 632 | "name": "mobilenet0_batchnorm6_beta", 633 | "attrs": { 634 | "__dtype__": "0", 635 | "__init__": "zeros", 636 | "__lr_mult__": "1.0", 637 | "__shape__": "(32L,)", 638 | "__storage_type__": "0", 639 | "__wd_mult__": "1.0" 640 | }, 641 | "inputs": [] 642 | }, 643 | { 644 | "op": "null", 645 | "name": "mobilenet0_batchnorm6_running_mean", 646 | "attrs": { 647 | "__dtype__": "0", 648 | "__init__": "zeros", 649 | "__lr_mult__": "1.0", 650 | "__shape__": "(32L,)", 651 | "__storage_type__": "0", 652 | "__wd_mult__": "1.0" 653 | }, 654 | "inputs": [] 655 | }, 656 | { 657 | "op": "null", 658 | "name": "mobilenet0_batchnorm6_running_var", 659 | "attrs": { 660 | "__dtype__": "0", 661 | "__init__": "ones", 662 | "__lr_mult__": "1.0", 663 | "__shape__": "(32L,)", 664 | "__storage_type__": "0", 665 | "__wd_mult__": "1.0" 666 | }, 667 | "inputs": [] 668 | }, 669 | { 670 | "op": "BatchNorm", 671 | "name": "mobilenet0_batchnorm6_fwd", 672 | "attrs": { 673 | "axis": "1", 674 | "eps": "1e-05", 675 | "fix_gamma": "False", 676 | "momentum": "0.9", 677 | "use_global_stats": "False" 678 | }, 679 | "inputs": [[50, 0, 0], [51, 0, 0], [52, 0, 0], [53, 0, 1], [54, 0, 1]] 680 | }, 681 | { 682 | "op": "Activation", 683 | "name": "mobilenet0_relu6_fwd", 684 | "attrs": {"act_type": "relu"}, 685 | "inputs": [[55, 0, 0]] 686 | }, 687 | { 688 | "op": "null", 689 | "name": "mobilenet0_conv7_weight", 690 | "attrs": { 691 | "__dtype__": "0", 692 | "__lr_mult__": "1.0", 693 | "__shape__": "(32L, 1L, 3L, 3L)", 694 | "__storage_type__": "0", 695 | "__wd_mult__": "1.0" 696 | }, 697 | "inputs": [] 698 | }, 699 | { 700 | "op": "Convolution", 701 | "name": "mobilenet0_conv7_fwd", 702 | "attrs": { 703 | "dilate": "(1, 1)", 704 | "kernel": "(3, 3)", 705 | "layout": "NCHW", 706 | "no_bias": "True", 707 | "num_filter": "32", 708 | "num_group": "32", 709 | "pad": "(1, 1)", 710 | "stride": "(2, 2)" 711 | }, 712 | "inputs": [[56, 0, 0], [57, 0, 0]] 713 | }, 714 | { 715 | "op": "null", 716 | "name": "mobilenet0_batchnorm7_gamma", 717 | "attrs": { 718 | "__dtype__": "0", 719 | "__init__": "ones", 720 | "__lr_mult__": "1.0", 721 | "__shape__": "(32L,)", 722 | "__storage_type__": "0", 723 | "__wd_mult__": "1.0" 724 | }, 725 | "inputs": [] 726 | }, 727 | { 728 | "op": "null", 729 | "name": "mobilenet0_batchnorm7_beta", 730 | "attrs": { 731 | "__dtype__": "0", 732 | "__init__": "zeros", 733 | "__lr_mult__": "1.0", 734 | "__shape__": "(32L,)", 735 | "__storage_type__": "0", 736 | "__wd_mult__": "1.0" 737 | }, 738 | "inputs": [] 739 | }, 740 | { 741 | "op": "null", 742 | "name": "mobilenet0_batchnorm7_running_mean", 743 | "attrs": { 744 | "__dtype__": "0", 745 | "__init__": "zeros", 746 | "__lr_mult__": "1.0", 747 | "__shape__": "(32L,)", 748 | "__storage_type__": "0", 749 | "__wd_mult__": "1.0" 750 | }, 751 | "inputs": [] 752 | }, 753 | { 754 | "op": "null", 755 | "name": "mobilenet0_batchnorm7_running_var", 756 | "attrs": { 757 | "__dtype__": "0", 758 | "__init__": "ones", 759 | "__lr_mult__": "1.0", 760 | "__shape__": "(32L,)", 761 | "__storage_type__": "0", 762 | "__wd_mult__": "1.0" 763 | }, 764 | "inputs": [] 765 | }, 766 | { 767 | "op": "BatchNorm", 768 | "name": "mobilenet0_batchnorm7_fwd", 769 | "attrs": { 770 | "axis": "1", 771 | "eps": "1e-05", 772 | "fix_gamma": "False", 773 | "momentum": "0.9", 774 | "use_global_stats": "False" 775 | }, 776 | "inputs": [[58, 0, 0], [59, 0, 0], [60, 0, 0], [61, 0, 1], [62, 0, 1]] 777 | }, 778 | { 779 | "op": "Activation", 780 | "name": "mobilenet0_relu7_fwd", 781 | "attrs": {"act_type": "relu"}, 782 | "inputs": [[63, 0, 0]] 783 | }, 784 | { 785 | "op": "null", 786 | "name": "mobilenet0_conv8_weight", 787 | "attrs": { 788 | "__dtype__": "0", 789 | "__lr_mult__": "1.0", 790 | "__shape__": "(64L, 32L, 1L, 1L)", 791 | "__storage_type__": "0", 792 | "__wd_mult__": "1.0" 793 | }, 794 | "inputs": [] 795 | }, 796 | { 797 | "op": "Convolution", 798 | "name": "mobilenet0_conv8_fwd", 799 | "attrs": { 800 | "dilate": "(1, 1)", 801 | "kernel": "(1, 1)", 802 | "layout": "NCHW", 803 | "no_bias": "True", 804 | "num_filter": "64", 805 | "num_group": "1", 806 | "pad": "(0, 0)", 807 | "stride": "(1, 1)" 808 | }, 809 | "inputs": [[64, 0, 0], [65, 0, 0]] 810 | }, 811 | { 812 | "op": "null", 813 | "name": "mobilenet0_batchnorm8_gamma", 814 | "attrs": { 815 | "__dtype__": "0", 816 | "__init__": "ones", 817 | "__lr_mult__": "1.0", 818 | "__shape__": "(64L,)", 819 | "__storage_type__": "0", 820 | "__wd_mult__": "1.0" 821 | }, 822 | "inputs": [] 823 | }, 824 | { 825 | "op": "null", 826 | "name": "mobilenet0_batchnorm8_beta", 827 | "attrs": { 828 | "__dtype__": "0", 829 | "__init__": "zeros", 830 | "__lr_mult__": "1.0", 831 | "__shape__": "(64L,)", 832 | "__storage_type__": "0", 833 | "__wd_mult__": "1.0" 834 | }, 835 | "inputs": [] 836 | }, 837 | { 838 | "op": "null", 839 | "name": "mobilenet0_batchnorm8_running_mean", 840 | "attrs": { 841 | "__dtype__": "0", 842 | "__init__": "zeros", 843 | "__lr_mult__": "1.0", 844 | "__shape__": "(64L,)", 845 | "__storage_type__": "0", 846 | "__wd_mult__": "1.0" 847 | }, 848 | "inputs": [] 849 | }, 850 | { 851 | "op": "null", 852 | "name": "mobilenet0_batchnorm8_running_var", 853 | "attrs": { 854 | "__dtype__": "0", 855 | "__init__": "ones", 856 | "__lr_mult__": "1.0", 857 | "__shape__": "(64L,)", 858 | "__storage_type__": "0", 859 | "__wd_mult__": "1.0" 860 | }, 861 | "inputs": [] 862 | }, 863 | { 864 | "op": "BatchNorm", 865 | "name": "mobilenet0_batchnorm8_fwd", 866 | "attrs": { 867 | "axis": "1", 868 | "eps": "1e-05", 869 | "fix_gamma": "False", 870 | "momentum": "0.9", 871 | "use_global_stats": "False" 872 | }, 873 | "inputs": [[66, 0, 0], [67, 0, 0], [68, 0, 0], [69, 0, 1], [70, 0, 1]] 874 | }, 875 | { 876 | "op": "Activation", 877 | "name": "mobilenet0_relu8_fwd", 878 | "attrs": {"act_type": "relu"}, 879 | "inputs": [[71, 0, 0]] 880 | }, 881 | { 882 | "op": "null", 883 | "name": "mobilenet0_conv9_weight", 884 | "attrs": { 885 | "__dtype__": "0", 886 | "__lr_mult__": "1.0", 887 | "__shape__": "(64L, 1L, 3L, 3L)", 888 | "__storage_type__": "0", 889 | "__wd_mult__": "1.0" 890 | }, 891 | "inputs": [] 892 | }, 893 | { 894 | "op": "Convolution", 895 | "name": "mobilenet0_conv9_fwd", 896 | "attrs": { 897 | "dilate": "(1, 1)", 898 | "kernel": "(3, 3)", 899 | "layout": "NCHW", 900 | "no_bias": "True", 901 | "num_filter": "64", 902 | "num_group": "64", 903 | "pad": "(1, 1)", 904 | "stride": "(1, 1)" 905 | }, 906 | "inputs": [[72, 0, 0], [73, 0, 0]] 907 | }, 908 | { 909 | "op": "null", 910 | "name": "mobilenet0_batchnorm9_gamma", 911 | "attrs": { 912 | "__dtype__": "0", 913 | "__init__": "ones", 914 | "__lr_mult__": "1.0", 915 | "__shape__": "(64L,)", 916 | "__storage_type__": "0", 917 | "__wd_mult__": "1.0" 918 | }, 919 | "inputs": [] 920 | }, 921 | { 922 | "op": "null", 923 | "name": "mobilenet0_batchnorm9_beta", 924 | "attrs": { 925 | "__dtype__": "0", 926 | "__init__": "zeros", 927 | "__lr_mult__": "1.0", 928 | "__shape__": "(64L,)", 929 | "__storage_type__": "0", 930 | "__wd_mult__": "1.0" 931 | }, 932 | "inputs": [] 933 | }, 934 | { 935 | "op": "null", 936 | "name": "mobilenet0_batchnorm9_running_mean", 937 | "attrs": { 938 | "__dtype__": "0", 939 | "__init__": "zeros", 940 | "__lr_mult__": "1.0", 941 | "__shape__": "(64L,)", 942 | "__storage_type__": "0", 943 | "__wd_mult__": "1.0" 944 | }, 945 | "inputs": [] 946 | }, 947 | { 948 | "op": "null", 949 | "name": "mobilenet0_batchnorm9_running_var", 950 | "attrs": { 951 | "__dtype__": "0", 952 | "__init__": "ones", 953 | "__lr_mult__": "1.0", 954 | "__shape__": "(64L,)", 955 | "__storage_type__": "0", 956 | "__wd_mult__": "1.0" 957 | }, 958 | "inputs": [] 959 | }, 960 | { 961 | "op": "BatchNorm", 962 | "name": "mobilenet0_batchnorm9_fwd", 963 | "attrs": { 964 | "axis": "1", 965 | "eps": "1e-05", 966 | "fix_gamma": "False", 967 | "momentum": "0.9", 968 | "use_global_stats": "False" 969 | }, 970 | "inputs": [[74, 0, 0], [75, 0, 0], [76, 0, 0], [77, 0, 1], [78, 0, 1]] 971 | }, 972 | { 973 | "op": "Activation", 974 | "name": "mobilenet0_relu9_fwd", 975 | "attrs": {"act_type": "relu"}, 976 | "inputs": [[79, 0, 0]] 977 | }, 978 | { 979 | "op": "null", 980 | "name": "mobilenet0_conv10_weight", 981 | "attrs": { 982 | "__dtype__": "0", 983 | "__lr_mult__": "1.0", 984 | "__shape__": "(64L, 64L, 1L, 1L)", 985 | "__storage_type__": "0", 986 | "__wd_mult__": "1.0" 987 | }, 988 | "inputs": [] 989 | }, 990 | { 991 | "op": "Convolution", 992 | "name": "mobilenet0_conv10_fwd", 993 | "attrs": { 994 | "dilate": "(1, 1)", 995 | "kernel": "(1, 1)", 996 | "layout": "NCHW", 997 | "no_bias": "True", 998 | "num_filter": "64", 999 | "num_group": "1", 1000 | "pad": "(0, 0)", 1001 | "stride": "(1, 1)" 1002 | }, 1003 | "inputs": [[80, 0, 0], [81, 0, 0]] 1004 | }, 1005 | { 1006 | "op": "null", 1007 | "name": "mobilenet0_batchnorm10_gamma", 1008 | "attrs": { 1009 | "__dtype__": "0", 1010 | "__init__": "ones", 1011 | "__lr_mult__": "1.0", 1012 | "__shape__": "(64L,)", 1013 | "__storage_type__": "0", 1014 | "__wd_mult__": "1.0" 1015 | }, 1016 | "inputs": [] 1017 | }, 1018 | { 1019 | "op": "null", 1020 | "name": "mobilenet0_batchnorm10_beta", 1021 | "attrs": { 1022 | "__dtype__": "0", 1023 | "__init__": "zeros", 1024 | "__lr_mult__": "1.0", 1025 | "__shape__": "(64L,)", 1026 | "__storage_type__": "0", 1027 | "__wd_mult__": "1.0" 1028 | }, 1029 | "inputs": [] 1030 | }, 1031 | { 1032 | "op": "null", 1033 | "name": "mobilenet0_batchnorm10_running_mean", 1034 | "attrs": { 1035 | "__dtype__": "0", 1036 | "__init__": "zeros", 1037 | "__lr_mult__": "1.0", 1038 | "__shape__": "(64L,)", 1039 | "__storage_type__": "0", 1040 | "__wd_mult__": "1.0" 1041 | }, 1042 | "inputs": [] 1043 | }, 1044 | { 1045 | "op": "null", 1046 | "name": "mobilenet0_batchnorm10_running_var", 1047 | "attrs": { 1048 | "__dtype__": "0", 1049 | "__init__": "ones", 1050 | "__lr_mult__": "1.0", 1051 | "__shape__": "(64L,)", 1052 | "__storage_type__": "0", 1053 | "__wd_mult__": "1.0" 1054 | }, 1055 | "inputs": [] 1056 | }, 1057 | { 1058 | "op": "BatchNorm", 1059 | "name": "mobilenet0_batchnorm10_fwd", 1060 | "attrs": { 1061 | "axis": "1", 1062 | "eps": "1e-05", 1063 | "fix_gamma": "False", 1064 | "momentum": "0.9", 1065 | "use_global_stats": "False" 1066 | }, 1067 | "inputs": [[82, 0, 0], [83, 0, 0], [84, 0, 0], [85, 0, 1], [86, 0, 1]] 1068 | }, 1069 | { 1070 | "op": "Activation", 1071 | "name": "mobilenet0_relu10_fwd", 1072 | "attrs": {"act_type": "relu"}, 1073 | "inputs": [[87, 0, 0]] 1074 | }, 1075 | { 1076 | "op": "null", 1077 | "name": "mobilenet0_conv11_weight", 1078 | "attrs": { 1079 | "__dtype__": "0", 1080 | "__lr_mult__": "1.0", 1081 | "__shape__": "(64L, 1L, 3L, 3L)", 1082 | "__storage_type__": "0", 1083 | "__wd_mult__": "1.0" 1084 | }, 1085 | "inputs": [] 1086 | }, 1087 | { 1088 | "op": "Convolution", 1089 | "name": "mobilenet0_conv11_fwd", 1090 | "attrs": { 1091 | "dilate": "(1, 1)", 1092 | "kernel": "(3, 3)", 1093 | "layout": "NCHW", 1094 | "no_bias": "True", 1095 | "num_filter": "64", 1096 | "num_group": "64", 1097 | "pad": "(1, 1)", 1098 | "stride": "(2, 2)" 1099 | }, 1100 | "inputs": [[88, 0, 0], [89, 0, 0]] 1101 | }, 1102 | { 1103 | "op": "null", 1104 | "name": "mobilenet0_batchnorm11_gamma", 1105 | "attrs": { 1106 | "__dtype__": "0", 1107 | "__init__": "ones", 1108 | "__lr_mult__": "1.0", 1109 | "__shape__": "(64L,)", 1110 | "__storage_type__": "0", 1111 | "__wd_mult__": "1.0" 1112 | }, 1113 | "inputs": [] 1114 | }, 1115 | { 1116 | "op": "null", 1117 | "name": "mobilenet0_batchnorm11_beta", 1118 | "attrs": { 1119 | "__dtype__": "0", 1120 | "__init__": "zeros", 1121 | "__lr_mult__": "1.0", 1122 | "__shape__": "(64L,)", 1123 | "__storage_type__": "0", 1124 | "__wd_mult__": "1.0" 1125 | }, 1126 | "inputs": [] 1127 | }, 1128 | { 1129 | "op": "null", 1130 | "name": "mobilenet0_batchnorm11_running_mean", 1131 | "attrs": { 1132 | "__dtype__": "0", 1133 | "__init__": "zeros", 1134 | "__lr_mult__": "1.0", 1135 | "__shape__": "(64L,)", 1136 | "__storage_type__": "0", 1137 | "__wd_mult__": "1.0" 1138 | }, 1139 | "inputs": [] 1140 | }, 1141 | { 1142 | "op": "null", 1143 | "name": "mobilenet0_batchnorm11_running_var", 1144 | "attrs": { 1145 | "__dtype__": "0", 1146 | "__init__": "ones", 1147 | "__lr_mult__": "1.0", 1148 | "__shape__": "(64L,)", 1149 | "__storage_type__": "0", 1150 | "__wd_mult__": "1.0" 1151 | }, 1152 | "inputs": [] 1153 | }, 1154 | { 1155 | "op": "BatchNorm", 1156 | "name": "mobilenet0_batchnorm11_fwd", 1157 | "attrs": { 1158 | "axis": "1", 1159 | "eps": "1e-05", 1160 | "fix_gamma": "False", 1161 | "momentum": "0.9", 1162 | "use_global_stats": "False" 1163 | }, 1164 | "inputs": [[90, 0, 0], [91, 0, 0], [92, 0, 0], [93, 0, 1], [94, 0, 1]] 1165 | }, 1166 | { 1167 | "op": "Activation", 1168 | "name": "mobilenet0_relu11_fwd", 1169 | "attrs": {"act_type": "relu"}, 1170 | "inputs": [[95, 0, 0]] 1171 | }, 1172 | { 1173 | "op": "null", 1174 | "name": "mobilenet0_conv12_weight", 1175 | "attrs": { 1176 | "__dtype__": "0", 1177 | "__lr_mult__": "1.0", 1178 | "__shape__": "(128L, 64L, 1L, 1L)", 1179 | "__storage_type__": "0", 1180 | "__wd_mult__": "1.0" 1181 | }, 1182 | "inputs": [] 1183 | }, 1184 | { 1185 | "op": "Convolution", 1186 | "name": "mobilenet0_conv12_fwd", 1187 | "attrs": { 1188 | "dilate": "(1, 1)", 1189 | "kernel": "(1, 1)", 1190 | "layout": "NCHW", 1191 | "no_bias": "True", 1192 | "num_filter": "128", 1193 | "num_group": "1", 1194 | "pad": "(0, 0)", 1195 | "stride": "(1, 1)" 1196 | }, 1197 | "inputs": [[96, 0, 0], [97, 0, 0]] 1198 | }, 1199 | { 1200 | "op": "null", 1201 | "name": "mobilenet0_batchnorm12_gamma", 1202 | "attrs": { 1203 | "__dtype__": "0", 1204 | "__init__": "ones", 1205 | "__lr_mult__": "1.0", 1206 | "__shape__": "(128L,)", 1207 | "__storage_type__": "0", 1208 | "__wd_mult__": "1.0" 1209 | }, 1210 | "inputs": [] 1211 | }, 1212 | { 1213 | "op": "null", 1214 | "name": "mobilenet0_batchnorm12_beta", 1215 | "attrs": { 1216 | "__dtype__": "0", 1217 | "__init__": "zeros", 1218 | "__lr_mult__": "1.0", 1219 | "__shape__": "(128L,)", 1220 | "__storage_type__": "0", 1221 | "__wd_mult__": "1.0" 1222 | }, 1223 | "inputs": [] 1224 | }, 1225 | { 1226 | "op": "null", 1227 | "name": "mobilenet0_batchnorm12_running_mean", 1228 | "attrs": { 1229 | "__dtype__": "0", 1230 | "__init__": "zeros", 1231 | "__lr_mult__": "1.0", 1232 | "__shape__": "(128L,)", 1233 | "__storage_type__": "0", 1234 | "__wd_mult__": "1.0" 1235 | }, 1236 | "inputs": [] 1237 | }, 1238 | { 1239 | "op": "null", 1240 | "name": "mobilenet0_batchnorm12_running_var", 1241 | "attrs": { 1242 | "__dtype__": "0", 1243 | "__init__": "ones", 1244 | "__lr_mult__": "1.0", 1245 | "__shape__": "(128L,)", 1246 | "__storage_type__": "0", 1247 | "__wd_mult__": "1.0" 1248 | }, 1249 | "inputs": [] 1250 | }, 1251 | { 1252 | "op": "BatchNorm", 1253 | "name": "mobilenet0_batchnorm12_fwd", 1254 | "attrs": { 1255 | "axis": "1", 1256 | "eps": "1e-05", 1257 | "fix_gamma": "False", 1258 | "momentum": "0.9", 1259 | "use_global_stats": "False" 1260 | }, 1261 | "inputs": [[98, 0, 0], [99, 0, 0], [100, 0, 0], [101, 0, 1], [102, 0, 1]] 1262 | }, 1263 | { 1264 | "op": "Activation", 1265 | "name": "mobilenet0_relu12_fwd", 1266 | "attrs": {"act_type": "relu"}, 1267 | "inputs": [[103, 0, 0]] 1268 | }, 1269 | { 1270 | "op": "null", 1271 | "name": "mobilenet0_conv13_weight", 1272 | "attrs": { 1273 | "__dtype__": "0", 1274 | "__lr_mult__": "1.0", 1275 | "__shape__": "(128L, 1L, 3L, 3L)", 1276 | "__storage_type__": "0", 1277 | "__wd_mult__": "1.0" 1278 | }, 1279 | "inputs": [] 1280 | }, 1281 | { 1282 | "op": "Convolution", 1283 | "name": "mobilenet0_conv13_fwd", 1284 | "attrs": { 1285 | "dilate": "(1, 1)", 1286 | "kernel": "(3, 3)", 1287 | "layout": "NCHW", 1288 | "no_bias": "True", 1289 | "num_filter": "128", 1290 | "num_group": "128", 1291 | "pad": "(1, 1)", 1292 | "stride": "(1, 1)" 1293 | }, 1294 | "inputs": [[104, 0, 0], [105, 0, 0]] 1295 | }, 1296 | { 1297 | "op": "null", 1298 | "name": "mobilenet0_batchnorm13_gamma", 1299 | "attrs": { 1300 | "__dtype__": "0", 1301 | "__init__": "ones", 1302 | "__lr_mult__": "1.0", 1303 | "__shape__": "(128L,)", 1304 | "__storage_type__": "0", 1305 | "__wd_mult__": "1.0" 1306 | }, 1307 | "inputs": [] 1308 | }, 1309 | { 1310 | "op": "null", 1311 | "name": "mobilenet0_batchnorm13_beta", 1312 | "attrs": { 1313 | "__dtype__": "0", 1314 | "__init__": "zeros", 1315 | "__lr_mult__": "1.0", 1316 | "__shape__": "(128L,)", 1317 | "__storage_type__": "0", 1318 | "__wd_mult__": "1.0" 1319 | }, 1320 | "inputs": [] 1321 | }, 1322 | { 1323 | "op": "null", 1324 | "name": "mobilenet0_batchnorm13_running_mean", 1325 | "attrs": { 1326 | "__dtype__": "0", 1327 | "__init__": "zeros", 1328 | "__lr_mult__": "1.0", 1329 | "__shape__": "(128L,)", 1330 | "__storage_type__": "0", 1331 | "__wd_mult__": "1.0" 1332 | }, 1333 | "inputs": [] 1334 | }, 1335 | { 1336 | "op": "null", 1337 | "name": "mobilenet0_batchnorm13_running_var", 1338 | "attrs": { 1339 | "__dtype__": "0", 1340 | "__init__": "ones", 1341 | "__lr_mult__": "1.0", 1342 | "__shape__": "(128L,)", 1343 | "__storage_type__": "0", 1344 | "__wd_mult__": "1.0" 1345 | }, 1346 | "inputs": [] 1347 | }, 1348 | { 1349 | "op": "BatchNorm", 1350 | "name": "mobilenet0_batchnorm13_fwd", 1351 | "attrs": { 1352 | "axis": "1", 1353 | "eps": "1e-05", 1354 | "fix_gamma": "False", 1355 | "momentum": "0.9", 1356 | "use_global_stats": "False" 1357 | }, 1358 | "inputs": [[106, 0, 0], [107, 0, 0], [108, 0, 0], [109, 0, 1], [110, 0, 1]] 1359 | }, 1360 | { 1361 | "op": "Activation", 1362 | "name": "mobilenet0_relu13_fwd", 1363 | "attrs": {"act_type": "relu"}, 1364 | "inputs": [[111, 0, 0]] 1365 | }, 1366 | { 1367 | "op": "null", 1368 | "name": "mobilenet0_conv14_weight", 1369 | "attrs": { 1370 | "__dtype__": "0", 1371 | "__lr_mult__": "1.0", 1372 | "__shape__": "(128L, 128L, 1L, 1L)", 1373 | "__storage_type__": "0", 1374 | "__wd_mult__": "1.0" 1375 | }, 1376 | "inputs": [] 1377 | }, 1378 | { 1379 | "op": "Convolution", 1380 | "name": "mobilenet0_conv14_fwd", 1381 | "attrs": { 1382 | "dilate": "(1, 1)", 1383 | "kernel": "(1, 1)", 1384 | "layout": "NCHW", 1385 | "no_bias": "True", 1386 | "num_filter": "128", 1387 | "num_group": "1", 1388 | "pad": "(0, 0)", 1389 | "stride": "(1, 1)" 1390 | }, 1391 | "inputs": [[112, 0, 0], [113, 0, 0]] 1392 | }, 1393 | { 1394 | "op": "null", 1395 | "name": "mobilenet0_batchnorm14_gamma", 1396 | "attrs": { 1397 | "__dtype__": "0", 1398 | "__init__": "ones", 1399 | "__lr_mult__": "1.0", 1400 | "__shape__": "(128L,)", 1401 | "__storage_type__": "0", 1402 | "__wd_mult__": "1.0" 1403 | }, 1404 | "inputs": [] 1405 | }, 1406 | { 1407 | "op": "null", 1408 | "name": "mobilenet0_batchnorm14_beta", 1409 | "attrs": { 1410 | "__dtype__": "0", 1411 | "__init__": "zeros", 1412 | "__lr_mult__": "1.0", 1413 | "__shape__": "(128L,)", 1414 | "__storage_type__": "0", 1415 | "__wd_mult__": "1.0" 1416 | }, 1417 | "inputs": [] 1418 | }, 1419 | { 1420 | "op": "null", 1421 | "name": "mobilenet0_batchnorm14_running_mean", 1422 | "attrs": { 1423 | "__dtype__": "0", 1424 | "__init__": "zeros", 1425 | "__lr_mult__": "1.0", 1426 | "__shape__": "(128L,)", 1427 | "__storage_type__": "0", 1428 | "__wd_mult__": "1.0" 1429 | }, 1430 | "inputs": [] 1431 | }, 1432 | { 1433 | "op": "null", 1434 | "name": "mobilenet0_batchnorm14_running_var", 1435 | "attrs": { 1436 | "__dtype__": "0", 1437 | "__init__": "ones", 1438 | "__lr_mult__": "1.0", 1439 | "__shape__": "(128L,)", 1440 | "__storage_type__": "0", 1441 | "__wd_mult__": "1.0" 1442 | }, 1443 | "inputs": [] 1444 | }, 1445 | { 1446 | "op": "BatchNorm", 1447 | "name": "mobilenet0_batchnorm14_fwd", 1448 | "attrs": { 1449 | "axis": "1", 1450 | "eps": "1e-05", 1451 | "fix_gamma": "False", 1452 | "momentum": "0.9", 1453 | "use_global_stats": "False" 1454 | }, 1455 | "inputs": [[114, 0, 0], [115, 0, 0], [116, 0, 0], [117, 0, 1], [118, 0, 1]] 1456 | }, 1457 | { 1458 | "op": "Activation", 1459 | "name": "mobilenet0_relu14_fwd", 1460 | "attrs": {"act_type": "relu"}, 1461 | "inputs": [[119, 0, 0]] 1462 | }, 1463 | { 1464 | "op": "null", 1465 | "name": "mobilenet0_conv15_weight", 1466 | "attrs": { 1467 | "__dtype__": "0", 1468 | "__lr_mult__": "1.0", 1469 | "__shape__": "(128L, 1L, 3L, 3L)", 1470 | "__storage_type__": "0", 1471 | "__wd_mult__": "1.0" 1472 | }, 1473 | "inputs": [] 1474 | }, 1475 | { 1476 | "op": "Convolution", 1477 | "name": "mobilenet0_conv15_fwd", 1478 | "attrs": { 1479 | "dilate": "(1, 1)", 1480 | "kernel": "(3, 3)", 1481 | "layout": "NCHW", 1482 | "no_bias": "True", 1483 | "num_filter": "128", 1484 | "num_group": "128", 1485 | "pad": "(1, 1)", 1486 | "stride": "(1, 1)" 1487 | }, 1488 | "inputs": [[120, 0, 0], [121, 0, 0]] 1489 | }, 1490 | { 1491 | "op": "null", 1492 | "name": "mobilenet0_batchnorm15_gamma", 1493 | "attrs": { 1494 | "__dtype__": "0", 1495 | "__init__": "ones", 1496 | "__lr_mult__": "1.0", 1497 | "__shape__": "(128L,)", 1498 | "__storage_type__": "0", 1499 | "__wd_mult__": "1.0" 1500 | }, 1501 | "inputs": [] 1502 | }, 1503 | { 1504 | "op": "null", 1505 | "name": "mobilenet0_batchnorm15_beta", 1506 | "attrs": { 1507 | "__dtype__": "0", 1508 | "__init__": "zeros", 1509 | "__lr_mult__": "1.0", 1510 | "__shape__": "(128L,)", 1511 | "__storage_type__": "0", 1512 | "__wd_mult__": "1.0" 1513 | }, 1514 | "inputs": [] 1515 | }, 1516 | { 1517 | "op": "null", 1518 | "name": "mobilenet0_batchnorm15_running_mean", 1519 | "attrs": { 1520 | "__dtype__": "0", 1521 | "__init__": "zeros", 1522 | "__lr_mult__": "1.0", 1523 | "__shape__": "(128L,)", 1524 | "__storage_type__": "0", 1525 | "__wd_mult__": "1.0" 1526 | }, 1527 | "inputs": [] 1528 | }, 1529 | { 1530 | "op": "null", 1531 | "name": "mobilenet0_batchnorm15_running_var", 1532 | "attrs": { 1533 | "__dtype__": "0", 1534 | "__init__": "ones", 1535 | "__lr_mult__": "1.0", 1536 | "__shape__": "(128L,)", 1537 | "__storage_type__": "0", 1538 | "__wd_mult__": "1.0" 1539 | }, 1540 | "inputs": [] 1541 | }, 1542 | { 1543 | "op": "BatchNorm", 1544 | "name": "mobilenet0_batchnorm15_fwd", 1545 | "attrs": { 1546 | "axis": "1", 1547 | "eps": "1e-05", 1548 | "fix_gamma": "False", 1549 | "momentum": "0.9", 1550 | "use_global_stats": "False" 1551 | }, 1552 | "inputs": [[122, 0, 0], [123, 0, 0], [124, 0, 0], [125, 0, 1], [126, 0, 1]] 1553 | }, 1554 | { 1555 | "op": "Activation", 1556 | "name": "mobilenet0_relu15_fwd", 1557 | "attrs": {"act_type": "relu"}, 1558 | "inputs": [[127, 0, 0]] 1559 | }, 1560 | { 1561 | "op": "null", 1562 | "name": "mobilenet0_conv16_weight", 1563 | "attrs": { 1564 | "__dtype__": "0", 1565 | "__lr_mult__": "1.0", 1566 | "__shape__": "(128L, 128L, 1L, 1L)", 1567 | "__storage_type__": "0", 1568 | "__wd_mult__": "1.0" 1569 | }, 1570 | "inputs": [] 1571 | }, 1572 | { 1573 | "op": "Convolution", 1574 | "name": "mobilenet0_conv16_fwd", 1575 | "attrs": { 1576 | "dilate": "(1, 1)", 1577 | "kernel": "(1, 1)", 1578 | "layout": "NCHW", 1579 | "no_bias": "True", 1580 | "num_filter": "128", 1581 | "num_group": "1", 1582 | "pad": "(0, 0)", 1583 | "stride": "(1, 1)" 1584 | }, 1585 | "inputs": [[128, 0, 0], [129, 0, 0]] 1586 | }, 1587 | { 1588 | "op": "null", 1589 | "name": "mobilenet0_batchnorm16_gamma", 1590 | "attrs": { 1591 | "__dtype__": "0", 1592 | "__init__": "ones", 1593 | "__lr_mult__": "1.0", 1594 | "__shape__": "(128L,)", 1595 | "__storage_type__": "0", 1596 | "__wd_mult__": "1.0" 1597 | }, 1598 | "inputs": [] 1599 | }, 1600 | { 1601 | "op": "null", 1602 | "name": "mobilenet0_batchnorm16_beta", 1603 | "attrs": { 1604 | "__dtype__": "0", 1605 | "__init__": "zeros", 1606 | "__lr_mult__": "1.0", 1607 | "__shape__": "(128L,)", 1608 | "__storage_type__": "0", 1609 | "__wd_mult__": "1.0" 1610 | }, 1611 | "inputs": [] 1612 | }, 1613 | { 1614 | "op": "null", 1615 | "name": "mobilenet0_batchnorm16_running_mean", 1616 | "attrs": { 1617 | "__dtype__": "0", 1618 | "__init__": "zeros", 1619 | "__lr_mult__": "1.0", 1620 | "__shape__": "(128L,)", 1621 | "__storage_type__": "0", 1622 | "__wd_mult__": "1.0" 1623 | }, 1624 | "inputs": [] 1625 | }, 1626 | { 1627 | "op": "null", 1628 | "name": "mobilenet0_batchnorm16_running_var", 1629 | "attrs": { 1630 | "__dtype__": "0", 1631 | "__init__": "ones", 1632 | "__lr_mult__": "1.0", 1633 | "__shape__": "(128L,)", 1634 | "__storage_type__": "0", 1635 | "__wd_mult__": "1.0" 1636 | }, 1637 | "inputs": [] 1638 | }, 1639 | { 1640 | "op": "BatchNorm", 1641 | "name": "mobilenet0_batchnorm16_fwd", 1642 | "attrs": { 1643 | "axis": "1", 1644 | "eps": "1e-05", 1645 | "fix_gamma": "False", 1646 | "momentum": "0.9", 1647 | "use_global_stats": "False" 1648 | }, 1649 | "inputs": [[130, 0, 0], [131, 0, 0], [132, 0, 0], [133, 0, 1], [134, 0, 1]] 1650 | }, 1651 | { 1652 | "op": "Activation", 1653 | "name": "mobilenet0_relu16_fwd", 1654 | "attrs": {"act_type": "relu"}, 1655 | "inputs": [[135, 0, 0]] 1656 | }, 1657 | { 1658 | "op": "null", 1659 | "name": "mobilenet0_conv17_weight", 1660 | "attrs": { 1661 | "__dtype__": "0", 1662 | "__lr_mult__": "1.0", 1663 | "__shape__": "(128L, 1L, 3L, 3L)", 1664 | "__storage_type__": "0", 1665 | "__wd_mult__": "1.0" 1666 | }, 1667 | "inputs": [] 1668 | }, 1669 | { 1670 | "op": "Convolution", 1671 | "name": "mobilenet0_conv17_fwd", 1672 | "attrs": { 1673 | "dilate": "(1, 1)", 1674 | "kernel": "(3, 3)", 1675 | "layout": "NCHW", 1676 | "no_bias": "True", 1677 | "num_filter": "128", 1678 | "num_group": "128", 1679 | "pad": "(1, 1)", 1680 | "stride": "(1, 1)" 1681 | }, 1682 | "inputs": [[136, 0, 0], [137, 0, 0]] 1683 | }, 1684 | { 1685 | "op": "null", 1686 | "name": "mobilenet0_batchnorm17_gamma", 1687 | "attrs": { 1688 | "__dtype__": "0", 1689 | "__init__": "ones", 1690 | "__lr_mult__": "1.0", 1691 | "__shape__": "(128L,)", 1692 | "__storage_type__": "0", 1693 | "__wd_mult__": "1.0" 1694 | }, 1695 | "inputs": [] 1696 | }, 1697 | { 1698 | "op": "null", 1699 | "name": "mobilenet0_batchnorm17_beta", 1700 | "attrs": { 1701 | "__dtype__": "0", 1702 | "__init__": "zeros", 1703 | "__lr_mult__": "1.0", 1704 | "__shape__": "(128L,)", 1705 | "__storage_type__": "0", 1706 | "__wd_mult__": "1.0" 1707 | }, 1708 | "inputs": [] 1709 | }, 1710 | { 1711 | "op": "null", 1712 | "name": "mobilenet0_batchnorm17_running_mean", 1713 | "attrs": { 1714 | "__dtype__": "0", 1715 | "__init__": "zeros", 1716 | "__lr_mult__": "1.0", 1717 | "__shape__": "(128L,)", 1718 | "__storage_type__": "0", 1719 | "__wd_mult__": "1.0" 1720 | }, 1721 | "inputs": [] 1722 | }, 1723 | { 1724 | "op": "null", 1725 | "name": "mobilenet0_batchnorm17_running_var", 1726 | "attrs": { 1727 | "__dtype__": "0", 1728 | "__init__": "ones", 1729 | "__lr_mult__": "1.0", 1730 | "__shape__": "(128L,)", 1731 | "__storage_type__": "0", 1732 | "__wd_mult__": "1.0" 1733 | }, 1734 | "inputs": [] 1735 | }, 1736 | { 1737 | "op": "BatchNorm", 1738 | "name": "mobilenet0_batchnorm17_fwd", 1739 | "attrs": { 1740 | "axis": "1", 1741 | "eps": "1e-05", 1742 | "fix_gamma": "False", 1743 | "momentum": "0.9", 1744 | "use_global_stats": "False" 1745 | }, 1746 | "inputs": [[138, 0, 0], [139, 0, 0], [140, 0, 0], [141, 0, 1], [142, 0, 1]] 1747 | }, 1748 | { 1749 | "op": "Activation", 1750 | "name": "mobilenet0_relu17_fwd", 1751 | "attrs": {"act_type": "relu"}, 1752 | "inputs": [[143, 0, 0]] 1753 | }, 1754 | { 1755 | "op": "null", 1756 | "name": "mobilenet0_conv18_weight", 1757 | "attrs": { 1758 | "__dtype__": "0", 1759 | "__lr_mult__": "1.0", 1760 | "__shape__": "(128L, 128L, 1L, 1L)", 1761 | "__storage_type__": "0", 1762 | "__wd_mult__": "1.0" 1763 | }, 1764 | "inputs": [] 1765 | }, 1766 | { 1767 | "op": "Convolution", 1768 | "name": "mobilenet0_conv18_fwd", 1769 | "attrs": { 1770 | "dilate": "(1, 1)", 1771 | "kernel": "(1, 1)", 1772 | "layout": "NCHW", 1773 | "no_bias": "True", 1774 | "num_filter": "128", 1775 | "num_group": "1", 1776 | "pad": "(0, 0)", 1777 | "stride": "(1, 1)" 1778 | }, 1779 | "inputs": [[144, 0, 0], [145, 0, 0]] 1780 | }, 1781 | { 1782 | "op": "null", 1783 | "name": "mobilenet0_batchnorm18_gamma", 1784 | "attrs": { 1785 | "__dtype__": "0", 1786 | "__init__": "ones", 1787 | "__lr_mult__": "1.0", 1788 | "__shape__": "(128L,)", 1789 | "__storage_type__": "0", 1790 | "__wd_mult__": "1.0" 1791 | }, 1792 | "inputs": [] 1793 | }, 1794 | { 1795 | "op": "null", 1796 | "name": "mobilenet0_batchnorm18_beta", 1797 | "attrs": { 1798 | "__dtype__": "0", 1799 | "__init__": "zeros", 1800 | "__lr_mult__": "1.0", 1801 | "__shape__": "(128L,)", 1802 | "__storage_type__": "0", 1803 | "__wd_mult__": "1.0" 1804 | }, 1805 | "inputs": [] 1806 | }, 1807 | { 1808 | "op": "null", 1809 | "name": "mobilenet0_batchnorm18_running_mean", 1810 | "attrs": { 1811 | "__dtype__": "0", 1812 | "__init__": "zeros", 1813 | "__lr_mult__": "1.0", 1814 | "__shape__": "(128L,)", 1815 | "__storage_type__": "0", 1816 | "__wd_mult__": "1.0" 1817 | }, 1818 | "inputs": [] 1819 | }, 1820 | { 1821 | "op": "null", 1822 | "name": "mobilenet0_batchnorm18_running_var", 1823 | "attrs": { 1824 | "__dtype__": "0", 1825 | "__init__": "ones", 1826 | "__lr_mult__": "1.0", 1827 | "__shape__": "(128L,)", 1828 | "__storage_type__": "0", 1829 | "__wd_mult__": "1.0" 1830 | }, 1831 | "inputs": [] 1832 | }, 1833 | { 1834 | "op": "BatchNorm", 1835 | "name": "mobilenet0_batchnorm18_fwd", 1836 | "attrs": { 1837 | "axis": "1", 1838 | "eps": "1e-05", 1839 | "fix_gamma": "False", 1840 | "momentum": "0.9", 1841 | "use_global_stats": "False" 1842 | }, 1843 | "inputs": [[146, 0, 0], [147, 0, 0], [148, 0, 0], [149, 0, 1], [150, 0, 1]] 1844 | }, 1845 | { 1846 | "op": "Activation", 1847 | "name": "mobilenet0_relu18_fwd", 1848 | "attrs": {"act_type": "relu"}, 1849 | "inputs": [[151, 0, 0]] 1850 | }, 1851 | { 1852 | "op": "null", 1853 | "name": "mobilenet0_conv19_weight", 1854 | "attrs": { 1855 | "__dtype__": "0", 1856 | "__lr_mult__": "1.0", 1857 | "__shape__": "(128L, 1L, 3L, 3L)", 1858 | "__storage_type__": "0", 1859 | "__wd_mult__": "1.0" 1860 | }, 1861 | "inputs": [] 1862 | }, 1863 | { 1864 | "op": "Convolution", 1865 | "name": "mobilenet0_conv19_fwd", 1866 | "attrs": { 1867 | "dilate": "(1, 1)", 1868 | "kernel": "(3, 3)", 1869 | "layout": "NCHW", 1870 | "no_bias": "True", 1871 | "num_filter": "128", 1872 | "num_group": "128", 1873 | "pad": "(1, 1)", 1874 | "stride": "(1, 1)" 1875 | }, 1876 | "inputs": [[152, 0, 0], [153, 0, 0]] 1877 | }, 1878 | { 1879 | "op": "null", 1880 | "name": "mobilenet0_batchnorm19_gamma", 1881 | "attrs": { 1882 | "__dtype__": "0", 1883 | "__init__": "ones", 1884 | "__lr_mult__": "1.0", 1885 | "__shape__": "(128L,)", 1886 | "__storage_type__": "0", 1887 | "__wd_mult__": "1.0" 1888 | }, 1889 | "inputs": [] 1890 | }, 1891 | { 1892 | "op": "null", 1893 | "name": "mobilenet0_batchnorm19_beta", 1894 | "attrs": { 1895 | "__dtype__": "0", 1896 | "__init__": "zeros", 1897 | "__lr_mult__": "1.0", 1898 | "__shape__": "(128L,)", 1899 | "__storage_type__": "0", 1900 | "__wd_mult__": "1.0" 1901 | }, 1902 | "inputs": [] 1903 | }, 1904 | { 1905 | "op": "null", 1906 | "name": "mobilenet0_batchnorm19_running_mean", 1907 | "attrs": { 1908 | "__dtype__": "0", 1909 | "__init__": "zeros", 1910 | "__lr_mult__": "1.0", 1911 | "__shape__": "(128L,)", 1912 | "__storage_type__": "0", 1913 | "__wd_mult__": "1.0" 1914 | }, 1915 | "inputs": [] 1916 | }, 1917 | { 1918 | "op": "null", 1919 | "name": "mobilenet0_batchnorm19_running_var", 1920 | "attrs": { 1921 | "__dtype__": "0", 1922 | "__init__": "ones", 1923 | "__lr_mult__": "1.0", 1924 | "__shape__": "(128L,)", 1925 | "__storage_type__": "0", 1926 | "__wd_mult__": "1.0" 1927 | }, 1928 | "inputs": [] 1929 | }, 1930 | { 1931 | "op": "BatchNorm", 1932 | "name": "mobilenet0_batchnorm19_fwd", 1933 | "attrs": { 1934 | "axis": "1", 1935 | "eps": "1e-05", 1936 | "fix_gamma": "False", 1937 | "momentum": "0.9", 1938 | "use_global_stats": "False" 1939 | }, 1940 | "inputs": [[154, 0, 0], [155, 0, 0], [156, 0, 0], [157, 0, 1], [158, 0, 1]] 1941 | }, 1942 | { 1943 | "op": "Activation", 1944 | "name": "mobilenet0_relu19_fwd", 1945 | "attrs": {"act_type": "relu"}, 1946 | "inputs": [[159, 0, 0]] 1947 | }, 1948 | { 1949 | "op": "null", 1950 | "name": "mobilenet0_conv20_weight", 1951 | "attrs": { 1952 | "__dtype__": "0", 1953 | "__lr_mult__": "1.0", 1954 | "__shape__": "(128L, 128L, 1L, 1L)", 1955 | "__storage_type__": "0", 1956 | "__wd_mult__": "1.0" 1957 | }, 1958 | "inputs": [] 1959 | }, 1960 | { 1961 | "op": "Convolution", 1962 | "name": "mobilenet0_conv20_fwd", 1963 | "attrs": { 1964 | "dilate": "(1, 1)", 1965 | "kernel": "(1, 1)", 1966 | "layout": "NCHW", 1967 | "no_bias": "True", 1968 | "num_filter": "128", 1969 | "num_group": "1", 1970 | "pad": "(0, 0)", 1971 | "stride": "(1, 1)" 1972 | }, 1973 | "inputs": [[160, 0, 0], [161, 0, 0]] 1974 | }, 1975 | { 1976 | "op": "null", 1977 | "name": "mobilenet0_batchnorm20_gamma", 1978 | "attrs": { 1979 | "__dtype__": "0", 1980 | "__init__": "ones", 1981 | "__lr_mult__": "1.0", 1982 | "__shape__": "(128L,)", 1983 | "__storage_type__": "0", 1984 | "__wd_mult__": "1.0" 1985 | }, 1986 | "inputs": [] 1987 | }, 1988 | { 1989 | "op": "null", 1990 | "name": "mobilenet0_batchnorm20_beta", 1991 | "attrs": { 1992 | "__dtype__": "0", 1993 | "__init__": "zeros", 1994 | "__lr_mult__": "1.0", 1995 | "__shape__": "(128L,)", 1996 | "__storage_type__": "0", 1997 | "__wd_mult__": "1.0" 1998 | }, 1999 | "inputs": [] 2000 | }, 2001 | { 2002 | "op": "null", 2003 | "name": "mobilenet0_batchnorm20_running_mean", 2004 | "attrs": { 2005 | "__dtype__": "0", 2006 | "__init__": "zeros", 2007 | "__lr_mult__": "1.0", 2008 | "__shape__": "(128L,)", 2009 | "__storage_type__": "0", 2010 | "__wd_mult__": "1.0" 2011 | }, 2012 | "inputs": [] 2013 | }, 2014 | { 2015 | "op": "null", 2016 | "name": "mobilenet0_batchnorm20_running_var", 2017 | "attrs": { 2018 | "__dtype__": "0", 2019 | "__init__": "ones", 2020 | "__lr_mult__": "1.0", 2021 | "__shape__": "(128L,)", 2022 | "__storage_type__": "0", 2023 | "__wd_mult__": "1.0" 2024 | }, 2025 | "inputs": [] 2026 | }, 2027 | { 2028 | "op": "BatchNorm", 2029 | "name": "mobilenet0_batchnorm20_fwd", 2030 | "attrs": { 2031 | "axis": "1", 2032 | "eps": "1e-05", 2033 | "fix_gamma": "False", 2034 | "momentum": "0.9", 2035 | "use_global_stats": "False" 2036 | }, 2037 | "inputs": [[162, 0, 0], [163, 0, 0], [164, 0, 0], [165, 0, 1], [166, 0, 1]] 2038 | }, 2039 | { 2040 | "op": "Activation", 2041 | "name": "mobilenet0_relu20_fwd", 2042 | "attrs": {"act_type": "relu"}, 2043 | "inputs": [[167, 0, 0]] 2044 | }, 2045 | { 2046 | "op": "null", 2047 | "name": "mobilenet0_conv21_weight", 2048 | "attrs": { 2049 | "__dtype__": "0", 2050 | "__lr_mult__": "1.0", 2051 | "__shape__": "(128L, 1L, 3L, 3L)", 2052 | "__storage_type__": "0", 2053 | "__wd_mult__": "1.0" 2054 | }, 2055 | "inputs": [] 2056 | }, 2057 | { 2058 | "op": "Convolution", 2059 | "name": "mobilenet0_conv21_fwd", 2060 | "attrs": { 2061 | "dilate": "(1, 1)", 2062 | "kernel": "(3, 3)", 2063 | "layout": "NCHW", 2064 | "no_bias": "True", 2065 | "num_filter": "128", 2066 | "num_group": "128", 2067 | "pad": "(1, 1)", 2068 | "stride": "(1, 1)" 2069 | }, 2070 | "inputs": [[168, 0, 0], [169, 0, 0]] 2071 | }, 2072 | { 2073 | "op": "null", 2074 | "name": "mobilenet0_batchnorm21_gamma", 2075 | "attrs": { 2076 | "__dtype__": "0", 2077 | "__init__": "ones", 2078 | "__lr_mult__": "1.0", 2079 | "__shape__": "(128L,)", 2080 | "__storage_type__": "0", 2081 | "__wd_mult__": "1.0" 2082 | }, 2083 | "inputs": [] 2084 | }, 2085 | { 2086 | "op": "null", 2087 | "name": "mobilenet0_batchnorm21_beta", 2088 | "attrs": { 2089 | "__dtype__": "0", 2090 | "__init__": "zeros", 2091 | "__lr_mult__": "1.0", 2092 | "__shape__": "(128L,)", 2093 | "__storage_type__": "0", 2094 | "__wd_mult__": "1.0" 2095 | }, 2096 | "inputs": [] 2097 | }, 2098 | { 2099 | "op": "null", 2100 | "name": "mobilenet0_batchnorm21_running_mean", 2101 | "attrs": { 2102 | "__dtype__": "0", 2103 | "__init__": "zeros", 2104 | "__lr_mult__": "1.0", 2105 | "__shape__": "(128L,)", 2106 | "__storage_type__": "0", 2107 | "__wd_mult__": "1.0" 2108 | }, 2109 | "inputs": [] 2110 | }, 2111 | { 2112 | "op": "null", 2113 | "name": "mobilenet0_batchnorm21_running_var", 2114 | "attrs": { 2115 | "__dtype__": "0", 2116 | "__init__": "ones", 2117 | "__lr_mult__": "1.0", 2118 | "__shape__": "(128L,)", 2119 | "__storage_type__": "0", 2120 | "__wd_mult__": "1.0" 2121 | }, 2122 | "inputs": [] 2123 | }, 2124 | { 2125 | "op": "BatchNorm", 2126 | "name": "mobilenet0_batchnorm21_fwd", 2127 | "attrs": { 2128 | "axis": "1", 2129 | "eps": "1e-05", 2130 | "fix_gamma": "False", 2131 | "momentum": "0.9", 2132 | "use_global_stats": "False" 2133 | }, 2134 | "inputs": [[170, 0, 0], [171, 0, 0], [172, 0, 0], [173, 0, 1], [174, 0, 1]] 2135 | }, 2136 | { 2137 | "op": "Activation", 2138 | "name": "mobilenet0_relu21_fwd", 2139 | "attrs": {"act_type": "relu"}, 2140 | "inputs": [[175, 0, 0]] 2141 | }, 2142 | { 2143 | "op": "null", 2144 | "name": "mobilenet0_conv22_weight", 2145 | "attrs": { 2146 | "__dtype__": "0", 2147 | "__lr_mult__": "1.0", 2148 | "__shape__": "(128L, 128L, 1L, 1L)", 2149 | "__storage_type__": "0", 2150 | "__wd_mult__": "1.0" 2151 | }, 2152 | "inputs": [] 2153 | }, 2154 | { 2155 | "op": "Convolution", 2156 | "name": "mobilenet0_conv22_fwd", 2157 | "attrs": { 2158 | "dilate": "(1, 1)", 2159 | "kernel": "(1, 1)", 2160 | "layout": "NCHW", 2161 | "no_bias": "True", 2162 | "num_filter": "128", 2163 | "num_group": "1", 2164 | "pad": "(0, 0)", 2165 | "stride": "(1, 1)" 2166 | }, 2167 | "inputs": [[176, 0, 0], [177, 0, 0]] 2168 | }, 2169 | { 2170 | "op": "null", 2171 | "name": "mobilenet0_batchnorm22_gamma", 2172 | "attrs": { 2173 | "__dtype__": "0", 2174 | "__init__": "ones", 2175 | "__lr_mult__": "1.0", 2176 | "__shape__": "(128L,)", 2177 | "__storage_type__": "0", 2178 | "__wd_mult__": "1.0" 2179 | }, 2180 | "inputs": [] 2181 | }, 2182 | { 2183 | "op": "null", 2184 | "name": "mobilenet0_batchnorm22_beta", 2185 | "attrs": { 2186 | "__dtype__": "0", 2187 | "__init__": "zeros", 2188 | "__lr_mult__": "1.0", 2189 | "__shape__": "(128L,)", 2190 | "__storage_type__": "0", 2191 | "__wd_mult__": "1.0" 2192 | }, 2193 | "inputs": [] 2194 | }, 2195 | { 2196 | "op": "null", 2197 | "name": "mobilenet0_batchnorm22_running_mean", 2198 | "attrs": { 2199 | "__dtype__": "0", 2200 | "__init__": "zeros", 2201 | "__lr_mult__": "1.0", 2202 | "__shape__": "(128L,)", 2203 | "__storage_type__": "0", 2204 | "__wd_mult__": "1.0" 2205 | }, 2206 | "inputs": [] 2207 | }, 2208 | { 2209 | "op": "null", 2210 | "name": "mobilenet0_batchnorm22_running_var", 2211 | "attrs": { 2212 | "__dtype__": "0", 2213 | "__init__": "ones", 2214 | "__lr_mult__": "1.0", 2215 | "__shape__": "(128L,)", 2216 | "__storage_type__": "0", 2217 | "__wd_mult__": "1.0" 2218 | }, 2219 | "inputs": [] 2220 | }, 2221 | { 2222 | "op": "BatchNorm", 2223 | "name": "mobilenet0_batchnorm22_fwd", 2224 | "attrs": { 2225 | "axis": "1", 2226 | "eps": "1e-05", 2227 | "fix_gamma": "False", 2228 | "momentum": "0.9", 2229 | "use_global_stats": "False" 2230 | }, 2231 | "inputs": [[178, 0, 0], [179, 0, 0], [180, 0, 0], [181, 0, 1], [182, 0, 1]] 2232 | }, 2233 | { 2234 | "op": "Activation", 2235 | "name": "mobilenet0_relu22_fwd", 2236 | "attrs": {"act_type": "relu"}, 2237 | "inputs": [[183, 0, 0]] 2238 | }, 2239 | { 2240 | "op": "null", 2241 | "name": "mobilenet0_conv23_weight", 2242 | "attrs": { 2243 | "__dtype__": "0", 2244 | "__lr_mult__": "1.0", 2245 | "__shape__": "(128L, 1L, 3L, 3L)", 2246 | "__storage_type__": "0", 2247 | "__wd_mult__": "1.0" 2248 | }, 2249 | "inputs": [] 2250 | }, 2251 | { 2252 | "op": "Convolution", 2253 | "name": "mobilenet0_conv23_fwd", 2254 | "attrs": { 2255 | "dilate": "(1, 1)", 2256 | "kernel": "(3, 3)", 2257 | "layout": "NCHW", 2258 | "no_bias": "True", 2259 | "num_filter": "128", 2260 | "num_group": "128", 2261 | "pad": "(1, 1)", 2262 | "stride": "(2, 2)" 2263 | }, 2264 | "inputs": [[184, 0, 0], [185, 0, 0]] 2265 | }, 2266 | { 2267 | "op": "null", 2268 | "name": "mobilenet0_batchnorm23_gamma", 2269 | "attrs": { 2270 | "__dtype__": "0", 2271 | "__init__": "ones", 2272 | "__lr_mult__": "1.0", 2273 | "__shape__": "(128L,)", 2274 | "__storage_type__": "0", 2275 | "__wd_mult__": "1.0" 2276 | }, 2277 | "inputs": [] 2278 | }, 2279 | { 2280 | "op": "null", 2281 | "name": "mobilenet0_batchnorm23_beta", 2282 | "attrs": { 2283 | "__dtype__": "0", 2284 | "__init__": "zeros", 2285 | "__lr_mult__": "1.0", 2286 | "__shape__": "(128L,)", 2287 | "__storage_type__": "0", 2288 | "__wd_mult__": "1.0" 2289 | }, 2290 | "inputs": [] 2291 | }, 2292 | { 2293 | "op": "null", 2294 | "name": "mobilenet0_batchnorm23_running_mean", 2295 | "attrs": { 2296 | "__dtype__": "0", 2297 | "__init__": "zeros", 2298 | "__lr_mult__": "1.0", 2299 | "__shape__": "(128L,)", 2300 | "__storage_type__": "0", 2301 | "__wd_mult__": "1.0" 2302 | }, 2303 | "inputs": [] 2304 | }, 2305 | { 2306 | "op": "null", 2307 | "name": "mobilenet0_batchnorm23_running_var", 2308 | "attrs": { 2309 | "__dtype__": "0", 2310 | "__init__": "ones", 2311 | "__lr_mult__": "1.0", 2312 | "__shape__": "(128L,)", 2313 | "__storage_type__": "0", 2314 | "__wd_mult__": "1.0" 2315 | }, 2316 | "inputs": [] 2317 | }, 2318 | { 2319 | "op": "BatchNorm", 2320 | "name": "mobilenet0_batchnorm23_fwd", 2321 | "attrs": { 2322 | "axis": "1", 2323 | "eps": "1e-05", 2324 | "fix_gamma": "False", 2325 | "momentum": "0.9", 2326 | "use_global_stats": "False" 2327 | }, 2328 | "inputs": [[186, 0, 0], [187, 0, 0], [188, 0, 0], [189, 0, 1], [190, 0, 1]] 2329 | }, 2330 | { 2331 | "op": "Activation", 2332 | "name": "mobilenet0_relu23_fwd", 2333 | "attrs": {"act_type": "relu"}, 2334 | "inputs": [[191, 0, 0]] 2335 | }, 2336 | { 2337 | "op": "null", 2338 | "name": "mobilenet0_conv24_weight", 2339 | "attrs": { 2340 | "__dtype__": "0", 2341 | "__lr_mult__": "1.0", 2342 | "__shape__": "(256L, 128L, 1L, 1L)", 2343 | "__storage_type__": "0", 2344 | "__wd_mult__": "1.0" 2345 | }, 2346 | "inputs": [] 2347 | }, 2348 | { 2349 | "op": "Convolution", 2350 | "name": "mobilenet0_conv24_fwd", 2351 | "attrs": { 2352 | "dilate": "(1, 1)", 2353 | "kernel": "(1, 1)", 2354 | "layout": "NCHW", 2355 | "no_bias": "True", 2356 | "num_filter": "256", 2357 | "num_group": "1", 2358 | "pad": "(0, 0)", 2359 | "stride": "(1, 1)" 2360 | }, 2361 | "inputs": [[192, 0, 0], [193, 0, 0]] 2362 | }, 2363 | { 2364 | "op": "null", 2365 | "name": "mobilenet0_batchnorm24_gamma", 2366 | "attrs": { 2367 | "__dtype__": "0", 2368 | "__init__": "ones", 2369 | "__lr_mult__": "1.0", 2370 | "__shape__": "(256L,)", 2371 | "__storage_type__": "0", 2372 | "__wd_mult__": "1.0" 2373 | }, 2374 | "inputs": [] 2375 | }, 2376 | { 2377 | "op": "null", 2378 | "name": "mobilenet0_batchnorm24_beta", 2379 | "attrs": { 2380 | "__dtype__": "0", 2381 | "__init__": "zeros", 2382 | "__lr_mult__": "1.0", 2383 | "__shape__": "(256L,)", 2384 | "__storage_type__": "0", 2385 | "__wd_mult__": "1.0" 2386 | }, 2387 | "inputs": [] 2388 | }, 2389 | { 2390 | "op": "null", 2391 | "name": "mobilenet0_batchnorm24_running_mean", 2392 | "attrs": { 2393 | "__dtype__": "0", 2394 | "__init__": "zeros", 2395 | "__lr_mult__": "1.0", 2396 | "__shape__": "(256L,)", 2397 | "__storage_type__": "0", 2398 | "__wd_mult__": "1.0" 2399 | }, 2400 | "inputs": [] 2401 | }, 2402 | { 2403 | "op": "null", 2404 | "name": "mobilenet0_batchnorm24_running_var", 2405 | "attrs": { 2406 | "__dtype__": "0", 2407 | "__init__": "ones", 2408 | "__lr_mult__": "1.0", 2409 | "__shape__": "(256L,)", 2410 | "__storage_type__": "0", 2411 | "__wd_mult__": "1.0" 2412 | }, 2413 | "inputs": [] 2414 | }, 2415 | { 2416 | "op": "BatchNorm", 2417 | "name": "mobilenet0_batchnorm24_fwd", 2418 | "attrs": { 2419 | "axis": "1", 2420 | "eps": "1e-05", 2421 | "fix_gamma": "False", 2422 | "momentum": "0.9", 2423 | "use_global_stats": "False" 2424 | }, 2425 | "inputs": [[194, 0, 0], [195, 0, 0], [196, 0, 0], [197, 0, 1], [198, 0, 1]] 2426 | }, 2427 | { 2428 | "op": "Activation", 2429 | "name": "mobilenet0_relu24_fwd", 2430 | "attrs": {"act_type": "relu"}, 2431 | "inputs": [[199, 0, 0]] 2432 | }, 2433 | { 2434 | "op": "null", 2435 | "name": "mobilenet0_conv25_weight", 2436 | "attrs": { 2437 | "__dtype__": "0", 2438 | "__lr_mult__": "1.0", 2439 | "__shape__": "(256L, 1L, 3L, 3L)", 2440 | "__storage_type__": "0", 2441 | "__wd_mult__": "1.0" 2442 | }, 2443 | "inputs": [] 2444 | }, 2445 | { 2446 | "op": "Convolution", 2447 | "name": "mobilenet0_conv25_fwd", 2448 | "attrs": { 2449 | "dilate": "(1, 1)", 2450 | "kernel": "(3, 3)", 2451 | "layout": "NCHW", 2452 | "no_bias": "True", 2453 | "num_filter": "256", 2454 | "num_group": "256", 2455 | "pad": "(1, 1)", 2456 | "stride": "(1, 1)" 2457 | }, 2458 | "inputs": [[200, 0, 0], [201, 0, 0]] 2459 | }, 2460 | { 2461 | "op": "null", 2462 | "name": "mobilenet0_batchnorm25_gamma", 2463 | "attrs": { 2464 | "__dtype__": "0", 2465 | "__init__": "ones", 2466 | "__lr_mult__": "1.0", 2467 | "__shape__": "(256L,)", 2468 | "__storage_type__": "0", 2469 | "__wd_mult__": "1.0" 2470 | }, 2471 | "inputs": [] 2472 | }, 2473 | { 2474 | "op": "null", 2475 | "name": "mobilenet0_batchnorm25_beta", 2476 | "attrs": { 2477 | "__dtype__": "0", 2478 | "__init__": "zeros", 2479 | "__lr_mult__": "1.0", 2480 | "__shape__": "(256L,)", 2481 | "__storage_type__": "0", 2482 | "__wd_mult__": "1.0" 2483 | }, 2484 | "inputs": [] 2485 | }, 2486 | { 2487 | "op": "null", 2488 | "name": "mobilenet0_batchnorm25_running_mean", 2489 | "attrs": { 2490 | "__dtype__": "0", 2491 | "__init__": "zeros", 2492 | "__lr_mult__": "1.0", 2493 | "__shape__": "(256L,)", 2494 | "__storage_type__": "0", 2495 | "__wd_mult__": "1.0" 2496 | }, 2497 | "inputs": [] 2498 | }, 2499 | { 2500 | "op": "null", 2501 | "name": "mobilenet0_batchnorm25_running_var", 2502 | "attrs": { 2503 | "__dtype__": "0", 2504 | "__init__": "ones", 2505 | "__lr_mult__": "1.0", 2506 | "__shape__": "(256L,)", 2507 | "__storage_type__": "0", 2508 | "__wd_mult__": "1.0" 2509 | }, 2510 | "inputs": [] 2511 | }, 2512 | { 2513 | "op": "BatchNorm", 2514 | "name": "mobilenet0_batchnorm25_fwd", 2515 | "attrs": { 2516 | "axis": "1", 2517 | "eps": "1e-05", 2518 | "fix_gamma": "False", 2519 | "momentum": "0.9", 2520 | "use_global_stats": "False" 2521 | }, 2522 | "inputs": [[202, 0, 0], [203, 0, 0], [204, 0, 0], [205, 0, 1], [206, 0, 1]] 2523 | }, 2524 | { 2525 | "op": "Activation", 2526 | "name": "mobilenet0_relu25_fwd", 2527 | "attrs": {"act_type": "relu"}, 2528 | "inputs": [[207, 0, 0]] 2529 | }, 2530 | { 2531 | "op": "null", 2532 | "name": "mobilenet0_conv26_weight", 2533 | "attrs": { 2534 | "__dtype__": "0", 2535 | "__lr_mult__": "1.0", 2536 | "__shape__": "(256L, 256L, 1L, 1L)", 2537 | "__storage_type__": "0", 2538 | "__wd_mult__": "1.0" 2539 | }, 2540 | "inputs": [] 2541 | }, 2542 | { 2543 | "op": "Convolution", 2544 | "name": "mobilenet0_conv26_fwd", 2545 | "attrs": { 2546 | "dilate": "(1, 1)", 2547 | "kernel": "(1, 1)", 2548 | "layout": "NCHW", 2549 | "no_bias": "True", 2550 | "num_filter": "256", 2551 | "num_group": "1", 2552 | "pad": "(0, 0)", 2553 | "stride": "(1, 1)" 2554 | }, 2555 | "inputs": [[208, 0, 0], [209, 0, 0]] 2556 | }, 2557 | { 2558 | "op": "null", 2559 | "name": "mobilenet0_batchnorm26_gamma", 2560 | "attrs": { 2561 | "__dtype__": "0", 2562 | "__init__": "ones", 2563 | "__lr_mult__": "1.0", 2564 | "__shape__": "(256L,)", 2565 | "__storage_type__": "0", 2566 | "__wd_mult__": "1.0" 2567 | }, 2568 | "inputs": [] 2569 | }, 2570 | { 2571 | "op": "null", 2572 | "name": "mobilenet0_batchnorm26_beta", 2573 | "attrs": { 2574 | "__dtype__": "0", 2575 | "__init__": "zeros", 2576 | "__lr_mult__": "1.0", 2577 | "__shape__": "(256L,)", 2578 | "__storage_type__": "0", 2579 | "__wd_mult__": "1.0" 2580 | }, 2581 | "inputs": [] 2582 | }, 2583 | { 2584 | "op": "null", 2585 | "name": "mobilenet0_batchnorm26_running_mean", 2586 | "attrs": { 2587 | "__dtype__": "0", 2588 | "__init__": "zeros", 2589 | "__lr_mult__": "1.0", 2590 | "__shape__": "(256L,)", 2591 | "__storage_type__": "0", 2592 | "__wd_mult__": "1.0" 2593 | }, 2594 | "inputs": [] 2595 | }, 2596 | { 2597 | "op": "null", 2598 | "name": "mobilenet0_batchnorm26_running_var", 2599 | "attrs": { 2600 | "__dtype__": "0", 2601 | "__init__": "ones", 2602 | "__lr_mult__": "1.0", 2603 | "__shape__": "(256L,)", 2604 | "__storage_type__": "0", 2605 | "__wd_mult__": "1.0" 2606 | }, 2607 | "inputs": [] 2608 | }, 2609 | { 2610 | "op": "BatchNorm", 2611 | "name": "mobilenet0_batchnorm26_fwd", 2612 | "attrs": { 2613 | "axis": "1", 2614 | "eps": "1e-05", 2615 | "fix_gamma": "False", 2616 | "momentum": "0.9", 2617 | "use_global_stats": "False" 2618 | }, 2619 | "inputs": [[210, 0, 0], [211, 0, 0], [212, 0, 0], [213, 0, 1], [214, 0, 1]] 2620 | }, 2621 | { 2622 | "op": "Activation", 2623 | "name": "mobilenet0_relu26_fwd", 2624 | "attrs": {"act_type": "relu"}, 2625 | "inputs": [[215, 0, 0]] 2626 | }, 2627 | { 2628 | "op": "null", 2629 | "name": "rf_c3_lateral_weight", 2630 | "attrs": { 2631 | "__init__": "[\"normal\", {\"sigma\": 0.01}]", 2632 | "__lr_mult__": "1.0" 2633 | }, 2634 | "inputs": [] 2635 | }, 2636 | { 2637 | "op": "null", 2638 | "name": "rf_c3_lateral_bias", 2639 | "attrs": { 2640 | "__init__": "[\"constant\", {\"value\": 0.0}]", 2641 | "__lr_mult__": "2.0", 2642 | "__wd_mult__": "1.0" 2643 | }, 2644 | "inputs": [] 2645 | }, 2646 | { 2647 | "op": "Convolution", 2648 | "name": "rf_c3_lateral", 2649 | "attrs": { 2650 | "kernel": "(1, 1)", 2651 | "num_filter": "64", 2652 | "pad": "(0, 0)", 2653 | "stride": "(1, 1)" 2654 | }, 2655 | "inputs": [[216, 0, 0], [217, 0, 0], [218, 0, 0]] 2656 | }, 2657 | { 2658 | "op": "null", 2659 | "name": "rf_c3_lateral_bn_gamma", 2660 | "attrs": { 2661 | "eps": "2e-05", 2662 | "fix_gamma": "False", 2663 | "momentum": "0.9" 2664 | }, 2665 | "inputs": [] 2666 | }, 2667 | { 2668 | "op": "null", 2669 | "name": "rf_c3_lateral_bn_beta", 2670 | "attrs": { 2671 | "eps": "2e-05", 2672 | "fix_gamma": "False", 2673 | "momentum": "0.9" 2674 | }, 2675 | "inputs": [] 2676 | }, 2677 | { 2678 | "op": "null", 2679 | "name": "rf_c3_lateral_bn_moving_mean", 2680 | "attrs": { 2681 | "__init__": "[\"zero\", {}]", 2682 | "eps": "2e-05", 2683 | "fix_gamma": "False", 2684 | "momentum": "0.9" 2685 | }, 2686 | "inputs": [] 2687 | }, 2688 | { 2689 | "op": "null", 2690 | "name": "rf_c3_lateral_bn_moving_var", 2691 | "attrs": { 2692 | "__init__": "[\"one\", {}]", 2693 | "eps": "2e-05", 2694 | "fix_gamma": "False", 2695 | "momentum": "0.9" 2696 | }, 2697 | "inputs": [] 2698 | }, 2699 | { 2700 | "op": "BatchNorm", 2701 | "name": "rf_c3_lateral_bn", 2702 | "attrs": { 2703 | "eps": "2e-05", 2704 | "fix_gamma": "False", 2705 | "momentum": "0.9" 2706 | }, 2707 | "inputs": [[219, 0, 0], [220, 0, 0], [221, 0, 0], [222, 0, 1], [223, 0, 1]] 2708 | }, 2709 | { 2710 | "op": "Activation", 2711 | "name": "rf_c3_lateral_relu", 2712 | "attrs": {"act_type": "relu"}, 2713 | "inputs": [[224, 0, 0]] 2714 | }, 2715 | { 2716 | "op": "null", 2717 | "name": "rf_c3_det_conv1_weight", 2718 | "attrs": { 2719 | "__init__": "[\"normal\", {\"sigma\": 0.01}]", 2720 | "__lr_mult__": "1.0" 2721 | }, 2722 | "inputs": [] 2723 | }, 2724 | { 2725 | "op": "null", 2726 | "name": "rf_c3_det_conv1_bias", 2727 | "attrs": { 2728 | "__init__": "[\"constant\", {\"value\": 0.0}]", 2729 | "__lr_mult__": "2.0", 2730 | "__wd_mult__": "0.0" 2731 | }, 2732 | "inputs": [] 2733 | }, 2734 | { 2735 | "op": "Convolution", 2736 | "name": "rf_c3_det_conv1", 2737 | "attrs": { 2738 | "kernel": "(3, 3)", 2739 | "num_filter": "32", 2740 | "pad": "(1, 1)", 2741 | "stride": "(1, 1)" 2742 | }, 2743 | "inputs": [[225, 0, 0], [226, 0, 0], [227, 0, 0]] 2744 | }, 2745 | { 2746 | "op": "null", 2747 | "name": "rf_c3_det_conv1_bn_gamma", 2748 | "attrs": { 2749 | "eps": "2e-05", 2750 | "fix_gamma": "False", 2751 | "momentum": "0.9" 2752 | }, 2753 | "inputs": [] 2754 | }, 2755 | { 2756 | "op": "null", 2757 | "name": "rf_c3_det_conv1_bn_beta", 2758 | "attrs": { 2759 | "eps": "2e-05", 2760 | "fix_gamma": "False", 2761 | "momentum": "0.9" 2762 | }, 2763 | "inputs": [] 2764 | }, 2765 | { 2766 | "op": "null", 2767 | "name": "rf_c3_det_conv1_bn_moving_mean", 2768 | "attrs": { 2769 | "__init__": "[\"zero\", {}]", 2770 | "eps": "2e-05", 2771 | "fix_gamma": "False", 2772 | "momentum": "0.9" 2773 | }, 2774 | "inputs": [] 2775 | }, 2776 | { 2777 | "op": "null", 2778 | "name": "rf_c3_det_conv1_bn_moving_var", 2779 | "attrs": { 2780 | "__init__": "[\"one\", {}]", 2781 | "eps": "2e-05", 2782 | "fix_gamma": "False", 2783 | "momentum": "0.9" 2784 | }, 2785 | "inputs": [] 2786 | }, 2787 | { 2788 | "op": "BatchNorm", 2789 | "name": "rf_c3_det_conv1_bn", 2790 | "attrs": { 2791 | "eps": "2e-05", 2792 | "fix_gamma": "False", 2793 | "momentum": "0.9" 2794 | }, 2795 | "inputs": [[228, 0, 0], [229, 0, 0], [230, 0, 0], [231, 0, 1], [232, 0, 1]] 2796 | }, 2797 | { 2798 | "op": "null", 2799 | "name": "rf_c3_det_context_conv1_weight", 2800 | "attrs": { 2801 | "__init__": "[\"normal\", {\"sigma\": 0.01}]", 2802 | "__lr_mult__": "1.0" 2803 | }, 2804 | "inputs": [] 2805 | }, 2806 | { 2807 | "op": "null", 2808 | "name": "rf_c3_det_context_conv1_bias", 2809 | "attrs": { 2810 | "__init__": "[\"constant\", {\"value\": 0.0}]", 2811 | "__lr_mult__": "2.0", 2812 | "__wd_mult__": "0.0" 2813 | }, 2814 | "inputs": [] 2815 | }, 2816 | { 2817 | "op": "Convolution", 2818 | "name": "rf_c3_det_context_conv1", 2819 | "attrs": { 2820 | "kernel": "(3, 3)", 2821 | "num_filter": "16", 2822 | "pad": "(1, 1)", 2823 | "stride": "(1, 1)" 2824 | }, 2825 | "inputs": [[225, 0, 0], [234, 0, 0], [235, 0, 0]] 2826 | }, 2827 | { 2828 | "op": "null", 2829 | "name": "rf_c3_det_context_conv1_bn_gamma", 2830 | "attrs": { 2831 | "eps": "2e-05", 2832 | "fix_gamma": "False", 2833 | "momentum": "0.9" 2834 | }, 2835 | "inputs": [] 2836 | }, 2837 | { 2838 | "op": "null", 2839 | "name": "rf_c3_det_context_conv1_bn_beta", 2840 | "attrs": { 2841 | "eps": "2e-05", 2842 | "fix_gamma": "False", 2843 | "momentum": "0.9" 2844 | }, 2845 | "inputs": [] 2846 | }, 2847 | { 2848 | "op": "null", 2849 | "name": "rf_c3_det_context_conv1_bn_moving_mean", 2850 | "attrs": { 2851 | "__init__": "[\"zero\", {}]", 2852 | "eps": "2e-05", 2853 | "fix_gamma": "False", 2854 | "momentum": "0.9" 2855 | }, 2856 | "inputs": [] 2857 | }, 2858 | { 2859 | "op": "null", 2860 | "name": "rf_c3_det_context_conv1_bn_moving_var", 2861 | "attrs": { 2862 | "__init__": "[\"one\", {}]", 2863 | "eps": "2e-05", 2864 | "fix_gamma": "False", 2865 | "momentum": "0.9" 2866 | }, 2867 | "inputs": [] 2868 | }, 2869 | { 2870 | "op": "BatchNorm", 2871 | "name": "rf_c3_det_context_conv1_bn", 2872 | "attrs": { 2873 | "eps": "2e-05", 2874 | "fix_gamma": "False", 2875 | "momentum": "0.9" 2876 | }, 2877 | "inputs": [[236, 0, 0], [237, 0, 0], [238, 0, 0], [239, 0, 1], [240, 0, 1]] 2878 | }, 2879 | { 2880 | "op": "Activation", 2881 | "name": "rf_c3_det_context_conv1_relu", 2882 | "attrs": {"act_type": "relu"}, 2883 | "inputs": [[241, 0, 0]] 2884 | }, 2885 | { 2886 | "op": "null", 2887 | "name": "rf_c3_det_context_conv2_weight", 2888 | "attrs": { 2889 | "__init__": "[\"normal\", {\"sigma\": 0.01}]", 2890 | "__lr_mult__": "1.0" 2891 | }, 2892 | "inputs": [] 2893 | }, 2894 | { 2895 | "op": "null", 2896 | "name": "rf_c3_det_context_conv2_bias", 2897 | "attrs": { 2898 | "__init__": "[\"constant\", {\"value\": 0.0}]", 2899 | "__lr_mult__": "2.0", 2900 | "__wd_mult__": "0.0" 2901 | }, 2902 | "inputs": [] 2903 | }, 2904 | { 2905 | "op": "Convolution", 2906 | "name": "rf_c3_det_context_conv2", 2907 | "attrs": { 2908 | "kernel": "(3, 3)", 2909 | "num_filter": "16", 2910 | "pad": "(1, 1)", 2911 | "stride": "(1, 1)" 2912 | }, 2913 | "inputs": [[242, 0, 0], [243, 0, 0], [244, 0, 0]] 2914 | }, 2915 | { 2916 | "op": "null", 2917 | "name": "rf_c3_det_context_conv2_bn_gamma", 2918 | "attrs": { 2919 | "eps": "2e-05", 2920 | "fix_gamma": "False", 2921 | "momentum": "0.9" 2922 | }, 2923 | "inputs": [] 2924 | }, 2925 | { 2926 | "op": "null", 2927 | "name": "rf_c3_det_context_conv2_bn_beta", 2928 | "attrs": { 2929 | "eps": "2e-05", 2930 | "fix_gamma": "False", 2931 | "momentum": "0.9" 2932 | }, 2933 | "inputs": [] 2934 | }, 2935 | { 2936 | "op": "null", 2937 | "name": "rf_c3_det_context_conv2_bn_moving_mean", 2938 | "attrs": { 2939 | "__init__": "[\"zero\", {}]", 2940 | "eps": "2e-05", 2941 | "fix_gamma": "False", 2942 | "momentum": "0.9" 2943 | }, 2944 | "inputs": [] 2945 | }, 2946 | { 2947 | "op": "null", 2948 | "name": "rf_c3_det_context_conv2_bn_moving_var", 2949 | "attrs": { 2950 | "__init__": "[\"one\", {}]", 2951 | "eps": "2e-05", 2952 | "fix_gamma": "False", 2953 | "momentum": "0.9" 2954 | }, 2955 | "inputs": [] 2956 | }, 2957 | { 2958 | "op": "BatchNorm", 2959 | "name": "rf_c3_det_context_conv2_bn", 2960 | "attrs": { 2961 | "eps": "2e-05", 2962 | "fix_gamma": "False", 2963 | "momentum": "0.9" 2964 | }, 2965 | "inputs": [[245, 0, 0], [246, 0, 0], [247, 0, 0], [248, 0, 1], [249, 0, 1]] 2966 | }, 2967 | { 2968 | "op": "null", 2969 | "name": "rf_c3_det_context_conv3_1_weight", 2970 | "attrs": { 2971 | "__init__": "[\"normal\", {\"sigma\": 0.01}]", 2972 | "__lr_mult__": "1.0" 2973 | }, 2974 | "inputs": [] 2975 | }, 2976 | { 2977 | "op": "null", 2978 | "name": "rf_c3_det_context_conv3_1_bias", 2979 | "attrs": { 2980 | "__init__": "[\"constant\", {\"value\": 0.0}]", 2981 | "__lr_mult__": "2.0", 2982 | "__wd_mult__": "0.0" 2983 | }, 2984 | "inputs": [] 2985 | }, 2986 | { 2987 | "op": "Convolution", 2988 | "name": "rf_c3_det_context_conv3_1", 2989 | "attrs": { 2990 | "kernel": "(3, 3)", 2991 | "num_filter": "16", 2992 | "pad": "(1, 1)", 2993 | "stride": "(1, 1)" 2994 | }, 2995 | "inputs": [[242, 0, 0], [251, 0, 0], [252, 0, 0]] 2996 | }, 2997 | { 2998 | "op": "null", 2999 | "name": "rf_c3_det_context_conv3_1_bn_gamma", 3000 | "attrs": { 3001 | "eps": "2e-05", 3002 | "fix_gamma": "False", 3003 | "momentum": "0.9" 3004 | }, 3005 | "inputs": [] 3006 | }, 3007 | { 3008 | "op": "null", 3009 | "name": "rf_c3_det_context_conv3_1_bn_beta", 3010 | "attrs": { 3011 | "eps": "2e-05", 3012 | "fix_gamma": "False", 3013 | "momentum": "0.9" 3014 | }, 3015 | "inputs": [] 3016 | }, 3017 | { 3018 | "op": "null", 3019 | "name": "rf_c3_det_context_conv3_1_bn_moving_mean", 3020 | "attrs": { 3021 | "__init__": "[\"zero\", {}]", 3022 | "eps": "2e-05", 3023 | "fix_gamma": "False", 3024 | "momentum": "0.9" 3025 | }, 3026 | "inputs": [] 3027 | }, 3028 | { 3029 | "op": "null", 3030 | "name": "rf_c3_det_context_conv3_1_bn_moving_var", 3031 | "attrs": { 3032 | "__init__": "[\"one\", {}]", 3033 | "eps": "2e-05", 3034 | "fix_gamma": "False", 3035 | "momentum": "0.9" 3036 | }, 3037 | "inputs": [] 3038 | }, 3039 | { 3040 | "op": "BatchNorm", 3041 | "name": "rf_c3_det_context_conv3_1_bn", 3042 | "attrs": { 3043 | "eps": "2e-05", 3044 | "fix_gamma": "False", 3045 | "momentum": "0.9" 3046 | }, 3047 | "inputs": [[253, 0, 0], [254, 0, 0], [255, 0, 0], [256, 0, 1], [257, 0, 1]] 3048 | }, 3049 | { 3050 | "op": "Activation", 3051 | "name": "rf_c3_det_context_conv3_1_relu", 3052 | "attrs": {"act_type": "relu"}, 3053 | "inputs": [[258, 0, 0]] 3054 | }, 3055 | { 3056 | "op": "null", 3057 | "name": "rf_c3_det_context_conv3_2_weight", 3058 | "attrs": { 3059 | "__init__": "[\"normal\", {\"sigma\": 0.01}]", 3060 | "__lr_mult__": "1.0" 3061 | }, 3062 | "inputs": [] 3063 | }, 3064 | { 3065 | "op": "null", 3066 | "name": "rf_c3_det_context_conv3_2_bias", 3067 | "attrs": { 3068 | "__init__": "[\"constant\", {\"value\": 0.0}]", 3069 | "__lr_mult__": "2.0", 3070 | "__wd_mult__": "0.0" 3071 | }, 3072 | "inputs": [] 3073 | }, 3074 | { 3075 | "op": "Convolution", 3076 | "name": "rf_c3_det_context_conv3_2", 3077 | "attrs": { 3078 | "kernel": "(3, 3)", 3079 | "num_filter": "16", 3080 | "pad": "(1, 1)", 3081 | "stride": "(1, 1)" 3082 | }, 3083 | "inputs": [[259, 0, 0], [260, 0, 0], [261, 0, 0]] 3084 | }, 3085 | { 3086 | "op": "null", 3087 | "name": "rf_c3_det_context_conv3_2_bn_gamma", 3088 | "attrs": { 3089 | "eps": "2e-05", 3090 | "fix_gamma": "False", 3091 | "momentum": "0.9" 3092 | }, 3093 | "inputs": [] 3094 | }, 3095 | { 3096 | "op": "null", 3097 | "name": "rf_c3_det_context_conv3_2_bn_beta", 3098 | "attrs": { 3099 | "eps": "2e-05", 3100 | "fix_gamma": "False", 3101 | "momentum": "0.9" 3102 | }, 3103 | "inputs": [] 3104 | }, 3105 | { 3106 | "op": "null", 3107 | "name": "rf_c3_det_context_conv3_2_bn_moving_mean", 3108 | "attrs": { 3109 | "__init__": "[\"zero\", {}]", 3110 | "eps": "2e-05", 3111 | "fix_gamma": "False", 3112 | "momentum": "0.9" 3113 | }, 3114 | "inputs": [] 3115 | }, 3116 | { 3117 | "op": "null", 3118 | "name": "rf_c3_det_context_conv3_2_bn_moving_var", 3119 | "attrs": { 3120 | "__init__": "[\"one\", {}]", 3121 | "eps": "2e-05", 3122 | "fix_gamma": "False", 3123 | "momentum": "0.9" 3124 | }, 3125 | "inputs": [] 3126 | }, 3127 | { 3128 | "op": "BatchNorm", 3129 | "name": "rf_c3_det_context_conv3_2_bn", 3130 | "attrs": { 3131 | "eps": "2e-05", 3132 | "fix_gamma": "False", 3133 | "momentum": "0.9" 3134 | }, 3135 | "inputs": [[262, 0, 0], [263, 0, 0], [264, 0, 0], [265, 0, 1], [266, 0, 1]] 3136 | }, 3137 | { 3138 | "op": "Concat", 3139 | "name": "rf_c3_det_concat", 3140 | "attrs": { 3141 | "dim": "1", 3142 | "num_args": "3" 3143 | }, 3144 | "inputs": [[233, 0, 0], [250, 0, 0], [267, 0, 0]] 3145 | }, 3146 | { 3147 | "op": "Activation", 3148 | "name": "rf_c3_det_concat_relu", 3149 | "attrs": {"act_type": "relu"}, 3150 | "inputs": [[268, 0, 0]] 3151 | }, 3152 | { 3153 | "op": "null", 3154 | "name": "face_rpn_cls_score_stride32_weight", 3155 | "attrs": { 3156 | "__init__": "[\"normal\", {\"sigma\": 0.01}]", 3157 | "__lr_mult__": "1.0" 3158 | }, 3159 | "inputs": [] 3160 | }, 3161 | { 3162 | "op": "null", 3163 | "name": "face_rpn_cls_score_stride32_bias", 3164 | "attrs": { 3165 | "__init__": "[\"constant\", {\"value\": 0.0}]", 3166 | "__lr_mult__": "2.0", 3167 | "__wd_mult__": "0.0" 3168 | }, 3169 | "inputs": [] 3170 | }, 3171 | { 3172 | "op": "Convolution", 3173 | "name": "face_rpn_cls_score_stride32", 3174 | "attrs": { 3175 | "kernel": "(1, 1)", 3176 | "num_filter": "4", 3177 | "pad": "(0, 0)", 3178 | "stride": "(1, 1)" 3179 | }, 3180 | "inputs": [[269, 0, 0], [270, 0, 0], [271, 0, 0]] 3181 | }, 3182 | { 3183 | "op": "Reshape", 3184 | "name": "face_rpn_cls_score_reshape_stride32", 3185 | "attrs": {"shape": "(0, 2, -1, 0)"}, 3186 | "inputs": [[272, 0, 0]] 3187 | }, 3188 | { 3189 | "op": "softmax", 3190 | "name": "face_rpn_cls_prob_stride32", 3191 | "attrs": {"axis":"1"}, 3192 | "inputs": [[273, 0, 0]] 3193 | }, 3194 | { 3195 | "op": "Reshape", 3196 | "name": "face_rpn_cls_prob_reshape_stride32", 3197 | "attrs": {"shape": "(0, 4, -1, 0)"}, 3198 | "inputs": [[274, 0, 0]] 3199 | }, 3200 | { 3201 | "op": "null", 3202 | "name": "face_rpn_bbox_pred_stride32_weight", 3203 | "attrs": { 3204 | "__init__": "[\"normal\", {\"sigma\": 0.01}]", 3205 | "__lr_mult__": "1.0" 3206 | }, 3207 | "inputs": [] 3208 | }, 3209 | { 3210 | "op": "null", 3211 | "name": "face_rpn_bbox_pred_stride32_bias", 3212 | "attrs": { 3213 | "__init__": "[\"constant\", {\"value\": 0.0}]", 3214 | "__lr_mult__": "2.0", 3215 | "__wd_mult__": "0.0" 3216 | }, 3217 | "inputs": [] 3218 | }, 3219 | { 3220 | "op": "Convolution", 3221 | "name": "face_rpn_bbox_pred_stride32", 3222 | "attrs": { 3223 | "kernel": "(1, 1)", 3224 | "num_filter": "8", 3225 | "pad": "(0, 0)", 3226 | "stride": "(1, 1)" 3227 | }, 3228 | "inputs": [[269, 0, 0], [276, 0, 0], [277, 0, 0]] 3229 | }, 3230 | { 3231 | "op": "null", 3232 | "name": "face_rpn_landmark_pred_stride32_weight", 3233 | "attrs": { 3234 | "__init__": "[\"normal\", {\"sigma\": 0.01}]", 3235 | "__lr_mult__": "1.0" 3236 | }, 3237 | "inputs": [] 3238 | }, 3239 | { 3240 | "op": "null", 3241 | "name": "face_rpn_landmark_pred_stride32_bias", 3242 | "attrs": { 3243 | "__init__": "[\"constant\", {\"value\": 0.0}]", 3244 | "__lr_mult__": "2.0", 3245 | "__wd_mult__": "0.0" 3246 | }, 3247 | "inputs": [] 3248 | }, 3249 | { 3250 | "op": "Convolution", 3251 | "name": "face_rpn_landmark_pred_stride32", 3252 | "attrs": { 3253 | "kernel": "(1, 1)", 3254 | "num_filter": "20", 3255 | "pad": "(0, 0)", 3256 | "stride": "(1, 1)" 3257 | }, 3258 | "inputs": [[269, 0, 0], [279, 0, 0], [280, 0, 0]] 3259 | }, 3260 | { 3261 | "op": "null", 3262 | "name": "rf_c2_lateral_weight", 3263 | "attrs": { 3264 | "__init__": "[\"normal\", {\"sigma\": 0.01}]", 3265 | "__lr_mult__": "1.0" 3266 | }, 3267 | "inputs": [] 3268 | }, 3269 | { 3270 | "op": "null", 3271 | "name": "rf_c2_lateral_bias", 3272 | "attrs": { 3273 | "__init__": "[\"constant\", {\"value\": 0.0}]", 3274 | "__lr_mult__": "2.0", 3275 | "__wd_mult__": "1.0" 3276 | }, 3277 | "inputs": [] 3278 | }, 3279 | { 3280 | "op": "Convolution", 3281 | "name": "rf_c2_lateral", 3282 | "attrs": { 3283 | "kernel": "(1, 1)", 3284 | "num_filter": "64", 3285 | "pad": "(0, 0)", 3286 | "stride": "(1, 1)" 3287 | }, 3288 | "inputs": [[184, 0, 0], [282, 0, 0], [283, 0, 0]] 3289 | }, 3290 | { 3291 | "op": "null", 3292 | "name": "rf_c2_lateral_bn_gamma", 3293 | "attrs": { 3294 | "eps": "2e-05", 3295 | "fix_gamma": "False", 3296 | "momentum": "0.9" 3297 | }, 3298 | "inputs": [] 3299 | }, 3300 | { 3301 | "op": "null", 3302 | "name": "rf_c2_lateral_bn_beta", 3303 | "attrs": { 3304 | "eps": "2e-05", 3305 | "fix_gamma": "False", 3306 | "momentum": "0.9" 3307 | }, 3308 | "inputs": [] 3309 | }, 3310 | { 3311 | "op": "null", 3312 | "name": "rf_c2_lateral_bn_moving_mean", 3313 | "attrs": { 3314 | "__init__": "[\"zero\", {}]", 3315 | "eps": "2e-05", 3316 | "fix_gamma": "False", 3317 | "momentum": "0.9" 3318 | }, 3319 | "inputs": [] 3320 | }, 3321 | { 3322 | "op": "null", 3323 | "name": "rf_c2_lateral_bn_moving_var", 3324 | "attrs": { 3325 | "__init__": "[\"one\", {}]", 3326 | "eps": "2e-05", 3327 | "fix_gamma": "False", 3328 | "momentum": "0.9" 3329 | }, 3330 | "inputs": [] 3331 | }, 3332 | { 3333 | "op": "BatchNorm", 3334 | "name": "rf_c2_lateral_bn", 3335 | "attrs": { 3336 | "eps": "2e-05", 3337 | "fix_gamma": "False", 3338 | "momentum": "0.9" 3339 | }, 3340 | "inputs": [[284, 0, 0], [285, 0, 0], [286, 0, 0], [287, 0, 1], [288, 0, 1]] 3341 | }, 3342 | { 3343 | "op": "Activation", 3344 | "name": "rf_c2_lateral_relu", 3345 | "attrs": {"act_type": "relu"}, 3346 | "inputs": [[289, 0, 0]] 3347 | }, 3348 | { 3349 | "op": "UpSampling", 3350 | "name": "rf_c3_upsampling", 3351 | "attrs": { 3352 | "num_args": "1", 3353 | "sample_type": "nearest", 3354 | "scale": "2", 3355 | "workspace": "512" 3356 | }, 3357 | "inputs": [[225, 0, 0]] 3358 | }, 3359 | { 3360 | "op": "Crop", 3361 | "name": "crop0", 3362 | "attrs": {"num_args": "2"}, 3363 | "inputs": [[291, 0, 0], [290, 0, 0]] 3364 | }, 3365 | { 3366 | "op": "elemwise_add", 3367 | "name": "_plus0", 3368 | "inputs": [[290, 0, 0], [292, 0, 0]] 3369 | }, 3370 | { 3371 | "op": "null", 3372 | "name": "rf_c2_aggr_weight", 3373 | "attrs": { 3374 | "__init__": "[\"normal\", {\"sigma\": 0.01}]", 3375 | "__lr_mult__": "1.0" 3376 | }, 3377 | "inputs": [] 3378 | }, 3379 | { 3380 | "op": "null", 3381 | "name": "rf_c2_aggr_bias", 3382 | "attrs": { 3383 | "__init__": "[\"constant\", {\"value\": 0.0}]", 3384 | "__lr_mult__": "2.0", 3385 | "__wd_mult__": "1.0" 3386 | }, 3387 | "inputs": [] 3388 | }, 3389 | { 3390 | "op": "Convolution", 3391 | "name": "rf_c2_aggr", 3392 | "attrs": { 3393 | "kernel": "(3, 3)", 3394 | "num_filter": "64", 3395 | "pad": "(1, 1)", 3396 | "stride": "(1, 1)" 3397 | }, 3398 | "inputs": [[293, 0, 0], [294, 0, 0], [295, 0, 0]] 3399 | }, 3400 | { 3401 | "op": "null", 3402 | "name": "rf_c2_aggr_bn_gamma", 3403 | "attrs": { 3404 | "eps": "2e-05", 3405 | "fix_gamma": "False", 3406 | "momentum": "0.9" 3407 | }, 3408 | "inputs": [] 3409 | }, 3410 | { 3411 | "op": "null", 3412 | "name": "rf_c2_aggr_bn_beta", 3413 | "attrs": { 3414 | "eps": "2e-05", 3415 | "fix_gamma": "False", 3416 | "momentum": "0.9" 3417 | }, 3418 | "inputs": [] 3419 | }, 3420 | { 3421 | "op": "null", 3422 | "name": "rf_c2_aggr_bn_moving_mean", 3423 | "attrs": { 3424 | "__init__": "[\"zero\", {}]", 3425 | "eps": "2e-05", 3426 | "fix_gamma": "False", 3427 | "momentum": "0.9" 3428 | }, 3429 | "inputs": [] 3430 | }, 3431 | { 3432 | "op": "null", 3433 | "name": "rf_c2_aggr_bn_moving_var", 3434 | "attrs": { 3435 | "__init__": "[\"one\", {}]", 3436 | "eps": "2e-05", 3437 | "fix_gamma": "False", 3438 | "momentum": "0.9" 3439 | }, 3440 | "inputs": [] 3441 | }, 3442 | { 3443 | "op": "BatchNorm", 3444 | "name": "rf_c2_aggr_bn", 3445 | "attrs": { 3446 | "eps": "2e-05", 3447 | "fix_gamma": "False", 3448 | "momentum": "0.9" 3449 | }, 3450 | "inputs": [[296, 0, 0], [297, 0, 0], [298, 0, 0], [299, 0, 1], [300, 0, 1]] 3451 | }, 3452 | { 3453 | "op": "Activation", 3454 | "name": "rf_c2_aggr_relu", 3455 | "attrs": {"act_type": "relu"}, 3456 | "inputs": [[301, 0, 0]] 3457 | }, 3458 | { 3459 | "op": "null", 3460 | "name": "rf_c2_det_conv1_weight", 3461 | "attrs": { 3462 | "__init__": "[\"normal\", {\"sigma\": 0.01}]", 3463 | "__lr_mult__": "1.0" 3464 | }, 3465 | "inputs": [] 3466 | }, 3467 | { 3468 | "op": "null", 3469 | "name": "rf_c2_det_conv1_bias", 3470 | "attrs": { 3471 | "__init__": "[\"constant\", {\"value\": 0.0}]", 3472 | "__lr_mult__": "2.0", 3473 | "__wd_mult__": "0.0" 3474 | }, 3475 | "inputs": [] 3476 | }, 3477 | { 3478 | "op": "Convolution", 3479 | "name": "rf_c2_det_conv1", 3480 | "attrs": { 3481 | "kernel": "(3, 3)", 3482 | "num_filter": "32", 3483 | "pad": "(1, 1)", 3484 | "stride": "(1, 1)" 3485 | }, 3486 | "inputs": [[302, 0, 0], [303, 0, 0], [304, 0, 0]] 3487 | }, 3488 | { 3489 | "op": "null", 3490 | "name": "rf_c2_det_conv1_bn_gamma", 3491 | "attrs": { 3492 | "eps": "2e-05", 3493 | "fix_gamma": "False", 3494 | "momentum": "0.9" 3495 | }, 3496 | "inputs": [] 3497 | }, 3498 | { 3499 | "op": "null", 3500 | "name": "rf_c2_det_conv1_bn_beta", 3501 | "attrs": { 3502 | "eps": "2e-05", 3503 | "fix_gamma": "False", 3504 | "momentum": "0.9" 3505 | }, 3506 | "inputs": [] 3507 | }, 3508 | { 3509 | "op": "null", 3510 | "name": "rf_c2_det_conv1_bn_moving_mean", 3511 | "attrs": { 3512 | "__init__": "[\"zero\", {}]", 3513 | "eps": "2e-05", 3514 | "fix_gamma": "False", 3515 | "momentum": "0.9" 3516 | }, 3517 | "inputs": [] 3518 | }, 3519 | { 3520 | "op": "null", 3521 | "name": "rf_c2_det_conv1_bn_moving_var", 3522 | "attrs": { 3523 | "__init__": "[\"one\", {}]", 3524 | "eps": "2e-05", 3525 | "fix_gamma": "False", 3526 | "momentum": "0.9" 3527 | }, 3528 | "inputs": [] 3529 | }, 3530 | { 3531 | "op": "BatchNorm", 3532 | "name": "rf_c2_det_conv1_bn", 3533 | "attrs": { 3534 | "eps": "2e-05", 3535 | "fix_gamma": "False", 3536 | "momentum": "0.9" 3537 | }, 3538 | "inputs": [[305, 0, 0], [306, 0, 0], [307, 0, 0], [308, 0, 1], [309, 0, 1]] 3539 | }, 3540 | { 3541 | "op": "null", 3542 | "name": "rf_c2_det_context_conv1_weight", 3543 | "attrs": { 3544 | "__init__": "[\"normal\", {\"sigma\": 0.01}]", 3545 | "__lr_mult__": "1.0" 3546 | }, 3547 | "inputs": [] 3548 | }, 3549 | { 3550 | "op": "null", 3551 | "name": "rf_c2_det_context_conv1_bias", 3552 | "attrs": { 3553 | "__init__": "[\"constant\", {\"value\": 0.0}]", 3554 | "__lr_mult__": "2.0", 3555 | "__wd_mult__": "0.0" 3556 | }, 3557 | "inputs": [] 3558 | }, 3559 | { 3560 | "op": "Convolution", 3561 | "name": "rf_c2_det_context_conv1", 3562 | "attrs": { 3563 | "kernel": "(3, 3)", 3564 | "num_filter": "16", 3565 | "pad": "(1, 1)", 3566 | "stride": "(1, 1)" 3567 | }, 3568 | "inputs": [[302, 0, 0], [311, 0, 0], [312, 0, 0]] 3569 | }, 3570 | { 3571 | "op": "null", 3572 | "name": "rf_c2_det_context_conv1_bn_gamma", 3573 | "attrs": { 3574 | "eps": "2e-05", 3575 | "fix_gamma": "False", 3576 | "momentum": "0.9" 3577 | }, 3578 | "inputs": [] 3579 | }, 3580 | { 3581 | "op": "null", 3582 | "name": "rf_c2_det_context_conv1_bn_beta", 3583 | "attrs": { 3584 | "eps": "2e-05", 3585 | "fix_gamma": "False", 3586 | "momentum": "0.9" 3587 | }, 3588 | "inputs": [] 3589 | }, 3590 | { 3591 | "op": "null", 3592 | "name": "rf_c2_det_context_conv1_bn_moving_mean", 3593 | "attrs": { 3594 | "__init__": "[\"zero\", {}]", 3595 | "eps": "2e-05", 3596 | "fix_gamma": "False", 3597 | "momentum": "0.9" 3598 | }, 3599 | "inputs": [] 3600 | }, 3601 | { 3602 | "op": "null", 3603 | "name": "rf_c2_det_context_conv1_bn_moving_var", 3604 | "attrs": { 3605 | "__init__": "[\"one\", {}]", 3606 | "eps": "2e-05", 3607 | "fix_gamma": "False", 3608 | "momentum": "0.9" 3609 | }, 3610 | "inputs": [] 3611 | }, 3612 | { 3613 | "op": "BatchNorm", 3614 | "name": "rf_c2_det_context_conv1_bn", 3615 | "attrs": { 3616 | "eps": "2e-05", 3617 | "fix_gamma": "False", 3618 | "momentum": "0.9" 3619 | }, 3620 | "inputs": [[313, 0, 0], [314, 0, 0], [315, 0, 0], [316, 0, 1], [317, 0, 1]] 3621 | }, 3622 | { 3623 | "op": "Activation", 3624 | "name": "rf_c2_det_context_conv1_relu", 3625 | "attrs": {"act_type": "relu"}, 3626 | "inputs": [[318, 0, 0]] 3627 | }, 3628 | { 3629 | "op": "null", 3630 | "name": "rf_c2_det_context_conv2_weight", 3631 | "attrs": { 3632 | "__init__": "[\"normal\", {\"sigma\": 0.01}]", 3633 | "__lr_mult__": "1.0" 3634 | }, 3635 | "inputs": [] 3636 | }, 3637 | { 3638 | "op": "null", 3639 | "name": "rf_c2_det_context_conv2_bias", 3640 | "attrs": { 3641 | "__init__": "[\"constant\", {\"value\": 0.0}]", 3642 | "__lr_mult__": "2.0", 3643 | "__wd_mult__": "0.0" 3644 | }, 3645 | "inputs": [] 3646 | }, 3647 | { 3648 | "op": "Convolution", 3649 | "name": "rf_c2_det_context_conv2", 3650 | "attrs": { 3651 | "kernel": "(3, 3)", 3652 | "num_filter": "16", 3653 | "pad": "(1, 1)", 3654 | "stride": "(1, 1)" 3655 | }, 3656 | "inputs": [[319, 0, 0], [320, 0, 0], [321, 0, 0]] 3657 | }, 3658 | { 3659 | "op": "null", 3660 | "name": "rf_c2_det_context_conv2_bn_gamma", 3661 | "attrs": { 3662 | "eps": "2e-05", 3663 | "fix_gamma": "False", 3664 | "momentum": "0.9" 3665 | }, 3666 | "inputs": [] 3667 | }, 3668 | { 3669 | "op": "null", 3670 | "name": "rf_c2_det_context_conv2_bn_beta", 3671 | "attrs": { 3672 | "eps": "2e-05", 3673 | "fix_gamma": "False", 3674 | "momentum": "0.9" 3675 | }, 3676 | "inputs": [] 3677 | }, 3678 | { 3679 | "op": "null", 3680 | "name": "rf_c2_det_context_conv2_bn_moving_mean", 3681 | "attrs": { 3682 | "__init__": "[\"zero\", {}]", 3683 | "eps": "2e-05", 3684 | "fix_gamma": "False", 3685 | "momentum": "0.9" 3686 | }, 3687 | "inputs": [] 3688 | }, 3689 | { 3690 | "op": "null", 3691 | "name": "rf_c2_det_context_conv2_bn_moving_var", 3692 | "attrs": { 3693 | "__init__": "[\"one\", {}]", 3694 | "eps": "2e-05", 3695 | "fix_gamma": "False", 3696 | "momentum": "0.9" 3697 | }, 3698 | "inputs": [] 3699 | }, 3700 | { 3701 | "op": "BatchNorm", 3702 | "name": "rf_c2_det_context_conv2_bn", 3703 | "attrs": { 3704 | "eps": "2e-05", 3705 | "fix_gamma": "False", 3706 | "momentum": "0.9" 3707 | }, 3708 | "inputs": [[322, 0, 0], [323, 0, 0], [324, 0, 0], [325, 0, 1], [326, 0, 1]] 3709 | }, 3710 | { 3711 | "op": "null", 3712 | "name": "rf_c2_det_context_conv3_1_weight", 3713 | "attrs": { 3714 | "__init__": "[\"normal\", {\"sigma\": 0.01}]", 3715 | "__lr_mult__": "1.0" 3716 | }, 3717 | "inputs": [] 3718 | }, 3719 | { 3720 | "op": "null", 3721 | "name": "rf_c2_det_context_conv3_1_bias", 3722 | "attrs": { 3723 | "__init__": "[\"constant\", {\"value\": 0.0}]", 3724 | "__lr_mult__": "2.0", 3725 | "__wd_mult__": "0.0" 3726 | }, 3727 | "inputs": [] 3728 | }, 3729 | { 3730 | "op": "Convolution", 3731 | "name": "rf_c2_det_context_conv3_1", 3732 | "attrs": { 3733 | "kernel": "(3, 3)", 3734 | "num_filter": "16", 3735 | "pad": "(1, 1)", 3736 | "stride": "(1, 1)" 3737 | }, 3738 | "inputs": [[319, 0, 0], [328, 0, 0], [329, 0, 0]] 3739 | }, 3740 | { 3741 | "op": "null", 3742 | "name": "rf_c2_det_context_conv3_1_bn_gamma", 3743 | "attrs": { 3744 | "eps": "2e-05", 3745 | "fix_gamma": "False", 3746 | "momentum": "0.9" 3747 | }, 3748 | "inputs": [] 3749 | }, 3750 | { 3751 | "op": "null", 3752 | "name": "rf_c2_det_context_conv3_1_bn_beta", 3753 | "attrs": { 3754 | "eps": "2e-05", 3755 | "fix_gamma": "False", 3756 | "momentum": "0.9" 3757 | }, 3758 | "inputs": [] 3759 | }, 3760 | { 3761 | "op": "null", 3762 | "name": "rf_c2_det_context_conv3_1_bn_moving_mean", 3763 | "attrs": { 3764 | "__init__": "[\"zero\", {}]", 3765 | "eps": "2e-05", 3766 | "fix_gamma": "False", 3767 | "momentum": "0.9" 3768 | }, 3769 | "inputs": [] 3770 | }, 3771 | { 3772 | "op": "null", 3773 | "name": "rf_c2_det_context_conv3_1_bn_moving_var", 3774 | "attrs": { 3775 | "__init__": "[\"one\", {}]", 3776 | "eps": "2e-05", 3777 | "fix_gamma": "False", 3778 | "momentum": "0.9" 3779 | }, 3780 | "inputs": [] 3781 | }, 3782 | { 3783 | "op": "BatchNorm", 3784 | "name": "rf_c2_det_context_conv3_1_bn", 3785 | "attrs": { 3786 | "eps": "2e-05", 3787 | "fix_gamma": "False", 3788 | "momentum": "0.9" 3789 | }, 3790 | "inputs": [[330, 0, 0], [331, 0, 0], [332, 0, 0], [333, 0, 1], [334, 0, 1]] 3791 | }, 3792 | { 3793 | "op": "Activation", 3794 | "name": "rf_c2_det_context_conv3_1_relu", 3795 | "attrs": {"act_type": "relu"}, 3796 | "inputs": [[335, 0, 0]] 3797 | }, 3798 | { 3799 | "op": "null", 3800 | "name": "rf_c2_det_context_conv3_2_weight", 3801 | "attrs": { 3802 | "__init__": "[\"normal\", {\"sigma\": 0.01}]", 3803 | "__lr_mult__": "1.0" 3804 | }, 3805 | "inputs": [] 3806 | }, 3807 | { 3808 | "op": "null", 3809 | "name": "rf_c2_det_context_conv3_2_bias", 3810 | "attrs": { 3811 | "__init__": "[\"constant\", {\"value\": 0.0}]", 3812 | "__lr_mult__": "2.0", 3813 | "__wd_mult__": "0.0" 3814 | }, 3815 | "inputs": [] 3816 | }, 3817 | { 3818 | "op": "Convolution", 3819 | "name": "rf_c2_det_context_conv3_2", 3820 | "attrs": { 3821 | "kernel": "(3, 3)", 3822 | "num_filter": "16", 3823 | "pad": "(1, 1)", 3824 | "stride": "(1, 1)" 3825 | }, 3826 | "inputs": [[336, 0, 0], [337, 0, 0], [338, 0, 0]] 3827 | }, 3828 | { 3829 | "op": "null", 3830 | "name": "rf_c2_det_context_conv3_2_bn_gamma", 3831 | "attrs": { 3832 | "eps": "2e-05", 3833 | "fix_gamma": "False", 3834 | "momentum": "0.9" 3835 | }, 3836 | "inputs": [] 3837 | }, 3838 | { 3839 | "op": "null", 3840 | "name": "rf_c2_det_context_conv3_2_bn_beta", 3841 | "attrs": { 3842 | "eps": "2e-05", 3843 | "fix_gamma": "False", 3844 | "momentum": "0.9" 3845 | }, 3846 | "inputs": [] 3847 | }, 3848 | { 3849 | "op": "null", 3850 | "name": "rf_c2_det_context_conv3_2_bn_moving_mean", 3851 | "attrs": { 3852 | "__init__": "[\"zero\", {}]", 3853 | "eps": "2e-05", 3854 | "fix_gamma": "False", 3855 | "momentum": "0.9" 3856 | }, 3857 | "inputs": [] 3858 | }, 3859 | { 3860 | "op": "null", 3861 | "name": "rf_c2_det_context_conv3_2_bn_moving_var", 3862 | "attrs": { 3863 | "__init__": "[\"one\", {}]", 3864 | "eps": "2e-05", 3865 | "fix_gamma": "False", 3866 | "momentum": "0.9" 3867 | }, 3868 | "inputs": [] 3869 | }, 3870 | { 3871 | "op": "BatchNorm", 3872 | "name": "rf_c2_det_context_conv3_2_bn", 3873 | "attrs": { 3874 | "eps": "2e-05", 3875 | "fix_gamma": "False", 3876 | "momentum": "0.9" 3877 | }, 3878 | "inputs": [[339, 0, 0], [340, 0, 0], [341, 0, 0], [342, 0, 1], [343, 0, 1]] 3879 | }, 3880 | { 3881 | "op": "Concat", 3882 | "name": "rf_c2_det_concat", 3883 | "attrs": { 3884 | "dim": "1", 3885 | "num_args": "3" 3886 | }, 3887 | "inputs": [[310, 0, 0], [327, 0, 0], [344, 0, 0]] 3888 | }, 3889 | { 3890 | "op": "Activation", 3891 | "name": "rf_c2_det_concat_relu", 3892 | "attrs": {"act_type": "relu"}, 3893 | "inputs": [[345, 0, 0]] 3894 | }, 3895 | { 3896 | "op": "null", 3897 | "name": "face_rpn_cls_score_stride16_weight", 3898 | "attrs": { 3899 | "__init__": "[\"normal\", {\"sigma\": 0.01}]", 3900 | "__lr_mult__": "1.0" 3901 | }, 3902 | "inputs": [] 3903 | }, 3904 | { 3905 | "op": "null", 3906 | "name": "face_rpn_cls_score_stride16_bias", 3907 | "attrs": { 3908 | "__init__": "[\"constant\", {\"value\": 0.0}]", 3909 | "__lr_mult__": "2.0", 3910 | "__wd_mult__": "0.0" 3911 | }, 3912 | "inputs": [] 3913 | }, 3914 | { 3915 | "op": "Convolution", 3916 | "name": "face_rpn_cls_score_stride16", 3917 | "attrs": { 3918 | "kernel": "(1, 1)", 3919 | "num_filter": "4", 3920 | "pad": "(0, 0)", 3921 | "stride": "(1, 1)" 3922 | }, 3923 | "inputs": [[346, 0, 0], [347, 0, 0], [348, 0, 0]] 3924 | }, 3925 | { 3926 | "op": "Reshape", 3927 | "name": "face_rpn_cls_score_reshape_stride16", 3928 | "attrs": {"shape": "(0, 2, -1, 0)"}, 3929 | "inputs": [[349, 0, 0]] 3930 | }, 3931 | { 3932 | "op": "softmax", 3933 | "name": "face_rpn_cls_prob_stride16", 3934 | "attrs": {"axis":"1"}, 3935 | "inputs": [[350, 0, 0]] 3936 | }, 3937 | { 3938 | "op": "Reshape", 3939 | "name": "face_rpn_cls_prob_reshape_stride16", 3940 | "attrs": {"shape": "(0, 4, -1, 0)"}, 3941 | "inputs": [[351, 0, 0]] 3942 | }, 3943 | { 3944 | "op": "null", 3945 | "name": "face_rpn_bbox_pred_stride16_weight", 3946 | "attrs": { 3947 | "__init__": "[\"normal\", {\"sigma\": 0.01}]", 3948 | "__lr_mult__": "1.0" 3949 | }, 3950 | "inputs": [] 3951 | }, 3952 | { 3953 | "op": "null", 3954 | "name": "face_rpn_bbox_pred_stride16_bias", 3955 | "attrs": { 3956 | "__init__": "[\"constant\", {\"value\": 0.0}]", 3957 | "__lr_mult__": "2.0", 3958 | "__wd_mult__": "0.0" 3959 | }, 3960 | "inputs": [] 3961 | }, 3962 | { 3963 | "op": "Convolution", 3964 | "name": "face_rpn_bbox_pred_stride16", 3965 | "attrs": { 3966 | "kernel": "(1, 1)", 3967 | "num_filter": "8", 3968 | "pad": "(0, 0)", 3969 | "stride": "(1, 1)" 3970 | }, 3971 | "inputs": [[346, 0, 0], [353, 0, 0], [354, 0, 0]] 3972 | }, 3973 | { 3974 | "op": "null", 3975 | "name": "face_rpn_landmark_pred_stride16_weight", 3976 | "attrs": { 3977 | "__init__": "[\"normal\", {\"sigma\": 0.01}]", 3978 | "__lr_mult__": "1.0" 3979 | }, 3980 | "inputs": [] 3981 | }, 3982 | { 3983 | "op": "null", 3984 | "name": "face_rpn_landmark_pred_stride16_bias", 3985 | "attrs": { 3986 | "__init__": "[\"constant\", {\"value\": 0.0}]", 3987 | "__lr_mult__": "2.0", 3988 | "__wd_mult__": "0.0" 3989 | }, 3990 | "inputs": [] 3991 | }, 3992 | { 3993 | "op": "Convolution", 3994 | "name": "face_rpn_landmark_pred_stride16", 3995 | "attrs": { 3996 | "kernel": "(1, 1)", 3997 | "num_filter": "20", 3998 | "pad": "(0, 0)", 3999 | "stride": "(1, 1)" 4000 | }, 4001 | "inputs": [[346, 0, 0], [356, 0, 0], [357, 0, 0]] 4002 | }, 4003 | { 4004 | "op": "null", 4005 | "name": "rf_c1_red_conv_weight", 4006 | "attrs": { 4007 | "__init__": "[\"normal\", {\"sigma\": 0.01}]", 4008 | "__lr_mult__": "1.0" 4009 | }, 4010 | "inputs": [] 4011 | }, 4012 | { 4013 | "op": "null", 4014 | "name": "rf_c1_red_conv_bias", 4015 | "attrs": { 4016 | "__init__": "[\"constant\", {\"value\": 0.0}]", 4017 | "__lr_mult__": "2.0", 4018 | "__wd_mult__": "1.0" 4019 | }, 4020 | "inputs": [] 4021 | }, 4022 | { 4023 | "op": "Convolution", 4024 | "name": "rf_c1_red_conv", 4025 | "attrs": { 4026 | "kernel": "(1, 1)", 4027 | "num_filter": "64", 4028 | "pad": "(0, 0)", 4029 | "stride": "(1, 1)" 4030 | }, 4031 | "inputs": [[88, 0, 0], [359, 0, 0], [360, 0, 0]] 4032 | }, 4033 | { 4034 | "op": "null", 4035 | "name": "rf_c1_red_conv_bn_gamma", 4036 | "attrs": { 4037 | "eps": "2e-05", 4038 | "fix_gamma": "False", 4039 | "momentum": "0.9" 4040 | }, 4041 | "inputs": [] 4042 | }, 4043 | { 4044 | "op": "null", 4045 | "name": "rf_c1_red_conv_bn_beta", 4046 | "attrs": { 4047 | "eps": "2e-05", 4048 | "fix_gamma": "False", 4049 | "momentum": "0.9" 4050 | }, 4051 | "inputs": [] 4052 | }, 4053 | { 4054 | "op": "null", 4055 | "name": "rf_c1_red_conv_bn_moving_mean", 4056 | "attrs": { 4057 | "__init__": "[\"zero\", {}]", 4058 | "eps": "2e-05", 4059 | "fix_gamma": "False", 4060 | "momentum": "0.9" 4061 | }, 4062 | "inputs": [] 4063 | }, 4064 | { 4065 | "op": "null", 4066 | "name": "rf_c1_red_conv_bn_moving_var", 4067 | "attrs": { 4068 | "__init__": "[\"one\", {}]", 4069 | "eps": "2e-05", 4070 | "fix_gamma": "False", 4071 | "momentum": "0.9" 4072 | }, 4073 | "inputs": [] 4074 | }, 4075 | { 4076 | "op": "BatchNorm", 4077 | "name": "rf_c1_red_conv_bn", 4078 | "attrs": { 4079 | "eps": "2e-05", 4080 | "fix_gamma": "False", 4081 | "momentum": "0.9" 4082 | }, 4083 | "inputs": [[361, 0, 0], [362, 0, 0], [363, 0, 0], [364, 0, 1], [365, 0, 1]] 4084 | }, 4085 | { 4086 | "op": "Activation", 4087 | "name": "rf_c1_red_conv_relu", 4088 | "attrs": {"act_type": "relu"}, 4089 | "inputs": [[366, 0, 0]] 4090 | }, 4091 | { 4092 | "op": "UpSampling", 4093 | "name": "rf_c2_upsampling", 4094 | "attrs": { 4095 | "num_args": "1", 4096 | "sample_type": "nearest", 4097 | "scale": "2", 4098 | "workspace": "512" 4099 | }, 4100 | "inputs": [[302, 0, 0]] 4101 | }, 4102 | { 4103 | "op": "Crop", 4104 | "name": "crop1", 4105 | "attrs": {"num_args": "2"}, 4106 | "inputs": [[368, 0, 0], [367, 0, 0]] 4107 | }, 4108 | { 4109 | "op": "elemwise_add", 4110 | "name": "_plus1", 4111 | "inputs": [[367, 0, 0], [369, 0, 0]] 4112 | }, 4113 | { 4114 | "op": "null", 4115 | "name": "rf_c1_aggr_weight", 4116 | "attrs": { 4117 | "__init__": "[\"normal\", {\"sigma\": 0.01}]", 4118 | "__lr_mult__": "1.0" 4119 | }, 4120 | "inputs": [] 4121 | }, 4122 | { 4123 | "op": "null", 4124 | "name": "rf_c1_aggr_bias", 4125 | "attrs": { 4126 | "__init__": "[\"constant\", {\"value\": 0.0}]", 4127 | "__lr_mult__": "2.0", 4128 | "__wd_mult__": "1.0" 4129 | }, 4130 | "inputs": [] 4131 | }, 4132 | { 4133 | "op": "Convolution", 4134 | "name": "rf_c1_aggr", 4135 | "attrs": { 4136 | "kernel": "(3, 3)", 4137 | "num_filter": "64", 4138 | "pad": "(1, 1)", 4139 | "stride": "(1, 1)" 4140 | }, 4141 | "inputs": [[370, 0, 0], [371, 0, 0], [372, 0, 0]] 4142 | }, 4143 | { 4144 | "op": "null", 4145 | "name": "rf_c1_aggr_bn_gamma", 4146 | "attrs": { 4147 | "eps": "2e-05", 4148 | "fix_gamma": "False", 4149 | "momentum": "0.9" 4150 | }, 4151 | "inputs": [] 4152 | }, 4153 | { 4154 | "op": "null", 4155 | "name": "rf_c1_aggr_bn_beta", 4156 | "attrs": { 4157 | "eps": "2e-05", 4158 | "fix_gamma": "False", 4159 | "momentum": "0.9" 4160 | }, 4161 | "inputs": [] 4162 | }, 4163 | { 4164 | "op": "null", 4165 | "name": "rf_c1_aggr_bn_moving_mean", 4166 | "attrs": { 4167 | "__init__": "[\"zero\", {}]", 4168 | "eps": "2e-05", 4169 | "fix_gamma": "False", 4170 | "momentum": "0.9" 4171 | }, 4172 | "inputs": [] 4173 | }, 4174 | { 4175 | "op": "null", 4176 | "name": "rf_c1_aggr_bn_moving_var", 4177 | "attrs": { 4178 | "__init__": "[\"one\", {}]", 4179 | "eps": "2e-05", 4180 | "fix_gamma": "False", 4181 | "momentum": "0.9" 4182 | }, 4183 | "inputs": [] 4184 | }, 4185 | { 4186 | "op": "BatchNorm", 4187 | "name": "rf_c1_aggr_bn", 4188 | "attrs": { 4189 | "eps": "2e-05", 4190 | "fix_gamma": "False", 4191 | "momentum": "0.9" 4192 | }, 4193 | "inputs": [[373, 0, 0], [374, 0, 0], [375, 0, 0], [376, 0, 1], [377, 0, 1]] 4194 | }, 4195 | { 4196 | "op": "Activation", 4197 | "name": "rf_c1_aggr_relu", 4198 | "attrs": {"act_type": "relu"}, 4199 | "inputs": [[378, 0, 0]] 4200 | }, 4201 | { 4202 | "op": "null", 4203 | "name": "rf_c1_det_conv1_weight", 4204 | "attrs": { 4205 | "__init__": "[\"normal\", {\"sigma\": 0.01}]", 4206 | "__lr_mult__": "1.0" 4207 | }, 4208 | "inputs": [] 4209 | }, 4210 | { 4211 | "op": "null", 4212 | "name": "rf_c1_det_conv1_bias", 4213 | "attrs": { 4214 | "__init__": "[\"constant\", {\"value\": 0.0}]", 4215 | "__lr_mult__": "2.0", 4216 | "__wd_mult__": "0.0" 4217 | }, 4218 | "inputs": [] 4219 | }, 4220 | { 4221 | "op": "Convolution", 4222 | "name": "rf_c1_det_conv1", 4223 | "attrs": { 4224 | "kernel": "(3, 3)", 4225 | "num_filter": "32", 4226 | "pad": "(1, 1)", 4227 | "stride": "(1, 1)" 4228 | }, 4229 | "inputs": [[379, 0, 0], [380, 0, 0], [381, 0, 0]] 4230 | }, 4231 | { 4232 | "op": "null", 4233 | "name": "rf_c1_det_conv1_bn_gamma", 4234 | "attrs": { 4235 | "eps": "2e-05", 4236 | "fix_gamma": "False", 4237 | "momentum": "0.9" 4238 | }, 4239 | "inputs": [] 4240 | }, 4241 | { 4242 | "op": "null", 4243 | "name": "rf_c1_det_conv1_bn_beta", 4244 | "attrs": { 4245 | "eps": "2e-05", 4246 | "fix_gamma": "False", 4247 | "momentum": "0.9" 4248 | }, 4249 | "inputs": [] 4250 | }, 4251 | { 4252 | "op": "null", 4253 | "name": "rf_c1_det_conv1_bn_moving_mean", 4254 | "attrs": { 4255 | "__init__": "[\"zero\", {}]", 4256 | "eps": "2e-05", 4257 | "fix_gamma": "False", 4258 | "momentum": "0.9" 4259 | }, 4260 | "inputs": [] 4261 | }, 4262 | { 4263 | "op": "null", 4264 | "name": "rf_c1_det_conv1_bn_moving_var", 4265 | "attrs": { 4266 | "__init__": "[\"one\", {}]", 4267 | "eps": "2e-05", 4268 | "fix_gamma": "False", 4269 | "momentum": "0.9" 4270 | }, 4271 | "inputs": [] 4272 | }, 4273 | { 4274 | "op": "BatchNorm", 4275 | "name": "rf_c1_det_conv1_bn", 4276 | "attrs": { 4277 | "eps": "2e-05", 4278 | "fix_gamma": "False", 4279 | "momentum": "0.9" 4280 | }, 4281 | "inputs": [[382, 0, 0], [383, 0, 0], [384, 0, 0], [385, 0, 1], [386, 0, 1]] 4282 | }, 4283 | { 4284 | "op": "null", 4285 | "name": "rf_c1_det_context_conv1_weight", 4286 | "attrs": { 4287 | "__init__": "[\"normal\", {\"sigma\": 0.01}]", 4288 | "__lr_mult__": "1.0" 4289 | }, 4290 | "inputs": [] 4291 | }, 4292 | { 4293 | "op": "null", 4294 | "name": "rf_c1_det_context_conv1_bias", 4295 | "attrs": { 4296 | "__init__": "[\"constant\", {\"value\": 0.0}]", 4297 | "__lr_mult__": "2.0", 4298 | "__wd_mult__": "0.0" 4299 | }, 4300 | "inputs": [] 4301 | }, 4302 | { 4303 | "op": "Convolution", 4304 | "name": "rf_c1_det_context_conv1", 4305 | "attrs": { 4306 | "kernel": "(3, 3)", 4307 | "num_filter": "16", 4308 | "pad": "(1, 1)", 4309 | "stride": "(1, 1)" 4310 | }, 4311 | "inputs": [[379, 0, 0], [388, 0, 0], [389, 0, 0]] 4312 | }, 4313 | { 4314 | "op": "null", 4315 | "name": "rf_c1_det_context_conv1_bn_gamma", 4316 | "attrs": { 4317 | "eps": "2e-05", 4318 | "fix_gamma": "False", 4319 | "momentum": "0.9" 4320 | }, 4321 | "inputs": [] 4322 | }, 4323 | { 4324 | "op": "null", 4325 | "name": "rf_c1_det_context_conv1_bn_beta", 4326 | "attrs": { 4327 | "eps": "2e-05", 4328 | "fix_gamma": "False", 4329 | "momentum": "0.9" 4330 | }, 4331 | "inputs": [] 4332 | }, 4333 | { 4334 | "op": "null", 4335 | "name": "rf_c1_det_context_conv1_bn_moving_mean", 4336 | "attrs": { 4337 | "__init__": "[\"zero\", {}]", 4338 | "eps": "2e-05", 4339 | "fix_gamma": "False", 4340 | "momentum": "0.9" 4341 | }, 4342 | "inputs": [] 4343 | }, 4344 | { 4345 | "op": "null", 4346 | "name": "rf_c1_det_context_conv1_bn_moving_var", 4347 | "attrs": { 4348 | "__init__": "[\"one\", {}]", 4349 | "eps": "2e-05", 4350 | "fix_gamma": "False", 4351 | "momentum": "0.9" 4352 | }, 4353 | "inputs": [] 4354 | }, 4355 | { 4356 | "op": "BatchNorm", 4357 | "name": "rf_c1_det_context_conv1_bn", 4358 | "attrs": { 4359 | "eps": "2e-05", 4360 | "fix_gamma": "False", 4361 | "momentum": "0.9" 4362 | }, 4363 | "inputs": [[390, 0, 0], [391, 0, 0], [392, 0, 0], [393, 0, 1], [394, 0, 1]] 4364 | }, 4365 | { 4366 | "op": "Activation", 4367 | "name": "rf_c1_det_context_conv1_relu", 4368 | "attrs": {"act_type": "relu"}, 4369 | "inputs": [[395, 0, 0]] 4370 | }, 4371 | { 4372 | "op": "null", 4373 | "name": "rf_c1_det_context_conv2_weight", 4374 | "attrs": { 4375 | "__init__": "[\"normal\", {\"sigma\": 0.01}]", 4376 | "__lr_mult__": "1.0" 4377 | }, 4378 | "inputs": [] 4379 | }, 4380 | { 4381 | "op": "null", 4382 | "name": "rf_c1_det_context_conv2_bias", 4383 | "attrs": { 4384 | "__init__": "[\"constant\", {\"value\": 0.0}]", 4385 | "__lr_mult__": "2.0", 4386 | "__wd_mult__": "0.0" 4387 | }, 4388 | "inputs": [] 4389 | }, 4390 | { 4391 | "op": "Convolution", 4392 | "name": "rf_c1_det_context_conv2", 4393 | "attrs": { 4394 | "kernel": "(3, 3)", 4395 | "num_filter": "16", 4396 | "pad": "(1, 1)", 4397 | "stride": "(1, 1)" 4398 | }, 4399 | "inputs": [[396, 0, 0], [397, 0, 0], [398, 0, 0]] 4400 | }, 4401 | { 4402 | "op": "null", 4403 | "name": "rf_c1_det_context_conv2_bn_gamma", 4404 | "attrs": { 4405 | "eps": "2e-05", 4406 | "fix_gamma": "False", 4407 | "momentum": "0.9" 4408 | }, 4409 | "inputs": [] 4410 | }, 4411 | { 4412 | "op": "null", 4413 | "name": "rf_c1_det_context_conv2_bn_beta", 4414 | "attrs": { 4415 | "eps": "2e-05", 4416 | "fix_gamma": "False", 4417 | "momentum": "0.9" 4418 | }, 4419 | "inputs": [] 4420 | }, 4421 | { 4422 | "op": "null", 4423 | "name": "rf_c1_det_context_conv2_bn_moving_mean", 4424 | "attrs": { 4425 | "__init__": "[\"zero\", {}]", 4426 | "eps": "2e-05", 4427 | "fix_gamma": "False", 4428 | "momentum": "0.9" 4429 | }, 4430 | "inputs": [] 4431 | }, 4432 | { 4433 | "op": "null", 4434 | "name": "rf_c1_det_context_conv2_bn_moving_var", 4435 | "attrs": { 4436 | "__init__": "[\"one\", {}]", 4437 | "eps": "2e-05", 4438 | "fix_gamma": "False", 4439 | "momentum": "0.9" 4440 | }, 4441 | "inputs": [] 4442 | }, 4443 | { 4444 | "op": "BatchNorm", 4445 | "name": "rf_c1_det_context_conv2_bn", 4446 | "attrs": { 4447 | "eps": "2e-05", 4448 | "fix_gamma": "False", 4449 | "momentum": "0.9" 4450 | }, 4451 | "inputs": [[399, 0, 0], [400, 0, 0], [401, 0, 0], [402, 0, 1], [403, 0, 1]] 4452 | }, 4453 | { 4454 | "op": "null", 4455 | "name": "rf_c1_det_context_conv3_1_weight", 4456 | "attrs": { 4457 | "__init__": "[\"normal\", {\"sigma\": 0.01}]", 4458 | "__lr_mult__": "1.0" 4459 | }, 4460 | "inputs": [] 4461 | }, 4462 | { 4463 | "op": "null", 4464 | "name": "rf_c1_det_context_conv3_1_bias", 4465 | "attrs": { 4466 | "__init__": "[\"constant\", {\"value\": 0.0}]", 4467 | "__lr_mult__": "2.0", 4468 | "__wd_mult__": "0.0" 4469 | }, 4470 | "inputs": [] 4471 | }, 4472 | { 4473 | "op": "Convolution", 4474 | "name": "rf_c1_det_context_conv3_1", 4475 | "attrs": { 4476 | "kernel": "(3, 3)", 4477 | "num_filter": "16", 4478 | "pad": "(1, 1)", 4479 | "stride": "(1, 1)" 4480 | }, 4481 | "inputs": [[396, 0, 0], [405, 0, 0], [406, 0, 0]] 4482 | }, 4483 | { 4484 | "op": "null", 4485 | "name": "rf_c1_det_context_conv3_1_bn_gamma", 4486 | "attrs": { 4487 | "eps": "2e-05", 4488 | "fix_gamma": "False", 4489 | "momentum": "0.9" 4490 | }, 4491 | "inputs": [] 4492 | }, 4493 | { 4494 | "op": "null", 4495 | "name": "rf_c1_det_context_conv3_1_bn_beta", 4496 | "attrs": { 4497 | "eps": "2e-05", 4498 | "fix_gamma": "False", 4499 | "momentum": "0.9" 4500 | }, 4501 | "inputs": [] 4502 | }, 4503 | { 4504 | "op": "null", 4505 | "name": "rf_c1_det_context_conv3_1_bn_moving_mean", 4506 | "attrs": { 4507 | "__init__": "[\"zero\", {}]", 4508 | "eps": "2e-05", 4509 | "fix_gamma": "False", 4510 | "momentum": "0.9" 4511 | }, 4512 | "inputs": [] 4513 | }, 4514 | { 4515 | "op": "null", 4516 | "name": "rf_c1_det_context_conv3_1_bn_moving_var", 4517 | "attrs": { 4518 | "__init__": "[\"one\", {}]", 4519 | "eps": "2e-05", 4520 | "fix_gamma": "False", 4521 | "momentum": "0.9" 4522 | }, 4523 | "inputs": [] 4524 | }, 4525 | { 4526 | "op": "BatchNorm", 4527 | "name": "rf_c1_det_context_conv3_1_bn", 4528 | "attrs": { 4529 | "eps": "2e-05", 4530 | "fix_gamma": "False", 4531 | "momentum": "0.9" 4532 | }, 4533 | "inputs": [[407, 0, 0], [408, 0, 0], [409, 0, 0], [410, 0, 1], [411, 0, 1]] 4534 | }, 4535 | { 4536 | "op": "Activation", 4537 | "name": "rf_c1_det_context_conv3_1_relu", 4538 | "attrs": {"act_type": "relu"}, 4539 | "inputs": [[412, 0, 0]] 4540 | }, 4541 | { 4542 | "op": "null", 4543 | "name": "rf_c1_det_context_conv3_2_weight", 4544 | "attrs": { 4545 | "__init__": "[\"normal\", {\"sigma\": 0.01}]", 4546 | "__lr_mult__": "1.0" 4547 | }, 4548 | "inputs": [] 4549 | }, 4550 | { 4551 | "op": "null", 4552 | "name": "rf_c1_det_context_conv3_2_bias", 4553 | "attrs": { 4554 | "__init__": "[\"constant\", {\"value\": 0.0}]", 4555 | "__lr_mult__": "2.0", 4556 | "__wd_mult__": "0.0" 4557 | }, 4558 | "inputs": [] 4559 | }, 4560 | { 4561 | "op": "Convolution", 4562 | "name": "rf_c1_det_context_conv3_2", 4563 | "attrs": { 4564 | "kernel": "(3, 3)", 4565 | "num_filter": "16", 4566 | "pad": "(1, 1)", 4567 | "stride": "(1, 1)" 4568 | }, 4569 | "inputs": [[413, 0, 0], [414, 0, 0], [415, 0, 0]] 4570 | }, 4571 | { 4572 | "op": "null", 4573 | "name": "rf_c1_det_context_conv3_2_bn_gamma", 4574 | "attrs": { 4575 | "eps": "2e-05", 4576 | "fix_gamma": "False", 4577 | "momentum": "0.9" 4578 | }, 4579 | "inputs": [] 4580 | }, 4581 | { 4582 | "op": "null", 4583 | "name": "rf_c1_det_context_conv3_2_bn_beta", 4584 | "attrs": { 4585 | "eps": "2e-05", 4586 | "fix_gamma": "False", 4587 | "momentum": "0.9" 4588 | }, 4589 | "inputs": [] 4590 | }, 4591 | { 4592 | "op": "null", 4593 | "name": "rf_c1_det_context_conv3_2_bn_moving_mean", 4594 | "attrs": { 4595 | "__init__": "[\"zero\", {}]", 4596 | "eps": "2e-05", 4597 | "fix_gamma": "False", 4598 | "momentum": "0.9" 4599 | }, 4600 | "inputs": [] 4601 | }, 4602 | { 4603 | "op": "null", 4604 | "name": "rf_c1_det_context_conv3_2_bn_moving_var", 4605 | "attrs": { 4606 | "__init__": "[\"one\", {}]", 4607 | "eps": "2e-05", 4608 | "fix_gamma": "False", 4609 | "momentum": "0.9" 4610 | }, 4611 | "inputs": [] 4612 | }, 4613 | { 4614 | "op": "BatchNorm", 4615 | "name": "rf_c1_det_context_conv3_2_bn", 4616 | "attrs": { 4617 | "eps": "2e-05", 4618 | "fix_gamma": "False", 4619 | "momentum": "0.9" 4620 | }, 4621 | "inputs": [[416, 0, 0], [417, 0, 0], [418, 0, 0], [419, 0, 1], [420, 0, 1]] 4622 | }, 4623 | { 4624 | "op": "Concat", 4625 | "name": "rf_c1_det_concat", 4626 | "attrs": { 4627 | "dim": "1", 4628 | "num_args": "3" 4629 | }, 4630 | "inputs": [[387, 0, 0], [404, 0, 0], [421, 0, 0]] 4631 | }, 4632 | { 4633 | "op": "Activation", 4634 | "name": "rf_c1_det_concat_relu", 4635 | "attrs": {"act_type": "relu"}, 4636 | "inputs": [[422, 0, 0]] 4637 | }, 4638 | { 4639 | "op": "null", 4640 | "name": "face_rpn_cls_score_stride8_weight", 4641 | "attrs": { 4642 | "__init__": "[\"normal\", {\"sigma\": 0.01}]", 4643 | "__lr_mult__": "1.0" 4644 | }, 4645 | "inputs": [] 4646 | }, 4647 | { 4648 | "op": "null", 4649 | "name": "face_rpn_cls_score_stride8_bias", 4650 | "attrs": { 4651 | "__init__": "[\"constant\", {\"value\": 0.0}]", 4652 | "__lr_mult__": "2.0", 4653 | "__wd_mult__": "0.0" 4654 | }, 4655 | "inputs": [] 4656 | }, 4657 | { 4658 | "op": "Convolution", 4659 | "name": "face_rpn_cls_score_stride8", 4660 | "attrs": { 4661 | "kernel": "(1, 1)", 4662 | "num_filter": "4", 4663 | "pad": "(0, 0)", 4664 | "stride": "(1, 1)" 4665 | }, 4666 | "inputs": [[423, 0, 0], [424, 0, 0], [425, 0, 0]] 4667 | }, 4668 | { 4669 | "op": "Reshape", 4670 | "name": "face_rpn_cls_score_reshape_stride8", 4671 | "attrs": {"shape": "(0, 2, -1, 0)"}, 4672 | "inputs": [[426, 0, 0]] 4673 | }, 4674 | { 4675 | "op": "softmax", 4676 | "name": "face_rpn_cls_prob_stride8", 4677 | "attrs": {"axis":"1"}, 4678 | "inputs": [[427, 0, 0]] 4679 | }, 4680 | { 4681 | "op": "Reshape", 4682 | "name": "face_rpn_cls_prob_reshape_stride8", 4683 | "attrs": {"shape": "(0, 4, -1, 0)"}, 4684 | "inputs": [[428, 0, 0]] 4685 | }, 4686 | { 4687 | "op": "null", 4688 | "name": "face_rpn_bbox_pred_stride8_weight", 4689 | "attrs": { 4690 | "__init__": "[\"normal\", {\"sigma\": 0.01}]", 4691 | "__lr_mult__": "1.0" 4692 | }, 4693 | "inputs": [] 4694 | }, 4695 | { 4696 | "op": "null", 4697 | "name": "face_rpn_bbox_pred_stride8_bias", 4698 | "attrs": { 4699 | "__init__": "[\"constant\", {\"value\": 0.0}]", 4700 | "__lr_mult__": "2.0", 4701 | "__wd_mult__": "0.0" 4702 | }, 4703 | "inputs": [] 4704 | }, 4705 | { 4706 | "op": "Convolution", 4707 | "name": "face_rpn_bbox_pred_stride8", 4708 | "attrs": { 4709 | "kernel": "(1, 1)", 4710 | "num_filter": "8", 4711 | "pad": "(0, 0)", 4712 | "stride": "(1, 1)" 4713 | }, 4714 | "inputs": [[423, 0, 0], [430, 0, 0], [431, 0, 0]] 4715 | }, 4716 | { 4717 | "op": "null", 4718 | "name": "face_rpn_landmark_pred_stride8_weight", 4719 | "attrs": { 4720 | "__init__": "[\"normal\", {\"sigma\": 0.01}]", 4721 | "__lr_mult__": "1.0" 4722 | }, 4723 | "inputs": [] 4724 | }, 4725 | { 4726 | "op": "null", 4727 | "name": "face_rpn_landmark_pred_stride8_bias", 4728 | "attrs": { 4729 | "__init__": "[\"constant\", {\"value\": 0.0}]", 4730 | "__lr_mult__": "2.0", 4731 | "__wd_mult__": "0.0" 4732 | }, 4733 | "inputs": [] 4734 | }, 4735 | { 4736 | "op": "Convolution", 4737 | "name": "face_rpn_landmark_pred_stride8", 4738 | "attrs": { 4739 | "kernel": "(1, 1)", 4740 | "num_filter": "20", 4741 | "pad": "(0, 0)", 4742 | "stride": "(1, 1)" 4743 | }, 4744 | "inputs": [[423, 0, 0], [433, 0, 0], [434, 0, 0]] 4745 | } 4746 | ], 4747 | "arg_nodes": [ 4748 | 0, 4749 | 1, 4750 | 3, 4751 | 4, 4752 | 5, 4753 | 6, 4754 | 9, 4755 | 11, 4756 | 12, 4757 | 13, 4758 | 14, 4759 | 17, 4760 | 19, 4761 | 20, 4762 | 21, 4763 | 22, 4764 | 25, 4765 | 27, 4766 | 28, 4767 | 29, 4768 | 30, 4769 | 33, 4770 | 35, 4771 | 36, 4772 | 37, 4773 | 38, 4774 | 41, 4775 | 43, 4776 | 44, 4777 | 45, 4778 | 46, 4779 | 49, 4780 | 51, 4781 | 52, 4782 | 53, 4783 | 54, 4784 | 57, 4785 | 59, 4786 | 60, 4787 | 61, 4788 | 62, 4789 | 65, 4790 | 67, 4791 | 68, 4792 | 69, 4793 | 70, 4794 | 73, 4795 | 75, 4796 | 76, 4797 | 77, 4798 | 78, 4799 | 81, 4800 | 83, 4801 | 84, 4802 | 85, 4803 | 86, 4804 | 89, 4805 | 91, 4806 | 92, 4807 | 93, 4808 | 94, 4809 | 97, 4810 | 99, 4811 | 100, 4812 | 101, 4813 | 102, 4814 | 105, 4815 | 107, 4816 | 108, 4817 | 109, 4818 | 110, 4819 | 113, 4820 | 115, 4821 | 116, 4822 | 117, 4823 | 118, 4824 | 121, 4825 | 123, 4826 | 124, 4827 | 125, 4828 | 126, 4829 | 129, 4830 | 131, 4831 | 132, 4832 | 133, 4833 | 134, 4834 | 137, 4835 | 139, 4836 | 140, 4837 | 141, 4838 | 142, 4839 | 145, 4840 | 147, 4841 | 148, 4842 | 149, 4843 | 150, 4844 | 153, 4845 | 155, 4846 | 156, 4847 | 157, 4848 | 158, 4849 | 161, 4850 | 163, 4851 | 164, 4852 | 165, 4853 | 166, 4854 | 169, 4855 | 171, 4856 | 172, 4857 | 173, 4858 | 174, 4859 | 177, 4860 | 179, 4861 | 180, 4862 | 181, 4863 | 182, 4864 | 185, 4865 | 187, 4866 | 188, 4867 | 189, 4868 | 190, 4869 | 193, 4870 | 195, 4871 | 196, 4872 | 197, 4873 | 198, 4874 | 201, 4875 | 203, 4876 | 204, 4877 | 205, 4878 | 206, 4879 | 209, 4880 | 211, 4881 | 212, 4882 | 213, 4883 | 214, 4884 | 217, 4885 | 218, 4886 | 220, 4887 | 221, 4888 | 222, 4889 | 223, 4890 | 226, 4891 | 227, 4892 | 229, 4893 | 230, 4894 | 231, 4895 | 232, 4896 | 234, 4897 | 235, 4898 | 237, 4899 | 238, 4900 | 239, 4901 | 240, 4902 | 243, 4903 | 244, 4904 | 246, 4905 | 247, 4906 | 248, 4907 | 249, 4908 | 251, 4909 | 252, 4910 | 254, 4911 | 255, 4912 | 256, 4913 | 257, 4914 | 260, 4915 | 261, 4916 | 263, 4917 | 264, 4918 | 265, 4919 | 266, 4920 | 270, 4921 | 271, 4922 | 276, 4923 | 277, 4924 | 279, 4925 | 280, 4926 | 282, 4927 | 283, 4928 | 285, 4929 | 286, 4930 | 287, 4931 | 288, 4932 | 294, 4933 | 295, 4934 | 297, 4935 | 298, 4936 | 299, 4937 | 300, 4938 | 303, 4939 | 304, 4940 | 306, 4941 | 307, 4942 | 308, 4943 | 309, 4944 | 311, 4945 | 312, 4946 | 314, 4947 | 315, 4948 | 316, 4949 | 317, 4950 | 320, 4951 | 321, 4952 | 323, 4953 | 324, 4954 | 325, 4955 | 326, 4956 | 328, 4957 | 329, 4958 | 331, 4959 | 332, 4960 | 333, 4961 | 334, 4962 | 337, 4963 | 338, 4964 | 340, 4965 | 341, 4966 | 342, 4967 | 343, 4968 | 347, 4969 | 348, 4970 | 353, 4971 | 354, 4972 | 356, 4973 | 357, 4974 | 359, 4975 | 360, 4976 | 362, 4977 | 363, 4978 | 364, 4979 | 365, 4980 | 371, 4981 | 372, 4982 | 374, 4983 | 375, 4984 | 376, 4985 | 377, 4986 | 380, 4987 | 381, 4988 | 383, 4989 | 384, 4990 | 385, 4991 | 386, 4992 | 388, 4993 | 389, 4994 | 391, 4995 | 392, 4996 | 393, 4997 | 394, 4998 | 397, 4999 | 398, 5000 | 400, 5001 | 401, 5002 | 402, 5003 | 403, 5004 | 405, 5005 | 406, 5006 | 408, 5007 | 409, 5008 | 410, 5009 | 411, 5010 | 414, 5011 | 415, 5012 | 417, 5013 | 418, 5014 | 419, 5015 | 420, 5016 | 424, 5017 | 425, 5018 | 430, 5019 | 431, 5020 | 433, 5021 | 434 5022 | ], 5023 | "node_row_ptr": [ 5024 | 0, 5025 | 1, 5026 | 2, 5027 | 3, 5028 | 4, 5029 | 5, 5030 | 6, 5031 | 7, 5032 | 10, 5033 | 11, 5034 | 12, 5035 | 13, 5036 | 14, 5037 | 15, 5038 | 16, 5039 | 17, 5040 | 20, 5041 | 21, 5042 | 22, 5043 | 23, 5044 | 24, 5045 | 25, 5046 | 26, 5047 | 27, 5048 | 30, 5049 | 31, 5050 | 32, 5051 | 33, 5052 | 34, 5053 | 35, 5054 | 36, 5055 | 37, 5056 | 40, 5057 | 41, 5058 | 42, 5059 | 43, 5060 | 44, 5061 | 45, 5062 | 46, 5063 | 47, 5064 | 50, 5065 | 51, 5066 | 52, 5067 | 53, 5068 | 54, 5069 | 55, 5070 | 56, 5071 | 57, 5072 | 60, 5073 | 61, 5074 | 62, 5075 | 63, 5076 | 64, 5077 | 65, 5078 | 66, 5079 | 67, 5080 | 70, 5081 | 71, 5082 | 72, 5083 | 73, 5084 | 74, 5085 | 75, 5086 | 76, 5087 | 77, 5088 | 80, 5089 | 81, 5090 | 82, 5091 | 83, 5092 | 84, 5093 | 85, 5094 | 86, 5095 | 87, 5096 | 90, 5097 | 91, 5098 | 92, 5099 | 93, 5100 | 94, 5101 | 95, 5102 | 96, 5103 | 97, 5104 | 100, 5105 | 101, 5106 | 102, 5107 | 103, 5108 | 104, 5109 | 105, 5110 | 106, 5111 | 107, 5112 | 110, 5113 | 111, 5114 | 112, 5115 | 113, 5116 | 114, 5117 | 115, 5118 | 116, 5119 | 117, 5120 | 120, 5121 | 121, 5122 | 122, 5123 | 123, 5124 | 124, 5125 | 125, 5126 | 126, 5127 | 127, 5128 | 130, 5129 | 131, 5130 | 132, 5131 | 133, 5132 | 134, 5133 | 135, 5134 | 136, 5135 | 137, 5136 | 140, 5137 | 141, 5138 | 142, 5139 | 143, 5140 | 144, 5141 | 145, 5142 | 146, 5143 | 147, 5144 | 150, 5145 | 151, 5146 | 152, 5147 | 153, 5148 | 154, 5149 | 155, 5150 | 156, 5151 | 157, 5152 | 160, 5153 | 161, 5154 | 162, 5155 | 163, 5156 | 164, 5157 | 165, 5158 | 166, 5159 | 167, 5160 | 170, 5161 | 171, 5162 | 172, 5163 | 173, 5164 | 174, 5165 | 175, 5166 | 176, 5167 | 177, 5168 | 180, 5169 | 181, 5170 | 182, 5171 | 183, 5172 | 184, 5173 | 185, 5174 | 186, 5175 | 187, 5176 | 190, 5177 | 191, 5178 | 192, 5179 | 193, 5180 | 194, 5181 | 195, 5182 | 196, 5183 | 197, 5184 | 200, 5185 | 201, 5186 | 202, 5187 | 203, 5188 | 204, 5189 | 205, 5190 | 206, 5191 | 207, 5192 | 210, 5193 | 211, 5194 | 212, 5195 | 213, 5196 | 214, 5197 | 215, 5198 | 216, 5199 | 217, 5200 | 220, 5201 | 221, 5202 | 222, 5203 | 223, 5204 | 224, 5205 | 225, 5206 | 226, 5207 | 227, 5208 | 230, 5209 | 231, 5210 | 232, 5211 | 233, 5212 | 234, 5213 | 235, 5214 | 236, 5215 | 237, 5216 | 240, 5217 | 241, 5218 | 242, 5219 | 243, 5220 | 244, 5221 | 245, 5222 | 246, 5223 | 247, 5224 | 250, 5225 | 251, 5226 | 252, 5227 | 253, 5228 | 254, 5229 | 255, 5230 | 256, 5231 | 257, 5232 | 260, 5233 | 261, 5234 | 262, 5235 | 263, 5236 | 264, 5237 | 265, 5238 | 266, 5239 | 267, 5240 | 270, 5241 | 271, 5242 | 272, 5243 | 273, 5244 | 274, 5245 | 275, 5246 | 276, 5247 | 277, 5248 | 278, 5249 | 281, 5250 | 282, 5251 | 283, 5252 | 284, 5253 | 285, 5254 | 286, 5255 | 287, 5256 | 288, 5257 | 289, 5258 | 292, 5259 | 293, 5260 | 294, 5261 | 295, 5262 | 296, 5263 | 297, 5264 | 298, 5265 | 299, 5266 | 302, 5267 | 303, 5268 | 304, 5269 | 305, 5270 | 306, 5271 | 307, 5272 | 308, 5273 | 309, 5274 | 310, 5275 | 313, 5276 | 314, 5277 | 315, 5278 | 316, 5279 | 317, 5280 | 318, 5281 | 319, 5282 | 320, 5283 | 323, 5284 | 324, 5285 | 325, 5286 | 326, 5287 | 327, 5288 | 328, 5289 | 329, 5290 | 330, 5291 | 331, 5292 | 334, 5293 | 335, 5294 | 336, 5295 | 337, 5296 | 338, 5297 | 339, 5298 | 340, 5299 | 341, 5300 | 342, 5301 | 343, 5302 | 344, 5303 | 345, 5304 | 346, 5305 | 347, 5306 | 348, 5307 | 349, 5308 | 350, 5309 | 351, 5310 | 352, 5311 | 353, 5312 | 354, 5313 | 355, 5314 | 358, 5315 | 359, 5316 | 360, 5317 | 361, 5318 | 362, 5319 | 363, 5320 | 364, 5321 | 365, 5322 | 366, 5323 | 367, 5324 | 368, 5325 | 369, 5326 | 372, 5327 | 373, 5328 | 374, 5329 | 375, 5330 | 376, 5331 | 377, 5332 | 378, 5333 | 379, 5334 | 380, 5335 | 383, 5336 | 384, 5337 | 385, 5338 | 386, 5339 | 387, 5340 | 388, 5341 | 389, 5342 | 390, 5343 | 393, 5344 | 394, 5345 | 395, 5346 | 396, 5347 | 397, 5348 | 398, 5349 | 399, 5350 | 400, 5351 | 401, 5352 | 404, 5353 | 405, 5354 | 406, 5355 | 407, 5356 | 408, 5357 | 409, 5358 | 410, 5359 | 411, 5360 | 414, 5361 | 415, 5362 | 416, 5363 | 417, 5364 | 418, 5365 | 419, 5366 | 420, 5367 | 421, 5368 | 422, 5369 | 425, 5370 | 426, 5371 | 427, 5372 | 428, 5373 | 429, 5374 | 430, 5375 | 431, 5376 | 432, 5377 | 433, 5378 | 434, 5379 | 435, 5380 | 436, 5381 | 437, 5382 | 438, 5383 | 439, 5384 | 440, 5385 | 441, 5386 | 442, 5387 | 443, 5388 | 444, 5389 | 445, 5390 | 446, 5391 | 449, 5392 | 450, 5393 | 451, 5394 | 452, 5395 | 453, 5396 | 454, 5397 | 455, 5398 | 456, 5399 | 457, 5400 | 458, 5401 | 459, 5402 | 460, 5403 | 463, 5404 | 464, 5405 | 465, 5406 | 466, 5407 | 467, 5408 | 468, 5409 | 469, 5410 | 470, 5411 | 471, 5412 | 474, 5413 | 475, 5414 | 476, 5415 | 477, 5416 | 478, 5417 | 479, 5418 | 480, 5419 | 481, 5420 | 484, 5421 | 485, 5422 | 486, 5423 | 487, 5424 | 488, 5425 | 489, 5426 | 490, 5427 | 491, 5428 | 492, 5429 | 495, 5430 | 496, 5431 | 497, 5432 | 498, 5433 | 499, 5434 | 500, 5435 | 501, 5436 | 502, 5437 | 505, 5438 | 506, 5439 | 507, 5440 | 508, 5441 | 509, 5442 | 510, 5443 | 511, 5444 | 512, 5445 | 513, 5446 | 516, 5447 | 517, 5448 | 518, 5449 | 519, 5450 | 520, 5451 | 521, 5452 | 522, 5453 | 523, 5454 | 524, 5455 | 525, 5456 | 526, 5457 | 527, 5458 | 528, 5459 | 529, 5460 | 530 5461 | ], 5462 | "heads": [[275, 0, 0], [278, 0, 0], [281, 0, 0], [352, 0, 0], [355, 0, 0], [358, 0, 0], [429, 0, 0], [432, 0, 0], [435, 0, 0]], 5463 | "attrs": {"mxnet_version": ["int", 10300]} 5464 | } -------------------------------------------------------------------------------- /retinaface.py: -------------------------------------------------------------------------------- 1 | import torch 2 | import torch.nn.functional as F 3 | import torch.nn as nn 4 | from torch.autograd import Variable 5 | import mxnet as mx 6 | from mxnet import gluon 7 | import numpy as np 8 | 9 | class RetinaFace_MobileNet(nn.Module): 10 | def __init__(self): 11 | super(RetinaFace_MobileNet, self).__init__() 12 | 13 | self.mobilenet0_conv0 = nn.Sequential( 14 | nn.Conv2d(in_channels=3, out_channels=8, kernel_size=3, stride=2, padding=1, bias=False), 15 | nn.BatchNorm2d(num_features=8, momentum=0.9), 16 | nn.ReLU(inplace=True)) 17 | 18 | self.mobilenet0_conv1 = nn.Sequential( 19 | nn.Conv2d(in_channels=8, out_channels=8, kernel_size=3, stride=1, padding=1, groups=8, bias=False), 20 | nn.BatchNorm2d(num_features=8, momentum=0.9), 21 | nn.ReLU(inplace=True)) 22 | 23 | self.mobilenet0_conv2 = nn.Sequential( 24 | nn.Conv2d(in_channels=8, out_channels=16, kernel_size=1, stride=1, padding=0, bias=False), 25 | nn.BatchNorm2d(num_features=16, momentum=0.9), 26 | nn.ReLU(inplace=True)) 27 | 28 | self.mobilenet0_conv3 = nn.Sequential( 29 | nn.Conv2d(in_channels=16, out_channels=16, kernel_size=3, stride=2, padding=1, groups=16, bias=False), 30 | nn.BatchNorm2d(num_features=16, momentum=0.9), 31 | nn.ReLU(inplace=True)) 32 | 33 | self.mobilenet0_conv4 = nn.Sequential( 34 | nn.Conv2d(in_channels=16, out_channels=32, kernel_size=1, stride=1, padding=0, bias=False), 35 | nn.BatchNorm2d(num_features=32, momentum=0.9), 36 | nn.ReLU(inplace=True)) 37 | 38 | self.mobilenet0_conv5 = nn.Sequential( 39 | nn.Conv2d(in_channels=32, out_channels=32, kernel_size=3, stride=1, padding=1, groups=32, bias=False), 40 | nn.BatchNorm2d(num_features=32, momentum=0.9), 41 | nn.ReLU(inplace=True)) 42 | 43 | self.mobilenet0_conv6 = nn.Sequential( 44 | nn.Conv2d(in_channels=32, out_channels=32, kernel_size=1, stride=1, padding=0, bias=False), 45 | nn.BatchNorm2d(num_features=32, momentum=0.9), 46 | nn.ReLU(inplace=True)) 47 | 48 | self.mobilenet0_conv7 = nn.Sequential( 49 | nn.Conv2d(in_channels=32, out_channels=32, kernel_size=3, stride=2, padding=1, groups=32, bias=False), 50 | nn.BatchNorm2d(num_features=32, momentum=0.9), 51 | nn.ReLU(inplace=True)) 52 | 53 | self.mobilenet0_conv8 = nn.Sequential( 54 | nn.Conv2d(in_channels=32, out_channels=64, kernel_size=1, stride=1, padding=0, bias=False), 55 | nn.BatchNorm2d(num_features=64, momentum=0.9), 56 | nn.ReLU(inplace=True)) 57 | 58 | self.mobilenet0_conv9 = nn.Sequential( 59 | nn.Conv2d(in_channels=64, out_channels=64, kernel_size=3, stride=1, padding=1, groups=64, bias=False), 60 | nn.BatchNorm2d(num_features=64, momentum=0.9), 61 | nn.ReLU(inplace=True)) 62 | 63 | self.mobilenet0_conv10 = nn.Sequential( 64 | nn.Conv2d(in_channels=64, out_channels=64, kernel_size=1, stride=1, padding=0, bias=False), 65 | nn.BatchNorm2d(num_features=64, momentum=0.9), 66 | nn.ReLU(inplace=True)) 67 | 68 | self.mobilenet0_conv11 = nn.Sequential( 69 | nn.Conv2d(in_channels=64, out_channels=64, kernel_size=3, stride=2, padding=1, groups=64, bias=False), 70 | nn.BatchNorm2d(num_features=64, momentum=0.9), 71 | nn.ReLU(inplace=True)) 72 | 73 | self.mobilenet0_conv12 = nn.Sequential( 74 | nn.Conv2d(in_channels=64, out_channels=128, kernel_size=1, stride=1, padding=0, bias=False), 75 | nn.BatchNorm2d(num_features=128, momentum=0.9), 76 | nn.ReLU(inplace=True)) 77 | 78 | self.mobilenet0_conv13 = nn.Sequential( 79 | nn.Conv2d(in_channels=128, out_channels=128, kernel_size=3, stride=1, padding=1, groups=128, bias=False), 80 | nn.BatchNorm2d(num_features=128, momentum=0.9), 81 | nn.ReLU(inplace=True)) 82 | 83 | self.mobilenet0_conv14 = nn.Sequential( 84 | nn.Conv2d(in_channels=128, out_channels=128, kernel_size=1, stride=1, padding=0, bias=False), 85 | nn.BatchNorm2d(num_features=128, momentum=0.9), 86 | nn.ReLU(inplace=True)) 87 | 88 | self.mobilenet0_conv15 = nn.Sequential( 89 | nn.Conv2d(in_channels=128, out_channels=128, kernel_size=3, stride=1, padding=1, groups=128, bias=False), 90 | nn.BatchNorm2d(num_features=128), 91 | nn.ReLU(inplace=True)) 92 | 93 | self.mobilenet0_conv16 = nn.Sequential( 94 | nn.Conv2d(in_channels=128, out_channels=128, kernel_size=1, stride=1, padding=0, bias=False), 95 | nn.BatchNorm2d(num_features=128, momentum=0.9), 96 | nn.ReLU(inplace=True)) 97 | 98 | self.mobilenet0_conv17 = nn.Sequential( 99 | nn.Conv2d(in_channels=128, out_channels=128, kernel_size=3, stride=1, padding=1, groups=128, bias=False), 100 | nn.BatchNorm2d(num_features=128, momentum=0.9), 101 | nn.ReLU(inplace=True)) 102 | 103 | self.mobilenet0_conv18 = nn.Sequential( 104 | nn.Conv2d(in_channels=128, out_channels=128, kernel_size=1, stride=1, padding=0, bias=False), 105 | nn.BatchNorm2d(num_features=128, momentum=0.9), 106 | nn.ReLU(inplace=True)) 107 | 108 | self.mobilenet0_conv19 = nn.Sequential( 109 | nn.Conv2d(in_channels=128, out_channels=128, kernel_size=3, stride=1, padding=1, groups=128, bias=False), 110 | nn.BatchNorm2d(num_features=128, momentum=0.9), 111 | nn.ReLU(inplace=True)) 112 | 113 | self.mobilenet0_conv20 = nn.Sequential( 114 | nn.Conv2d(in_channels=128, out_channels=128, kernel_size=1, stride=1, padding=0, bias=False), 115 | nn.BatchNorm2d(num_features=128, momentum=0.9), 116 | nn.ReLU(inplace=True)) 117 | 118 | self.mobilenet0_conv21 = nn.Sequential( 119 | nn.Conv2d(in_channels=128, out_channels=128, kernel_size=3, stride=1, padding=1, groups=128, bias=False), 120 | nn.BatchNorm2d(num_features=128, momentum=0.9), 121 | nn.ReLU(inplace=True)) 122 | 123 | self.mobilenet0_conv22 = nn.Sequential( 124 | nn.Conv2d(in_channels=128, out_channels=128, kernel_size=1, stride=1, padding=0, bias=False), 125 | nn.BatchNorm2d(num_features=128, momentum=0.9), 126 | nn.ReLU(inplace=True)) 127 | 128 | self.mobilenet0_conv23 = nn.Sequential( 129 | nn.Conv2d(in_channels=128, out_channels=128, kernel_size=3, stride=2, padding=1, groups=128, bias=False), 130 | nn.BatchNorm2d(num_features=128, momentum=0.9), 131 | nn.ReLU(inplace=True)) 132 | 133 | self.mobilenet0_conv24 = nn.Sequential( 134 | nn.Conv2d(in_channels=128, out_channels=256, kernel_size=1, stride=1, padding=0, bias=False), 135 | nn.BatchNorm2d(num_features=256, momentum=0.9), 136 | nn.ReLU(inplace=True)) 137 | 138 | self.mobilenet0_conv25 = nn.Sequential( 139 | nn.Conv2d(in_channels=256, out_channels=256, kernel_size=3, stride=1, padding=1, groups=256, bias=False), 140 | nn.BatchNorm2d(num_features=256, momentum=0.9), 141 | nn.ReLU(inplace=True)) 142 | 143 | self.mobilenet0_conv26 = nn.Sequential( 144 | nn.Conv2d(in_channels=256, out_channels=256, kernel_size=1, stride=1, padding=0, bias=False), 145 | nn.BatchNorm2d(num_features=256, momentum=0.9), 146 | nn.ReLU(inplace=True)) 147 | 148 | self.rf_c3_lateral = nn.Sequential( 149 | nn.Conv2d(in_channels=256, out_channels=64, kernel_size=1, stride=1, padding=0, bias=True), 150 | nn.BatchNorm2d(num_features=64, eps=2e-05, momentum=0.9), 151 | nn.ReLU(inplace=True)) 152 | 153 | self.rf_c3_det_conv1 = nn.Sequential( 154 | nn.Conv2d(in_channels=64, out_channels=32, kernel_size=3, stride=1, padding=1, bias=True), 155 | nn.BatchNorm2d(num_features=32, eps=2e-05, momentum=0.9)) 156 | 157 | self.rf_c3_det_context_conv1 = nn.Sequential( 158 | nn.Conv2d(in_channels=64, out_channels=16, kernel_size=3, stride=1, padding=1, bias=True), 159 | nn.BatchNorm2d(num_features=16, eps=2e-05, momentum=0.9), 160 | nn.ReLU(inplace=True)) 161 | 162 | self.rf_c3_det_context_conv2 = nn.Sequential( 163 | nn.Conv2d(in_channels=16, out_channels=16, kernel_size=3, stride=1, padding=1, bias=True), 164 | nn.BatchNorm2d(num_features=16, eps=2e-05, momentum=0.9), 165 | nn.ReLU(inplace=True)) 166 | 167 | self.rf_c3_det_context_conv3_1 = nn.Sequential( 168 | nn.Conv2d(in_channels=16, out_channels=16, kernel_size=3, stride=1, padding=1, bias=True), 169 | nn.BatchNorm2d(num_features=16, eps=2e-05, momentum=0.9), 170 | nn.ReLU(inplace=True)) 171 | 172 | self.rf_c3_det_context_conv3_2 = nn.Sequential( 173 | nn.Conv2d(in_channels=16, out_channels=16, kernel_size=3, stride=1, padding=1, bias=True), 174 | nn.BatchNorm2d(num_features=16, eps=2e-05, momentum=0.9), 175 | nn.ReLU(inplace=True)) 176 | 177 | self.rf_c3_det_concat_relu = nn.Sequential( 178 | nn.ReLU(inplace=True)) 179 | 180 | self.face_rpn_cls_score_stride32 = nn.Sequential( 181 | nn.Conv2d(in_channels=64, out_channels=4, kernel_size=1, stride=1, padding=0, bias=True)) 182 | 183 | self.face_rpn_cls_score_stride32_softmax = nn.Sequential( 184 | nn.Softmax(dim=1)) 185 | 186 | self.face_rpn_bbox_pred_stride32 = nn.Sequential( 187 | nn.Conv2d(in_channels=64, out_channels=8, kernel_size=1, stride=1, padding=0, bias=True)) 188 | 189 | self.face_rpn_landmark_pred_stride32 = nn.Sequential( 190 | nn.Conv2d(in_channels=64, out_channels=20, kernel_size=1, stride=1, padding=0, bias=True)) 191 | 192 | self.rf_c2_lateral = nn.Sequential( 193 | nn.Conv2d(in_channels=128, out_channels=64, kernel_size=1, stride=1, padding=0, bias=True), 194 | nn.BatchNorm2d(num_features=64), 195 | nn.ReLU(inplace=True)) 196 | 197 | self.rf_c3_upsampling = nn.Sequential( 198 | nn.Upsample(scale_factor=2, mode='nearest')) 199 | 200 | self.rf_c2_aggr = nn.Sequential( 201 | nn.Conv2d(in_channels=64, out_channels=64, kernel_size=3, stride=1, padding=1, bias=True), 202 | nn.BatchNorm2d(num_features=64, eps=2e-05, momentum=0.9), 203 | nn.ReLU(inplace=True)) 204 | 205 | self.rf_c2_det_conv1 = nn.Sequential( 206 | nn.Conv2d(in_channels=64, out_channels=32, kernel_size=3, stride=1, padding=1, bias=True), 207 | nn.BatchNorm2d(num_features=32, eps=2e-05, momentum=0.9)) 208 | 209 | self.rf_c2_det_context_conv1 = nn.Sequential( 210 | nn.Conv2d(in_channels=64, out_channels=16, kernel_size=3, stride=1, padding=1, bias=True), 211 | nn.BatchNorm2d(num_features=16, eps=2e-05, momentum=0.9), 212 | nn.ReLU(inplace=True)) 213 | 214 | self.rf_c2_det_context_conv2 = nn.Sequential( 215 | nn.Conv2d(in_channels=16, out_channels=16, kernel_size=3, stride=1, padding=1, bias=True), 216 | nn.BatchNorm2d(num_features=16, eps=2e-05, momentum=0.9)) 217 | 218 | self.rf_c2_det_context_conv3_1 = nn.Sequential( 219 | nn.Conv2d(in_channels=16, out_channels=16, kernel_size=3, stride=1, padding=1, bias=True), 220 | nn.BatchNorm2d(num_features=16, eps=2e-05, momentum=0.9), 221 | nn.ReLU(inplace=True)) 222 | 223 | self.rf_c2_det_context_conv3_2 = nn.Sequential( 224 | nn.Conv2d(in_channels=16, out_channels=16, kernel_size=3, stride=1, padding=1, bias=True), 225 | nn.BatchNorm2d(num_features=16, eps=2e-05, momentum=0.9)) 226 | 227 | self.rf_c2_det_concat_relu = nn.Sequential( 228 | nn.ReLU(inplace=True)) 229 | 230 | self.face_rpn_cls_score_stride16 = nn.Sequential( 231 | nn.Conv2d(in_channels=64, out_channels=4, kernel_size=1, stride=1, padding=0, bias=True)) 232 | 233 | self.face_rpn_cls_score_stride16_softmax = nn.Sequential( 234 | nn.Softmax(dim=1)) 235 | 236 | self.face_rpn_bbox_pred_stride16 = nn.Sequential( 237 | nn.Conv2d(in_channels=64, out_channels=8, kernel_size=1, stride=1, padding=0, bias=True)) 238 | 239 | self.face_rpn_landmark_pred_stride16 = nn.Sequential( 240 | nn.Conv2d(in_channels=64, out_channels=20, kernel_size=1, stride=1, padding=0, bias=True)) 241 | 242 | self.rf_c1_red_conv = nn.Sequential( 243 | nn.Conv2d(in_channels=64, out_channels=64, kernel_size=1, stride=1, padding=0, bias=True), 244 | nn.BatchNorm2d(num_features=64, eps=2e-05, momentum=0.9), 245 | nn.ReLU(inplace=True)) 246 | 247 | self.rf_c2_upsampling = nn.Sequential( 248 | nn.Upsample(scale_factor=2, mode='nearest')) 249 | 250 | self.rf_c1_aggr = nn.Sequential( 251 | nn.Conv2d(in_channels=64, out_channels=64, kernel_size=3, stride=1, padding=1, bias=True), 252 | nn.BatchNorm2d(num_features=64, eps=2e-05, momentum=0.9), 253 | nn.ReLU(inplace=True)) 254 | 255 | self.rf_c1_det_conv1 = nn.Sequential( 256 | nn.Conv2d(in_channels=64, out_channels=32, kernel_size=3, stride=1, padding=1, bias=True), 257 | nn.BatchNorm2d(num_features=32, eps=2e-05, momentum=0.9)) 258 | 259 | self.rf_c1_det_context_conv1 = nn.Sequential( 260 | nn.Conv2d(in_channels=64, out_channels=16, kernel_size=3, stride=1, padding=1, bias=True), 261 | nn.BatchNorm2d(num_features=16, eps=2e-05, momentum=0.9), 262 | nn.ReLU(inplace=True)) 263 | 264 | self.rf_c1_det_context_conv2 = nn.Sequential( 265 | nn.Conv2d(in_channels=16, out_channels=16, kernel_size=3, stride=1, padding=1, bias=True), 266 | nn.BatchNorm2d(num_features=16, eps=2e-05, momentum=0.9)) 267 | 268 | self.rf_c1_det_context_conv3_1 = nn.Sequential( 269 | nn.Conv2d(in_channels=16, out_channels=16, kernel_size=3, stride=1, padding=1, bias=True), 270 | nn.BatchNorm2d(num_features=16, eps=2e-05, momentum=0.9), 271 | nn.ReLU(inplace=True)) 272 | 273 | self.rf_c1_det_context_conv3_2 = nn.Sequential( 274 | nn.Conv2d(in_channels=16, out_channels=16, kernel_size=3, stride=1, padding=1, bias=True), 275 | nn.BatchNorm2d(num_features=16, eps=2e-05, momentum=0.9)) 276 | 277 | self.rf_c1_det_concat_relu = nn.Sequential( 278 | nn.ReLU(inplace=True)) 279 | 280 | self.face_rpn_cls_score_stride8 = nn.Sequential( 281 | nn.Conv2d(in_channels=64, out_channels=4, kernel_size=1, stride=1, padding=0, bias=True)) 282 | 283 | self.face_rpn_cls_score_stride8_softmax = nn.Sequential( 284 | nn.Softmax(dim=1)) 285 | 286 | self.face_rpn_bbox_pred_stride8 = nn.Sequential( 287 | nn.Conv2d(in_channels=64, out_channels=8, kernel_size=1, stride=1, padding=0, bias=True)) 288 | 289 | self.face_rpn_landmark_pred_stride8 = nn.Sequential( 290 | nn.Conv2d(in_channels=64, out_channels=20, kernel_size=1, stride=1, padding=0, bias=True)) 291 | 292 | def forward(self, x): 293 | batchsize = x.shape[0] 294 | x = self.mobilenet0_conv0(x) 295 | x = self.mobilenet0_conv1(x) 296 | x = self.mobilenet0_conv2(x) 297 | x = self.mobilenet0_conv3(x) 298 | x = self.mobilenet0_conv4(x) 299 | x = self.mobilenet0_conv5(x) 300 | x = self.mobilenet0_conv6(x) 301 | x = self.mobilenet0_conv7(x) 302 | x = self.mobilenet0_conv8(x) 303 | x = self.mobilenet0_conv9(x) 304 | x10 = self.mobilenet0_conv10(x) 305 | x = self.mobilenet0_conv11(x10) 306 | x = self.mobilenet0_conv12(x) 307 | x = self.mobilenet0_conv13(x) 308 | x = self.mobilenet0_conv14(x) 309 | x = self.mobilenet0_conv15(x) 310 | x = self.mobilenet0_conv16(x) 311 | x = self.mobilenet0_conv17(x) 312 | x = self.mobilenet0_conv18(x) 313 | x = self.mobilenet0_conv19(x) 314 | x = self.mobilenet0_conv20(x) 315 | x = self.mobilenet0_conv21(x) 316 | x22 = self.mobilenet0_conv22(x) 317 | x = self.mobilenet0_conv23(x22) 318 | x = self.mobilenet0_conv24(x) 319 | x = self.mobilenet0_conv25(x) 320 | x = self.mobilenet0_conv26(x) 321 | o1 = self.rf_c3_lateral(x) 322 | o2 = self.rf_c3_det_conv1(o1) 323 | o3 = self.rf_c3_det_context_conv1(o1) 324 | o4 = self.rf_c3_det_context_conv2(o3) 325 | o5 = self.rf_c3_det_context_conv3_1(o3) 326 | o6 = self.rf_c3_det_context_conv3_2(o5) 327 | o7 = torch.cat((o2, o4, o6), 1) 328 | o8 = self.rf_c3_det_concat_relu(o7) 329 | cls32 = self.face_rpn_cls_score_stride32(o8) 330 | cls32_shape = cls32.shape 331 | cls32 = torch.reshape(cls32, (batchsize, 2, -1, cls32_shape[3])) 332 | cls32 = self.face_rpn_cls_score_stride32_softmax(cls32) 333 | cls32 = torch.reshape(cls32, (batchsize, 4, -1, cls32_shape[3])) 334 | bbox32 = self.face_rpn_bbox_pred_stride32(o8) 335 | landmark32 = self.face_rpn_landmark_pred_stride32(o8) 336 | p1 = self.rf_c2_lateral(x22) 337 | p2 = self.rf_c3_upsampling(o1) 338 | p2 = F.adaptive_avg_pool2d(p2, (p1.shape[2], p1.shape[3])) 339 | 340 | p3 = p1 + p2 341 | p4 = self.rf_c2_aggr(p3) 342 | p5 = self.rf_c2_det_conv1(p4) 343 | p6 = self.rf_c2_det_context_conv1(p4) 344 | p7 = self.rf_c2_det_context_conv2(p6) 345 | p8 = self.rf_c2_det_context_conv3_1(p6) 346 | p9 = self.rf_c2_det_context_conv3_2(p8) 347 | p10 = torch.cat((p5, p7, p9), 1) 348 | p10 = self.rf_c2_det_concat_relu(p10) 349 | cls16 = self.face_rpn_cls_score_stride16(p10) 350 | cls16_shape = cls16.shape 351 | cls16 = torch.reshape(cls16, (batchsize, 2, -1, cls16_shape[3])) 352 | cls16 = self.face_rpn_cls_score_stride16_softmax(cls16) 353 | cls16 = torch.reshape(cls16, (batchsize, 4, -1, cls16_shape[3])) 354 | bbox16 = self.face_rpn_bbox_pred_stride16(p10) 355 | landmark16 = self.face_rpn_landmark_pred_stride16(p10) 356 | q1 = self.rf_c1_red_conv(x10) 357 | q2 = self.rf_c2_upsampling(p4) 358 | q2 = F.adaptive_avg_pool2d(q2, (q1.shape[2], q1.shape[3])) 359 | 360 | q3 = q1 + q2 361 | q4 = self.rf_c1_aggr(q3) 362 | q5 = self.rf_c1_det_conv1(q4) 363 | q6 = self.rf_c1_det_context_conv1(q4) 364 | q7 = self.rf_c1_det_context_conv2(q6) 365 | q8 = self.rf_c1_det_context_conv3_1(q6) 366 | q9 = self.rf_c1_det_context_conv3_2(q8) 367 | q10 = torch.cat((q5, q7, q9), 1) 368 | q10 = self.rf_c2_det_concat_relu(q10) 369 | cls8 = self.face_rpn_cls_score_stride8(q10) 370 | cls8_shape = cls8.shape 371 | cls8 = torch.reshape(cls8, (batchsize, 2, -1, cls8_shape[3])) 372 | cls8 = self.face_rpn_cls_score_stride8_softmax(cls8) 373 | cls8 = torch.reshape(cls8, (batchsize, 4, -1, cls8_shape[3])) 374 | bbox8 = self.face_rpn_bbox_pred_stride8(q10) 375 | landmark8 = self.face_rpn_landmark_pred_stride8(q10) 376 | 377 | detections = [] 378 | detections.append(cls32) 379 | detections.append(bbox32) 380 | detections.append(landmark32) 381 | 382 | detections.append(cls16) 383 | detections.append(bbox16) 384 | detections.append(landmark16) 385 | 386 | detections.append(cls8) 387 | detections.append(bbox8) 388 | detections.append(landmark8) 389 | 390 | return detections 391 | 392 | def load_retinaface_mbnet(): 393 | net = RetinaFace_MobileNet() 394 | ctx = mx.cpu() 395 | sym, arg_params, aux_params = mx.model.load_checkpoint("mnet.25", 0) 396 | args = arg_params.keys() 397 | auxs = aux_params.keys() 398 | weights = [] 399 | 400 | layers = sym.get_internals().list_outputs() 401 | for layer in layers: 402 | for arg in args: 403 | if layer == arg: 404 | weights.append(arg_params[arg].asnumpy()) 405 | 406 | for aux in auxs: 407 | if layer == aux: 408 | weights.append(aux_params[aux].asnumpy()) 409 | 410 | net_dict = net.state_dict() 411 | net_layers = list(net_dict.keys()) 412 | idx = 0 413 | for layer in net_layers: 414 | if 'num_batches_tracked' not in layer: 415 | net_dict[layer] = torch.from_numpy(weights[idx]).float() 416 | idx += 1 417 | net.load_state_dict(net_dict) 418 | net.eval() 419 | return net 420 | -------------------------------------------------------------------------------- /test_images/t1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bogireddytejareddy/retinaface-pytorch/21f4bff49b0a7eff00559d523e9228d60300eda9/test_images/t1.jpg -------------------------------------------------------------------------------- /test_images/t2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bogireddytejareddy/retinaface-pytorch/21f4bff49b0a7eff00559d523e9228d60300eda9/test_images/t2.jpg -------------------------------------------------------------------------------- /test_images/t3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bogireddytejareddy/retinaface-pytorch/21f4bff49b0a7eff00559d523e9228d60300eda9/test_images/t3.jpg -------------------------------------------------------------------------------- /test_images/t4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bogireddytejareddy/retinaface-pytorch/21f4bff49b0a7eff00559d523e9228d60300eda9/test_images/t4.jpg -------------------------------------------------------------------------------- /test_images/t5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bogireddytejareddy/retinaface-pytorch/21f4bff49b0a7eff00559d523e9228d60300eda9/test_images/t5.jpg -------------------------------------------------------------------------------- /test_images/t6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bogireddytejareddy/retinaface-pytorch/21f4bff49b0a7eff00559d523e9228d60300eda9/test_images/t6.jpg -------------------------------------------------------------------------------- /test_results/t1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bogireddytejareddy/retinaface-pytorch/21f4bff49b0a7eff00559d523e9228d60300eda9/test_results/t1.jpg -------------------------------------------------------------------------------- /test_results/t2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bogireddytejareddy/retinaface-pytorch/21f4bff49b0a7eff00559d523e9228d60300eda9/test_results/t2.jpg -------------------------------------------------------------------------------- /test_results/t3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bogireddytejareddy/retinaface-pytorch/21f4bff49b0a7eff00559d523e9228d60300eda9/test_results/t3.jpg -------------------------------------------------------------------------------- /test_results/t4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bogireddytejareddy/retinaface-pytorch/21f4bff49b0a7eff00559d523e9228d60300eda9/test_results/t4.jpg -------------------------------------------------------------------------------- /test_results/t5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bogireddytejareddy/retinaface-pytorch/21f4bff49b0a7eff00559d523e9228d60300eda9/test_results/t5.jpg -------------------------------------------------------------------------------- /test_results/t6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bogireddytejareddy/retinaface-pytorch/21f4bff49b0a7eff00559d523e9228d60300eda9/test_results/t6.jpg -------------------------------------------------------------------------------- /utils.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | from cython.anchors import anchors_cython 3 | from cython.cpu_nms import cpu_nms 4 | 5 | 6 | def py_nms_wrapper(thresh): 7 | def _nms(dets): 8 | return nms(dets, thresh) 9 | return _nms 10 | 11 | def cpu_nms_wrapper(thresh): 12 | def _nms(dets): 13 | return cpu_nms(dets, thresh) 14 | if cpu_nms is not None: 15 | return _nms 16 | else: 17 | return py_nms_wrapper(thresh) 18 | 19 | def anchors_plane(feat_h, feat_w, stride, base_anchor): 20 | return anchors_cython(feat_h, feat_w, stride, base_anchor) 21 | 22 | def generate_anchors(base_size=16, ratios=[0.5, 1, 2], 23 | scales=2 ** np.arange(3, 6), stride=16, dense_anchor=False): 24 | 25 | base_anchor = np.array([1, 1, base_size, base_size]) - 1 26 | ratio_anchors = _ratio_enum(base_anchor, ratios) 27 | anchors = np.vstack([_scale_enum(ratio_anchors[i, :], scales) 28 | for i in range(ratio_anchors.shape[0])]) 29 | if dense_anchor: 30 | assert stride%2==0 31 | anchors2 = anchors.copy() 32 | anchors2[:,:] += int(stride/2) 33 | anchors = np.vstack( (anchors, anchors2) ) 34 | 35 | return anchors 36 | 37 | def clip_boxes(boxes, im_shape): 38 | boxes[:, 0::4] = np.maximum(np.minimum(boxes[:, 0::4], im_shape[1] - 1), 0) 39 | boxes[:, 1::4] = np.maximum(np.minimum(boxes[:, 1::4], im_shape[0] - 1), 0) 40 | boxes[:, 2::4] = np.maximum(np.minimum(boxes[:, 2::4], im_shape[1] - 1), 0) 41 | boxes[:, 3::4] = np.maximum(np.minimum(boxes[:, 3::4], im_shape[0] - 1), 0) 42 | return boxes 43 | 44 | def _whctrs(anchor): 45 | w = anchor[2] - anchor[0] + 1 46 | h = anchor[3] - anchor[1] + 1 47 | x_ctr = anchor[0] + 0.5 * (w - 1) 48 | y_ctr = anchor[1] + 0.5 * (h - 1) 49 | return w, h, x_ctr, y_ctr 50 | 51 | 52 | def _mkanchors(ws, hs, x_ctr, y_ctr): 53 | ws = ws[:, np.newaxis] 54 | hs = hs[:, np.newaxis] 55 | anchors = np.hstack((x_ctr - 0.5 * (ws - 1), 56 | y_ctr - 0.5 * (hs - 1), 57 | x_ctr + 0.5 * (ws - 1), 58 | y_ctr + 0.5 * (hs - 1))) 59 | return anchors 60 | 61 | 62 | def _ratio_enum(anchor, ratios): 63 | w, h, x_ctr, y_ctr = _whctrs(anchor) 64 | size = w * h 65 | size_ratios = size / ratios 66 | ws = np.round(np.sqrt(size_ratios)) 67 | hs = np.round(ws * ratios) 68 | anchors = _mkanchors(ws, hs, x_ctr, y_ctr) 69 | return anchors 70 | 71 | 72 | def _scale_enum(anchor, scales): 73 | w, h, x_ctr, y_ctr = _whctrs(anchor) 74 | ws = w * scales 75 | hs = h * scales 76 | anchors = _mkanchors(ws, hs, x_ctr, y_ctr) 77 | return anchors 78 | 79 | 80 | def generate_anchors_fpn(dense_anchor=False, cfg = None): 81 | _ratio = (1.,) 82 | cfg = { 83 | '32': {'SCALES': (32,16), 'BASE_SIZE': 16, 'RATIOS': _ratio, 'ALLOWED_BORDER': 9999}, 84 | '16': {'SCALES': (8,4), 'BASE_SIZE': 16, 'RATIOS': _ratio, 'ALLOWED_BORDER': 9999}, 85 | '8': {'SCALES': (2,1), 'BASE_SIZE': 16, 'RATIOS': _ratio, 'ALLOWED_BORDER': 9999}, 86 | } 87 | 88 | RPN_FEAT_STRIDE = [] 89 | 90 | for k in cfg: 91 | RPN_FEAT_STRIDE.append( int(k) ) 92 | 93 | RPN_FEAT_STRIDE = sorted(RPN_FEAT_STRIDE, reverse=True) 94 | 95 | anchors = [] 96 | for k in RPN_FEAT_STRIDE: 97 | v = cfg[str(k)] 98 | bs = v['BASE_SIZE'] 99 | __ratios = np.array(v['RATIOS']) 100 | __scales = np.array(v['SCALES']) 101 | stride = int(k) 102 | r = generate_anchors(bs, __ratios, __scales, stride, dense_anchor) 103 | anchors.append(r) 104 | 105 | return anchors 106 | 107 | def nms(dets, thresh): 108 | x1 = dets[:, 0] 109 | y1 = dets[:, 1] 110 | x2 = dets[:, 2] 111 | y2 = dets[:, 3] 112 | scores = dets[:, 4] 113 | 114 | areas = (x2 - x1 + 1) * (y2 - y1 + 1) 115 | order = scores.argsort()[::-1] 116 | 117 | keep = [] 118 | while order.size > 0: 119 | i = order[0] 120 | keep.append(i) 121 | xx1 = np.maximum(x1[i], x1[order[1:]]) 122 | yy1 = np.maximum(y1[i], y1[order[1:]]) 123 | xx2 = np.minimum(x2[i], x2[order[1:]]) 124 | yy2 = np.minimum(y2[i], y2[order[1:]]) 125 | 126 | w = np.maximum(0.0, xx2 - xx1 + 1) 127 | h = np.maximum(0.0, yy2 - yy1 + 1) 128 | inter = w * h 129 | ovr = inter / (areas[i] + areas[order[1:]] - inter) 130 | 131 | inds = np.where(ovr <= thresh)[0] 132 | order = order[inds + 1] 133 | 134 | return keep 135 | 136 | class RetinaFace_Utils: 137 | def __init__(self): 138 | self.nms_threshold = 0.4 139 | self.vote = False 140 | self.nocrop = False 141 | self.debug = False 142 | self.fpn_keys = [] 143 | self.anchor_cfg = None 144 | self.preprocess = False 145 | _ratio = (1.,) 146 | 147 | self._feat_stride_fpn = [32, 16, 8] 148 | self.anchor_cfg = { 149 | '32' : {'SCALES' : (32, 16), 'BASE_SIZE' : 16, 'RATIOS': _ratio, 'ALLOWED_BORDER': 9999}, 150 | '16': {'SCALES': (8,4), 'BASE_SIZE': 16, 'RATIOS': _ratio, 'ALLOWED_BORDER': 9999}, 151 | '8': {'SCALES': (2,1), 'BASE_SIZE': 16, 'RATIOS': _ratio, 'ALLOWED_BORDER': 9999}, 152 | } 153 | 154 | for s in self._feat_stride_fpn: 155 | self.fpn_keys.append('stride%s'%s) 156 | 157 | dense_anchor = False 158 | self._anchors_fpn = dict(zip(self.fpn_keys, generate_anchors_fpn(dense_anchor=dense_anchor, cfg=self.anchor_cfg))) 159 | for k in self._anchors_fpn: 160 | v = self._anchors_fpn[k].astype(np.float32) 161 | self._anchors_fpn[k] = v 162 | 163 | self._num_anchors = dict(zip(self.fpn_keys, [anchors.shape[0] for anchors in self._anchors_fpn.values()])) 164 | self.nms = cpu_nms_wrapper(self.nms_threshold) 165 | self.use_landmarks = True 166 | 167 | def detect(self, img, output, threshold=0.5, im_scale=1.0): 168 | proposals_list = [] 169 | scores_list = [] 170 | landmarks_list = [] 171 | 172 | for idx, s in enumerate(self._feat_stride_fpn): 173 | key = 'stride%s'%s 174 | stride = int(s) 175 | 176 | if self.use_landmarks: 177 | idx = idx*3 178 | else: 179 | idx = idx*2 180 | 181 | scores = output[idx].cpu().detach().numpy() 182 | scores = scores[: , self._num_anchors['stride%s'%s]:, :, :] 183 | 184 | idx += 1 185 | bbox_deltas = output[idx].cpu().detach().numpy() 186 | 187 | height, width = bbox_deltas.shape[2], bbox_deltas.shape[3] 188 | 189 | A = self._num_anchors['stride%s'%s] 190 | K = height * width 191 | anchors_fpn = self._anchors_fpn['stride%s'%s] 192 | anchors = anchors_plane(height, width, stride, anchors_fpn) 193 | anchors = anchors.reshape((K * A, 4)) 194 | scores = self._clip_pad(scores, (height, width)) 195 | scores = scores.transpose((0, 2, 3, 1)).reshape((-1, 1)) 196 | 197 | bbox_deltas = self._clip_pad(bbox_deltas, (height, width)) 198 | bbox_deltas = bbox_deltas.transpose((0, 2, 3, 1)) 199 | bbox_pred_len = bbox_deltas.shape[3]//A 200 | bbox_deltas = bbox_deltas.reshape((-1, bbox_pred_len)) 201 | 202 | proposals = self.bbox_pred(anchors, bbox_deltas) 203 | proposals = clip_boxes(proposals, (img.shape[2], img.shape[3])) 204 | 205 | scores_ravel = scores.ravel() 206 | order = np.where(scores_ravel>=threshold)[0] 207 | proposals = proposals[order, :] 208 | scores = scores[order] 209 | if stride==4 and self.decay4<1.0: 210 | scores *= self.decay4 211 | 212 | proposals[:,0:4] /= im_scale 213 | 214 | proposals_list.append(proposals) 215 | scores_list.append(scores) 216 | 217 | if not self.vote and self.use_landmarks: 218 | idx+=1 219 | landmark_deltas = output[idx].cpu().detach().numpy() 220 | landmark_deltas = self._clip_pad(landmark_deltas, (height, width)) 221 | landmark_pred_len = landmark_deltas.shape[1]//A 222 | landmark_deltas = landmark_deltas.transpose((0, 2, 3, 1)).reshape((-1, 5, landmark_pred_len//5)) 223 | landmarks = self.landmark_pred(anchors, landmark_deltas) 224 | landmarks = landmarks[order, :] 225 | landmarks[:,:,0:2] /= im_scale 226 | landmarks_list.append(landmarks) 227 | 228 | proposals = np.vstack(proposals_list) 229 | landmarks = None 230 | if proposals.shape[0]==0: 231 | if self.use_landmarks: 232 | landmarks = np.zeros( (0,5,2) ) 233 | return np.zeros( (0,5) ), landmarks 234 | scores = np.vstack(scores_list) 235 | scores_ravel = scores.ravel() 236 | order = scores_ravel.argsort()[::-1] 237 | proposals = proposals[order, :] 238 | scores = scores[order] 239 | if not self.vote and self.use_landmarks: 240 | landmarks = np.vstack(landmarks_list) 241 | landmarks = landmarks[order].astype(np.float32, copy=False) 242 | 243 | pre_det = np.hstack((proposals[:,0:4], scores)).astype(np.float32, copy=False) 244 | if not self.vote: 245 | keep = self.nms(pre_det) 246 | det = np.hstack( (pre_det, proposals[:,4:]) ) 247 | det = det[keep, :] 248 | if self.use_landmarks: 249 | landmarks = landmarks[keep] 250 | else: 251 | det = np.hstack( (pre_det, proposals[:,4:]) ) 252 | det = self.bbox_vote(det) 253 | return det, landmarks 254 | 255 | 256 | @staticmethod 257 | def _clip_pad(tensor, pad_shape): 258 | H, W = tensor.shape[2:] 259 | h, w = pad_shape 260 | 261 | if h < H or w < W: 262 | tensor = tensor[:, :, :h, :w].copy() 263 | 264 | return tensor 265 | 266 | @staticmethod 267 | def bbox_pred(boxes, box_deltas): 268 | if boxes.shape[0] == 0: 269 | return np.zeros((0, box_deltas.shape[1])) 270 | 271 | boxes = boxes.astype(np.float, copy=False) 272 | widths = boxes[:, 2] - boxes[:, 0] + 1.0 273 | heights = boxes[:, 3] - boxes[:, 1] + 1.0 274 | ctr_x = boxes[:, 0] + 0.5 * (widths - 1.0) 275 | ctr_y = boxes[:, 1] + 0.5 * (heights - 1.0) 276 | 277 | dx = box_deltas[:, 0:1] 278 | dy = box_deltas[:, 1:2] 279 | dw = box_deltas[:, 2:3] 280 | dh = box_deltas[:, 3:4] 281 | 282 | pred_ctr_x = dx * widths[:, np.newaxis] + ctr_x[:, np.newaxis] 283 | pred_ctr_y = dy * heights[:, np.newaxis] + ctr_y[:, np.newaxis] 284 | pred_w = np.exp(dw) * widths[:, np.newaxis] 285 | pred_h = np.exp(dh) * heights[:, np.newaxis] 286 | 287 | pred_boxes = np.zeros(box_deltas.shape) 288 | pred_boxes[:, 0:1] = pred_ctr_x - 0.5 * (pred_w - 1.0) 289 | pred_boxes[:, 1:2] = pred_ctr_y - 0.5 * (pred_h - 1.0) 290 | pred_boxes[:, 2:3] = pred_ctr_x + 0.5 * (pred_w - 1.0) 291 | pred_boxes[:, 3:4] = pred_ctr_y + 0.5 * (pred_h - 1.0) 292 | 293 | if box_deltas.shape[1]>4: 294 | pred_boxes[:,4:] = box_deltas[:,4:] 295 | 296 | return pred_boxes 297 | 298 | @staticmethod 299 | def landmark_pred(boxes, landmark_deltas): 300 | if boxes.shape[0] == 0: 301 | return np.zeros((0, landmark_deltas.shape[1])) 302 | boxes = boxes.astype(np.float, copy=False) 303 | widths = boxes[:, 2] - boxes[:, 0] + 1.0 304 | heights = boxes[:, 3] - boxes[:, 1] + 1.0 305 | ctr_x = boxes[:, 0] + 0.5 * (widths - 1.0) 306 | ctr_y = boxes[:, 1] + 0.5 * (heights - 1.0) 307 | pred = landmark_deltas.copy() 308 | for i in range(5): 309 | pred[:,i,0] = landmark_deltas[:,i,0]*widths + ctr_x 310 | pred[:,i,1] = landmark_deltas[:,i,1]*heights + ctr_y 311 | return pred 312 | 313 | def bbox_vote(self, det): 314 | if det.shape[0] == 0: 315 | dets = np.array([[10, 10, 20, 20, 0.002]]) 316 | det = np.empty(shape=[0, 5]) 317 | while det.shape[0] > 0: 318 | area = (det[:, 2] - det[:, 0] + 1) * (det[:, 3] - det[:, 1] + 1) 319 | xx1 = np.maximum(det[0, 0], det[:, 0]) 320 | yy1 = np.maximum(det[0, 1], det[:, 1]) 321 | xx2 = np.minimum(det[0, 2], det[:, 2]) 322 | yy2 = np.minimum(det[0, 3], det[:, 3]) 323 | w = np.maximum(0.0, xx2 - xx1 + 1) 324 | h = np.maximum(0.0, yy2 - yy1 + 1) 325 | inter = w * h 326 | o = inter / (area[0] + area[:] - inter) 327 | 328 | merge_index = np.where(o >= self.nms_threshold)[0] 329 | det_accu = det[merge_index, :] 330 | det = np.delete(det, merge_index, 0) 331 | if merge_index.shape[0] <= 1: 332 | if det.shape[0] == 0: 333 | try: 334 | dets = np.row_stack((dets, det_accu)) 335 | except: 336 | dets = det_accu 337 | continue 338 | det_accu[:, 0:4] = det_accu[:, 0:4] * np.tile(det_accu[:, -1:], (1, 4)) 339 | max_score = np.max(det_accu[:, 4]) 340 | det_accu_sum = np.zeros((1, 5)) 341 | det_accu_sum[:, 0:4] = np.sum(det_accu[:, 0:4], 342 | axis=0) / np.sum(det_accu[:, -1:]) 343 | det_accu_sum[:, 4] = max_score 344 | try: 345 | dets = np.row_stack((dets, det_accu_sum)) 346 | except: 347 | dets = det_accu_sum 348 | dets = dets[0:750, :] 349 | return dets 350 | --------------------------------------------------------------------------------