├── .gitignore ├── Cargo.toml ├── images └── logo-512.jpg ├── ncnn-rs ├── examples │ ├── get_version.rs │ └── benchmark.rs ├── README.md ├── src │ ├── lib.rs │ ├── allocator.rs │ ├── option.rs │ ├── extractor.rs │ ├── datareader.rs │ └── net.rs └── Cargo.toml ├── ncnn-bind ├── README.md ├── src │ └── lib.rs ├── Cargo.toml └── build.rs ├── .github └── workflows │ └── ci.yaml ├── params ├── alexnet.param ├── vgg16_int8.param ├── vgg16.param ├── mobilenet_int8.param ├── mobilenet.param ├── mobilenet_yolo.param ├── resnet18_int8.param ├── yolov4-tiny.param ├── resnet18.param ├── squeezenet_int8.param ├── squeezenet.param ├── blazeface.param ├── mnasnet.param ├── mobilenetv2_yolov3.param ├── proxylessnasnet.param ├── mobilenet_ssd_int8.param ├── mobilenet_v2.param ├── resnet50_int8.param ├── mobilenet_ssd.param └── mobilenet_v3.param ├── README.md ├── Cargo.lock └── LICENSE.txt /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | .vscode -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | members = [ 3 | "ncnn-bind", 4 | "ncnn-rs", 5 | ] 6 | -------------------------------------------------------------------------------- /images/logo-512.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpoisonooo/rust-ncnn/HEAD/images/logo-512.jpg -------------------------------------------------------------------------------- /ncnn-rs/examples/get_version.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let version = ncnn_rs::version(); 3 | println!("{}", version); 4 | } 5 | -------------------------------------------------------------------------------- /ncnn-rs/README.md: -------------------------------------------------------------------------------- 1 | # ncnn-rs 2 | 3 | ncnn Rust API, check: 4 | 5 | * doc https://rust-ncnn.github.io/ncnn_rs/ 6 | * codebase https://github.com/tpoisonooo/rust-ncnn 7 | -------------------------------------------------------------------------------- /ncnn-bind/README.md: -------------------------------------------------------------------------------- 1 | # ncnn-bind 2 | 3 | generate ncnn bindings.rs with `bindgen`, please check: 4 | 5 | * doc https://rust-ncnn.github.io/ncnn_bind/ 6 | * codebase https://github.com/tpoisonooo/rust-ncnn 7 | -------------------------------------------------------------------------------- /ncnn-bind/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(non_upper_case_globals)] 2 | #![allow(non_camel_case_types)] 3 | #![allow(non_snake_case)] 4 | // Suppress bindgen test warnings 5 | #![allow(deref_nullptr)] 6 | 7 | include!(concat!(env!("OUT_DIR"), "/bindings.rs")); 8 | -------------------------------------------------------------------------------- /ncnn-rs/src/lib.rs: -------------------------------------------------------------------------------- 1 | mod allocator; 2 | mod datareader; 3 | mod extractor; 4 | mod mat; 5 | mod net; 6 | mod option; 7 | 8 | pub use allocator::*; 9 | pub use datareader::*; 10 | pub use extractor::*; 11 | pub use mat::*; 12 | pub use net::*; 13 | pub use option::*; 14 | 15 | pub use ncnn_bind as ffi; 16 | 17 | use std::ffi::CStr; 18 | 19 | pub fn version() -> &'static str { 20 | let c_buf = unsafe { ffi::ncnn_version() }; 21 | let c_str = unsafe { CStr::from_ptr(c_buf) }; 22 | let str_slice: &str = c_str.to_str().unwrap(); 23 | str_slice 24 | } 25 | -------------------------------------------------------------------------------- /ncnn-bind/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ncnn-bind" 3 | version = "0.1.2" 4 | authors = ["tpoisonooo "] 5 | edition = "2021" 6 | description = "ncnn Rust binding" 7 | license = "Apache-2.0" 8 | homepage = "https://github.com/tpoisonooo/rust-ncnn" 9 | repository = "https://github.com/tpoisonooo/rust-ncnn" 10 | keywords = ["binding", "ncnn"] 11 | 12 | [features] 13 | # Explicitly use static linking 14 | static = [] 15 | # Explicitly use dynamic linking 16 | dynamic = [] 17 | # Enable vulkan backend 18 | vulkan = [] 19 | # Enable vulkan backend using a system provided glslang 20 | vulkan-system-glslang = [] 21 | # Enable vulkan backend using a statically linked glslang 22 | vulkan-static-glslang = [] 23 | 24 | [dependencies] 25 | libc = "0.2" 26 | 27 | [build-dependencies] 28 | cmake = "0.1" 29 | bindgen = { version = "0.59.2", default-features = false, features = ["runtime"] } 30 | vcpkg = "0.2.15" 31 | -------------------------------------------------------------------------------- /.github/workflows/ci.yaml: -------------------------------------------------------------------------------- 1 | on: [push, pull_request] 2 | 3 | name: CI 4 | 5 | permissions: 6 | contents: read 7 | pages: write 8 | id-token: write 9 | 10 | jobs: 11 | build_and_test: 12 | name: Build and test 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Checkout 16 | uses: actions/checkout@v2 17 | - name: Rust toolchain 18 | uses: actions-rs/toolchain@v1 19 | with: 20 | toolchain: stable 21 | - name: Build 22 | uses: actions-rs/cargo@v1 23 | with: 24 | command: build 25 | - name: Test 26 | uses: actions-rs/cargo@v1 27 | with: 28 | command: test 29 | - name: Generate docs 30 | uses: actions-rs/cargo@v1 31 | with: 32 | command: doc 33 | args: --no-deps 34 | - name: Upload docs artifact 35 | uses: actions/upload-artifact@v3 36 | with: 37 | name: docs 38 | path: target/doc 39 | -------------------------------------------------------------------------------- /ncnn-rs/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ncnn-rs" 3 | version = "0.1.2" 4 | authors = ["tpoisonooo "] 5 | edition = "2021" 6 | description = "ncnn Rust API" 7 | license = "Apache-2.0" 8 | homepage = "https://github.com/tpoisonooo/rust-ncnn" 9 | repository = "https://github.com/tpoisonooo/rust-ncnn" 10 | keywords = ["binding", "ncnn", "API"] 11 | 12 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 13 | 14 | [dependencies] 15 | anyhow = "1" 16 | ncnn-bind = { path = "../ncnn-bind" } 17 | libc = "0.2" 18 | 19 | [features] 20 | # Explicitly use static linking 21 | static = [ "ncnn-bind/static" ] 22 | # Explicitly use dynamic linking 23 | dynamic = [ "ncnn-bind/dynamic" ] 24 | 25 | # Enable vulkan backend 26 | vulkan = [ "ncnn-bind/vulkan" ] 27 | # Enable vulkan backend using a system provided glslang 28 | vulkan-system-glslang = [ "ncnn-bind/vulkan-system-glslang" ] 29 | # Enable vulkan backend using a statically linked glslang 30 | vulkan-static-glslang = [ "ncnn-bind/vulkan-static-glslang" ] 31 | -------------------------------------------------------------------------------- /ncnn-rs/src/allocator.rs: -------------------------------------------------------------------------------- 1 | use ncnn_bind::*; 2 | 3 | pub struct Allocator { 4 | ptr: ncnn_allocator_t, 5 | } 6 | 7 | impl Allocator { 8 | /// Creates a new pool allocator. 9 | /// 10 | /// # Safety 11 | /// 12 | /// Using the allocator when creating matrix results in a segmentation fault. 13 | pub unsafe fn new() -> crate::allocator::Allocator { 14 | Allocator { 15 | ptr: ncnn_allocator_create_pool_allocator(), 16 | } 17 | } 18 | 19 | /// Creates a new unlocked pool allocator. 20 | /// 21 | /// # Safety 22 | /// 23 | /// Using the allocator when creating matrix results in a segmentation fault. 24 | pub unsafe fn new_unlocked() -> crate::allocator::Allocator { 25 | Allocator { 26 | ptr: ncnn_allocator_create_unlocked_pool_allocator(), 27 | } 28 | } 29 | 30 | pub(crate) fn ptr(&self) -> ncnn_allocator_t { 31 | self.ptr 32 | } 33 | } 34 | 35 | impl Drop for Allocator { 36 | fn drop(&mut self) { 37 | unsafe { 38 | ncnn_allocator_destroy(self.ptr); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /ncnn-rs/src/option.rs: -------------------------------------------------------------------------------- 1 | use ncnn_bind::*; 2 | use std::os::raw::c_int; 3 | 4 | pub struct Option { 5 | ptr: ncnn_option_t, 6 | } 7 | 8 | impl Option { 9 | pub fn new() -> Option { 10 | let ptr; 11 | unsafe { 12 | ptr = ncnn_option_create(); 13 | } 14 | Option { ptr } 15 | } 16 | 17 | pub fn set_num_threads(&mut self, num_threads: u32) { 18 | unsafe { 19 | ncnn_option_set_num_threads(self.ptr, num_threads as c_int); 20 | } 21 | } 22 | 23 | pub fn get_num_threads(&self) -> u32 { 24 | unsafe { ncnn_option_get_num_threads(self.ptr) as u32 } 25 | } 26 | 27 | pub fn set_vulkan_compute(&mut self, enabled: bool) { 28 | unsafe { 29 | ncnn_option_set_use_vulkan_compute(self.ptr, enabled as c_int); 30 | } 31 | } 32 | 33 | pub fn get_vulkan_compute(&self) -> bool { 34 | unsafe { ncnn_option_get_use_vulkan_compute(self.ptr) != 0 } 35 | } 36 | 37 | pub(crate) fn ptr(&self) -> ncnn_option_t { 38 | self.ptr 39 | } 40 | } 41 | 42 | impl Drop for Option { 43 | fn drop(&mut self) { 44 | unsafe { 45 | ncnn_option_destroy(self.ptr); 46 | } 47 | } 48 | } 49 | 50 | #[cfg(test)] 51 | mod tests { 52 | #[test] 53 | fn get_cpu_info() { 54 | use crate::option::*; 55 | let mut opt = Option::new(); 56 | opt.set_num_threads(4); 57 | assert_eq!(4, opt.get_num_threads()); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /ncnn-rs/src/extractor.rs: -------------------------------------------------------------------------------- 1 | use ncnn_bind::*; 2 | use std::{ffi::CString, marker::PhantomData}; 3 | 4 | pub struct Extractor<'a> { 5 | ptr: ncnn_extractor_t, 6 | _phantom: PhantomData<&'a ()>, 7 | } 8 | 9 | impl<'a> Extractor<'a> { 10 | pub(crate) fn from_ptr(ptr: ncnn_extractor_t) -> Self { 11 | Self { 12 | ptr, 13 | _phantom: PhantomData::default(), 14 | } 15 | } 16 | 17 | /// Sets extractor option. 18 | pub fn set_option(&mut self, opt: &crate::option::Option) { 19 | unsafe { ncnn_extractor_set_option(self.ptr, opt.ptr()) }; 20 | } 21 | 22 | /// Sets input tensor by a given name. 23 | pub fn input(&mut self, name: &str, mat: &'a crate::mat::Mat) -> anyhow::Result<()> { 24 | let c_str = CString::new(name).unwrap(); 25 | if unsafe { ncnn_extractor_input(self.ptr, c_str.as_ptr(), mat.ptr()) } != 0 { 26 | anyhow::bail!("Error setting input for layer `{}`", name); 27 | } else { 28 | Ok(()) 29 | } 30 | } 31 | 32 | /// Runs network inferrence and returns output tensor by a given name. 33 | pub fn extract(self, name: &str, mat: &mut crate::mat::Mat) -> anyhow::Result<()> { 34 | let c_str = CString::new(name).unwrap(); 35 | if unsafe { ncnn_extractor_extract(self.ptr, c_str.as_ptr(), mat.mut_ptr()) } != 0 { 36 | anyhow::bail!("Error running extract on layer `{}`", name); 37 | } else { 38 | Ok(()) 39 | } 40 | } 41 | } 42 | 43 | impl<'a> Drop for Extractor<'a> { 44 | fn drop(&mut self) { 45 | unsafe { 46 | ncnn_extractor_destroy(self.ptr); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /params/alexnet.param: -------------------------------------------------------------------------------- 1 | 7767517 2 | 15 15 3 | Input data 0 1 data -23330=4,3,227,227,3 0=227 1=227 2=3 4 | Convolution conv1 1 1 data conv1_relu1 -23330=4,3,55,55,96 0=96 1=11 3=4 5=1 6=34848 9=1 5 | LRN norm1 1 1 conv1_relu1 norm1 -23330=4,3,55,55,96 2=1.000000e-04 6 | Pooling pool1 1 1 norm1 pool1 -23330=4,3,27,27,96 1=3 2=2 7 | ConvolutionDepthWise conv2 1 1 pool1 conv2_relu2 -23330=4,3,27,27,256 0=256 1=5 4=2 5=1 6=307200 7=2 9=1 8 | LRN norm2 1 1 conv2_relu2 norm2 -23330=4,3,27,27,256 2=1.000000e-04 9 | Pooling pool2 1 1 norm2 pool2 -23330=4,3,13,13,256 1=3 2=2 10 | Convolution conv3 1 1 pool2 conv3_relu3 -23330=4,3,13,13,384 0=384 1=3 4=1 5=1 6=884736 9=1 11 | ConvolutionDepthWise conv4 1 1 conv3_relu3 conv4_relu4 -23330=4,3,13,13,384 0=384 1=3 4=1 5=1 6=663552 7=2 9=1 12 | ConvolutionDepthWise conv5 1 1 conv4_relu4 conv5_relu5 -23330=4,3,13,13,256 0=256 1=3 4=1 5=1 6=442368 7=2 9=1 13 | Pooling pool5 1 1 conv5_relu5 pool5 -23330=4,3,6,6,256 1=3 2=2 14 | InnerProduct fc6 1 1 pool5 fc6_drop6 -23330=4,1,4096,1,1 0=4096 1=1 2=37748736 9=1 15 | InnerProduct fc7 1 1 fc6_drop6 fc7_drop7 -23330=4,1,4096,1,1 0=4096 1=1 2=16777216 9=1 16 | InnerProduct fc8 1 1 fc7_drop7 fc8 -23330=4,1,1000,1,1 0=1000 1=1 2=4096000 17 | Softmax prob 1 1 fc8 output -23330=4,1,1000,1,1 18 | -------------------------------------------------------------------------------- /ncnn-rs/src/datareader.rs: -------------------------------------------------------------------------------- 1 | use libc::memset; 2 | use ncnn_bind::*; 3 | 4 | pub type ScanFn = unsafe extern "C" fn( 5 | dr: ncnn_datareader_t, 6 | format: *const ::std::os::raw::c_char, 7 | p: *mut ::std::os::raw::c_void, 8 | ) -> ::std::os::raw::c_int; 9 | 10 | pub type ReadFn = unsafe extern "C" fn( 11 | dr: ncnn_datareader_t, 12 | buf: *mut ::std::os::raw::c_void, 13 | size: size_t, 14 | ) -> size_t; 15 | 16 | unsafe extern "C" fn empty_scan( 17 | _dr: ncnn_datareader_t, 18 | _format: *const ::std::os::raw::c_char, 19 | _p: *mut ::std::os::raw::c_void, 20 | ) -> ::std::os::raw::c_int { 21 | 0 22 | } 23 | 24 | unsafe extern "C" fn empty_read( 25 | _dr: ncnn_datareader_t, 26 | buf: *mut ::std::os::raw::c_void, 27 | size: size_t, 28 | ) -> size_t { 29 | memset(buf, 0, size as usize); 30 | size 31 | } 32 | 33 | pub struct DataReader { 34 | ptr: ncnn_datareader_t, 35 | } 36 | 37 | impl DataReader { 38 | /// Creates an new [DataReader]. 39 | /// 40 | /// # Safety 41 | /// 42 | /// Must not be used until scan and read functions are set. 43 | pub unsafe fn new() -> Self { 44 | Self { 45 | ptr: ncnn_datareader_create(), 46 | } 47 | } 48 | 49 | /// Creates an empty [DataReader] that always reads zero bytes. 50 | pub fn empty() -> Self { 51 | Self { 52 | ptr: unsafe { 53 | let ptr = ncnn_datareader_create(); 54 | (*ptr).scan = Some(empty_scan); 55 | (*ptr).read = Some(empty_read); 56 | ptr 57 | }, 58 | } 59 | } 60 | 61 | pub unsafe fn set_scan(&mut self, function_ptr: Option) { 62 | (*(self.ptr)).scan = function_ptr; 63 | } 64 | 65 | pub unsafe fn set_read(&mut self, function_ptr: Option) { 66 | (*(self.ptr)).read = function_ptr; 67 | } 68 | 69 | pub(crate) fn ptr(&self) -> ncnn_datareader_t { 70 | self.ptr 71 | } 72 | } 73 | 74 | impl Drop for DataReader { 75 | fn drop(&mut self) { 76 | unsafe { 77 | ncnn_datareader_destroy(self.ptr); 78 | } 79 | } 80 | } 81 | 82 | #[cfg(test)] 83 | mod tests { 84 | #[test] 85 | fn empty_datareader() { 86 | use crate::datareader::*; 87 | let _ = DataReader::empty(); 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /params/vgg16_int8.param: -------------------------------------------------------------------------------- 1 | 7767517 2 | 23 23 3 | Input data 0 1 data 0=224 1=224 2=3 4 | Convolution conv1_1 1 1 data conv1_1_relu1_1 0=64 1=3 4=1 5=1 6=1728 8=102 9=1 5 | Convolution conv1_2 1 1 conv1_1_relu1_1 conv1_2_relu1_2 0=64 1=3 4=1 5=1 6=36864 8=2 9=1 6 | Pooling pool1 1 1 conv1_2_relu1_2 pool1 1=2 2=2 7 | Convolution conv2_1 1 1 pool1 conv2_1_relu2_1 0=128 1=3 4=1 5=1 6=73728 8=102 9=1 8 | Convolution conv2_2 1 1 conv2_1_relu2_1 conv2_2_relu2_2 0=128 1=3 4=1 5=1 6=147456 8=2 9=1 9 | Pooling pool2 1 1 conv2_2_relu2_2 pool2 1=2 2=2 10 | Convolution conv3_1 1 1 pool2 conv3_1_relu3_1 0=256 1=3 4=1 5=1 6=294912 8=102 9=1 11 | Convolution conv3_2 1 1 conv3_1_relu3_1 conv3_2_relu3_2 0=256 1=3 4=1 5=1 6=589824 8=102 9=1 12 | Convolution conv3_3 1 1 conv3_2_relu3_2 conv3_3_relu3_3 0=256 1=3 4=1 5=1 6=589824 8=2 9=1 13 | Pooling pool3 1 1 conv3_3_relu3_3 pool3 1=2 2=2 14 | Convolution conv4_1 1 1 pool3 conv4_1_relu4_1 0=512 1=3 4=1 5=1 6=1179648 8=102 9=1 15 | Convolution conv4_2 1 1 conv4_1_relu4_1 conv4_2_relu4_2 0=512 1=3 4=1 5=1 6=2359296 8=102 9=1 16 | Convolution conv4_3 1 1 conv4_2_relu4_2 conv4_3_relu4_3 0=512 1=3 4=1 5=1 6=2359296 8=2 9=1 17 | Pooling pool4 1 1 conv4_3_relu4_3 pool4 1=2 2=2 18 | Convolution conv5_1 1 1 pool4 conv5_1_relu5_1 0=512 1=3 4=1 5=1 6=2359296 8=102 9=1 19 | Convolution conv5_2 1 1 conv5_1_relu5_1 conv5_2_relu5_2 0=512 1=3 4=1 5=1 6=2359296 8=102 9=1 20 | Convolution conv5_3 1 1 conv5_2_relu5_2 conv5_3_relu5_3 0=512 1=3 4=1 5=1 6=2359296 8=2 9=1 21 | Pooling pool5 1 1 conv5_3_relu5_3 pool5 1=2 2=2 22 | InnerProduct fc6 1 1 pool5 fc6_drop6 0=4096 1=1 2=102760448 8=2 9=1 23 | InnerProduct fc7 1 1 fc6_drop6 fc7_drop7 0=4096 1=1 2=16777216 8=2 9=1 24 | InnerProduct fc8 1 1 fc7_drop7 fc8 0=1000 1=1 2=4096000 8=2 25 | Softmax prob 1 1 fc8 output 26 | -------------------------------------------------------------------------------- /ncnn-rs/src/net.rs: -------------------------------------------------------------------------------- 1 | use crate::datareader::DataReader; 2 | use crate::Extractor; 3 | use ncnn_bind::*; 4 | use std::ffi::CString; 5 | 6 | pub struct Net { 7 | ptr: ncnn_net_t, 8 | } 9 | 10 | unsafe impl Send for Net {} 11 | 12 | impl Net { 13 | pub fn new() -> Net { 14 | Net { 15 | ptr: unsafe { ncnn_net_create() }, 16 | } 17 | } 18 | 19 | pub fn set_option(&mut self, opt: &crate::option::Option) { 20 | unsafe { 21 | ncnn_net_set_option(self.ptr, opt.ptr()); 22 | } 23 | } 24 | 25 | pub fn load_param(&mut self, path: &str) -> anyhow::Result<()> { 26 | let c_str = CString::new(path).unwrap(); 27 | if unsafe { ncnn_net_load_param(self.ptr, c_str.as_ptr()) } != 0 { 28 | anyhow::bail!("Error loading params {}", path); 29 | } else { 30 | Ok(()) 31 | } 32 | } 33 | 34 | pub fn load_model(&mut self, path: &str) -> anyhow::Result<()> { 35 | let c_str = CString::new(path).unwrap(); 36 | if unsafe { ncnn_net_load_model(self.ptr, c_str.as_ptr()) } != 0 { 37 | anyhow::bail!("Error loading model {}", path); 38 | } else { 39 | Ok(()) 40 | } 41 | } 42 | 43 | pub fn load_model_datareader(&mut self, dr: &DataReader) -> anyhow::Result<()> { 44 | if unsafe { ncnn_net_load_model_datareader(self.ptr, dr.ptr()) } != 0 { 45 | anyhow::bail!("Error loading model from datareader"); 46 | } else { 47 | Ok(()) 48 | } 49 | } 50 | 51 | pub fn create_extractor(&mut self) -> Extractor<'_> { 52 | let ptr; 53 | unsafe { 54 | ptr = ncnn_extractor_create(self.ptr); 55 | } 56 | Extractor::from_ptr(ptr) 57 | } 58 | } 59 | 60 | impl Drop for Net { 61 | fn drop(&mut self) { 62 | unsafe { 63 | ncnn_net_destroy(self.ptr); 64 | } 65 | } 66 | } 67 | 68 | #[cfg(test)] 69 | mod tests { 70 | use super::*; 71 | 72 | fn is_send() -> bool { 73 | true 74 | } 75 | fn is_sync() -> bool { 76 | true 77 | } 78 | 79 | #[test] 80 | fn load_not_exist_model() { 81 | let mut net = Net::new(); 82 | net.load_param("not_exist.param") 83 | .expect_err("Expected param to be not found"); 84 | } 85 | 86 | #[test] 87 | fn check_sync_send() { 88 | assert!(is_send::()); 89 | //assert!(is_sync::()); 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /params/vgg16.param: -------------------------------------------------------------------------------- 1 | 7767517 2 | 23 23 3 | Input data 0 1 data -23330=4,3,224,224,3 0=224 1=224 2=3 4 | Convolution conv1_1 1 1 data conv1_1_relu1_1 -23330=4,3,224,224,64 0=64 1=3 4=1 5=1 6=1728 9=1 5 | Convolution conv1_2 1 1 conv1_1_relu1_1 conv1_2_relu1_2 -23330=4,3,224,224,64 0=64 1=3 4=1 5=1 6=36864 9=1 6 | Pooling pool1 1 1 conv1_2_relu1_2 pool1 -23330=4,3,112,112,64 1=2 2=2 7 | Convolution conv2_1 1 1 pool1 conv2_1_relu2_1 -23330=4,3,112,112,128 0=128 1=3 4=1 5=1 6=73728 9=1 8 | Convolution conv2_2 1 1 conv2_1_relu2_1 conv2_2_relu2_2 -23330=4,3,112,112,128 0=128 1=3 4=1 5=1 6=147456 9=1 9 | Pooling pool2 1 1 conv2_2_relu2_2 pool2 -23330=4,3,56,56,128 1=2 2=2 10 | Convolution conv3_1 1 1 pool2 conv3_1_relu3_1 -23330=4,3,56,56,256 0=256 1=3 4=1 5=1 6=294912 9=1 11 | Convolution conv3_2 1 1 conv3_1_relu3_1 conv3_2_relu3_2 -23330=4,3,56,56,256 0=256 1=3 4=1 5=1 6=589824 9=1 12 | Convolution conv3_3 1 1 conv3_2_relu3_2 conv3_3_relu3_3 -23330=4,3,56,56,256 0=256 1=3 4=1 5=1 6=589824 9=1 13 | Pooling pool3 1 1 conv3_3_relu3_3 pool3 -23330=4,3,28,28,256 1=2 2=2 14 | Convolution conv4_1 1 1 pool3 conv4_1_relu4_1 -23330=4,3,28,28,512 0=512 1=3 4=1 5=1 6=1179648 9=1 15 | Convolution conv4_2 1 1 conv4_1_relu4_1 conv4_2_relu4_2 -23330=4,3,28,28,512 0=512 1=3 4=1 5=1 6=2359296 9=1 16 | Convolution conv4_3 1 1 conv4_2_relu4_2 conv4_3_relu4_3 -23330=4,3,28,28,512 0=512 1=3 4=1 5=1 6=2359296 9=1 17 | Pooling pool4 1 1 conv4_3_relu4_3 pool4 -23330=4,3,14,14,512 1=2 2=2 18 | Convolution conv5_1 1 1 pool4 conv5_1_relu5_1 -23330=4,3,14,14,512 0=512 1=3 4=1 5=1 6=2359296 9=1 19 | Convolution conv5_2 1 1 conv5_1_relu5_1 conv5_2_relu5_2 -23330=4,3,14,14,512 0=512 1=3 4=1 5=1 6=2359296 9=1 20 | Convolution conv5_3 1 1 conv5_2_relu5_2 conv5_3_relu5_3 -23330=4,3,14,14,512 0=512 1=3 4=1 5=1 6=2359296 9=1 21 | Pooling pool5 1 1 conv5_3_relu5_3 pool5 -23330=4,3,7,7,512 1=2 2=2 22 | InnerProduct fc6 1 1 pool5 fc6_drop6 -23330=4,1,4096,1,1 0=4096 1=1 2=102760448 9=1 23 | InnerProduct fc7 1 1 fc6_drop6 fc7_drop7 -23330=4,1,4096,1,1 0=4096 1=1 2=16777216 9=1 24 | InnerProduct fc8 1 1 fc7_drop7 fc8 -23330=4,1,1000,1,1 0=1000 1=1 2=4096000 25 | Softmax prob 1 1 fc8 output -23330=4,1,1000,1,1 26 | -------------------------------------------------------------------------------- /params/mobilenet_int8.param: -------------------------------------------------------------------------------- 1 | 7767517 2 | 31 31 3 | Input data 0 1 data 0=224 1=224 2=3 4 | Convolution conv1 1 1 data conv1_relu1 0=32 1=3 3=2 4=1 5=1 6=864 8=102 9=1 5 | ConvolutionDepthWise conv2_1/dw 1 1 conv1_relu1 conv2_1/dw_relu2_1/dw 0=32 1=3 4=1 5=1 6=288 7=32 8=101 9=1 6 | Convolution conv2_1/sep 1 1 conv2_1/dw_relu2_1/dw conv2_1/sep_relu2_1/sep 0=64 1=1 5=1 6=2048 8=102 9=1 7 | ConvolutionDepthWise conv2_2/dw 1 1 conv2_1/sep_relu2_1/sep conv2_2/dw_relu2_2/dw 0=64 1=3 3=2 4=1 5=1 6=576 7=64 8=101 9=1 8 | Convolution conv2_2/sep 1 1 conv2_2/dw_relu2_2/dw conv2_2/sep_relu2_2/sep 0=128 1=1 5=1 6=8192 8=102 9=1 9 | ConvolutionDepthWise conv3_1/dw 1 1 conv2_2/sep_relu2_2/sep conv3_1/dw_relu3_1/dw 0=128 1=3 4=1 5=1 6=1152 7=128 8=101 9=1 10 | Convolution conv3_1/sep 1 1 conv3_1/dw_relu3_1/dw conv3_1/sep_relu3_1/sep 0=128 1=1 5=1 6=16384 8=102 9=1 11 | ConvolutionDepthWise conv3_2/dw 1 1 conv3_1/sep_relu3_1/sep conv3_2/dw_relu3_2/dw 0=128 1=3 3=2 4=1 5=1 6=1152 7=128 8=101 9=1 12 | Convolution conv3_2/sep 1 1 conv3_2/dw_relu3_2/dw conv3_2/sep_relu3_2/sep 0=256 1=1 5=1 6=32768 8=102 9=1 13 | ConvolutionDepthWise conv4_1/dw 1 1 conv3_2/sep_relu3_2/sep conv4_1/dw_relu4_1/dw 0=256 1=3 4=1 5=1 6=2304 7=256 8=101 9=1 14 | Convolution conv4_1/sep 1 1 conv4_1/dw_relu4_1/dw conv4_1/sep_relu4_1/sep 0=256 1=1 5=1 6=65536 8=102 9=1 15 | ConvolutionDepthWise conv4_2/dw 1 1 conv4_1/sep_relu4_1/sep conv4_2/dw_relu4_2/dw 0=256 1=3 3=2 4=1 5=1 6=2304 7=256 8=101 9=1 16 | Convolution conv4_2/sep 1 1 conv4_2/dw_relu4_2/dw conv4_2/sep_relu4_2/sep 0=512 1=1 5=1 6=131072 8=102 9=1 17 | ConvolutionDepthWise conv5_1/dw 1 1 conv4_2/sep_relu4_2/sep conv5_1/dw_relu5_1/dw 0=512 1=3 4=1 5=1 6=4608 7=512 8=101 9=1 18 | Convolution conv5_1/sep 1 1 conv5_1/dw_relu5_1/dw conv5_1/sep_relu5_1/sep 0=512 1=1 5=1 6=262144 8=102 9=1 19 | ConvolutionDepthWise conv5_2/dw 1 1 conv5_1/sep_relu5_1/sep conv5_2/dw_relu5_2/dw 0=512 1=3 4=1 5=1 6=4608 7=512 8=101 9=1 20 | Convolution conv5_2/sep 1 1 conv5_2/dw_relu5_2/dw conv5_2/sep_relu5_2/sep 0=512 1=1 5=1 6=262144 8=102 9=1 21 | ConvolutionDepthWise conv5_3/dw 1 1 conv5_2/sep_relu5_2/sep conv5_3/dw_relu5_3/dw 0=512 1=3 4=1 5=1 6=4608 7=512 8=101 9=1 22 | Convolution conv5_3/sep 1 1 conv5_3/dw_relu5_3/dw conv5_3/sep_relu5_3/sep 0=512 1=1 5=1 6=262144 8=102 9=1 23 | ConvolutionDepthWise conv5_4/dw 1 1 conv5_3/sep_relu5_3/sep conv5_4/dw_relu5_4/dw 0=512 1=3 4=1 5=1 6=4608 7=512 8=101 9=1 24 | Convolution conv5_4/sep 1 1 conv5_4/dw_relu5_4/dw conv5_4/sep_relu5_4/sep 0=512 1=1 5=1 6=262144 8=102 9=1 25 | ConvolutionDepthWise conv5_5/dw 1 1 conv5_4/sep_relu5_4/sep conv5_5/dw_relu5_5/dw 0=512 1=3 4=1 5=1 6=4608 7=512 8=101 9=1 26 | Convolution conv5_5/sep 1 1 conv5_5/dw_relu5_5/dw conv5_5/sep_relu5_5/sep 0=512 1=1 5=1 6=262144 8=102 9=1 27 | ConvolutionDepthWise conv5_6/dw 1 1 conv5_5/sep_relu5_5/sep conv5_6/dw_relu5_6/dw 0=512 1=3 3=2 4=1 5=1 6=4608 7=512 8=101 9=1 28 | Convolution conv5_6/sep 1 1 conv5_6/dw_relu5_6/dw conv5_6/sep_relu5_6/sep 0=1024 1=1 5=1 6=524288 8=102 9=1 29 | ConvolutionDepthWise conv6/dw 1 1 conv5_6/sep_relu5_6/sep conv6/dw_relu6/dw 0=1024 1=3 4=1 5=1 6=9216 7=1024 8=101 9=1 30 | Convolution conv6/sep 1 1 conv6/dw_relu6/dw conv6/sep_relu6/sep 0=1024 1=1 5=1 6=1048576 8=2 9=1 31 | Pooling pool6 1 1 conv6/sep_relu6/sep pool6 0=1 4=1 32 | InnerProduct fc7 1 1 pool6 fc7 0=1000 1=1 2=1024000 8=2 33 | Softmax prob 1 1 fc7 output 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | ## rust-ncnn 6 | [![GitHub license](https://img.shields.io/badge/license-apache--2--Clause-brightgreen.svg)](./LICENSE) [![CI](https://img.shields.io/github/actions/workflow/status/tpoisonooo/rust-ncnn/ci.yaml?branch=master)](https://github.com/tpoisonooo/rust-ncnn/actions/workflows/ci.yaml?query=workflow%3A) 7 | 8 | Rust bindings for [ncnn](https://github.com/tencent/ncnn). 9 | 10 | ## Docs 11 | 12 | Open Github pages 13 | * [ncnn_rs](https://rust-ncnn.github.io/ncnn_rs/) - safe ncnn abstractions 14 | * [ncnn_bind](https://rust-ncnn.github.io/ncnn_bind/) - low-level bindings 15 | 16 | Or `cargo doc` and open with browser byself 17 | 18 | ```bash 19 | cd /path/to/rust-ncnn 20 | cargo doc --open 21 | ``` 22 | 23 | ## Prequisition 24 | 25 | ### Rust Env 26 | ```bash 27 | curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh 28 | ``` 29 | 30 | 31 | ### CMake >= 3.12 32 | 33 | Rust cmake needs `--parallel` option thus CMake>=3.12 is complusory 34 | 35 | ```bash 36 | pip install cmake --upgrade --user 37 | ``` 38 | 39 | ### Clang >= 3.9 40 | 41 | Rust bindgen uses `clang` to generate `bindings.rs` from `c_api.h` 42 | 43 | ```bash 44 | sudo apt install clang-3.9 libclang-3.9-dev 45 | sudo apt install clang-10 libclang-10-dev # use clang-10 for ubuntu 20.04 46 | sudo apt install clang libclang-dev # use clang-14 for Linux maixbox 5.15.7 47 | ``` 48 | 49 | ## Build 50 | 51 | ncnn build from source: 52 | ```bash 53 | cd rust-ncnn/ 54 | cargo run --example get_version 55 | # print YYYYMMDD 56 | ``` 57 | 58 | Use specific ncnn release: 59 | ```bash 60 | export NCNN_TAG="20231027" 61 | ``` 62 | 63 | [Here](https://github.com/Tencent/ncnn/tags) is all available release tags. 64 | 65 | Use prebuilt ncnn: 66 | ```bash 67 | export NCNN_DIR="/path/to/your/ncnn/lib" 68 | ``` 69 | 70 | Or use vcpkg 71 | ```bash 72 | vcpkg install ncnn:x64-windows-static-md 73 | cargo run --example get_version 74 | ``` 75 | 76 | ## Linking 77 | 78 | By default library uses dynamic **linking on linux** and **static linking on windows**. 79 | 80 | To explicitly use static linking: 81 | ```bash 82 | cargo build --example benchmark --features ncnn-bind/static 83 | ``` 84 | 85 | To explicitly use dynamic linking: 86 | ```bash 87 | cargo build --example benchmark --features ncnn-bind/dynamic 88 | ``` 89 | 90 | ## Vulkan 91 | 92 | Build with Vulkan support (requires Vulkan SDK): 93 | ```bash 94 | cargo build --example benchmark --features ncnn-bind/vulkan 95 | ``` 96 | 97 | ## Run Examples and UnitTest 98 | 99 | ```bash 100 | cargo test 101 | cargo run --example get_version 102 | cargo run --example benchmark --release 103 | Finished release [optimized] target(s) in 0.01s 104 | Running `target/release/examples/benchmark` 105 | squeezenet.param 2 ms 106 | squeezenet_int8.param 5 ms 107 | mobilenet.param 3 ms 108 | mobilenet_int8.param 7 ms 109 | mobilenet_v2.param 3 ms 110 | mobilenet_v3.param 2 ms 111 | shufflenet.param 2 ms 112 | shufflenet_v2.param 2 ms 113 | mnasnet.param 2 ms 114 | proxylessnasnet.param 3 ms 115 | efficientnet_b0.param 5 ms 116 | regnety_400m.param 6 ms 117 | blazeface.param 0 ms 118 | googlenet.param 10 ms 119 | googlenet_int8.param 19 ms 120 | resnet18.param 9 ms 121 | resnet18_int8.param 16 ms 122 | alexnet.param 7 ms 123 | vgg16.param 49 ms 124 | vgg16_int8.param 71 ms 125 | resnet50.param 18 ms 126 | resnet50_int8.param 40 ms 127 | squeezenet_ssd.param 17 ms 128 | squeezenet_ssd_int8.param 13 ms 129 | mobilenet_ssd.param 8 ms 130 | mobilenet_ssd_int8.param 15 ms 131 | mobilenet_yolo.param 30 ms 132 | mobilenetv2_yolov3.param 13 ms 133 | yolov4-tiny.param 20 ms 134 | nanodet-plus-m_416.param 11 ms 135 | nanodet-plus-m_416-int8.param 20 ms 136 | ``` 137 | 138 | ## FAQ 139 | * cross-build: rust-ncnn currently **not support** cross-build, please excute `cargo build` on target board. 140 | 141 | 142 | ## Acknowledgements 143 | 144 | * [lit-robotics/rust-ncnn](https://github.com/lit-robotics/rust-ncnn) 145 | * [ncnn](https://github.com/tencent/ncnn) 146 | -------------------------------------------------------------------------------- /params/mobilenet.param: -------------------------------------------------------------------------------- 1 | 7767517 2 | 31 31 3 | Input data 0 1 data -23330=4,3,224,224,3 0=224 1=224 2=3 4 | Convolution conv1 1 1 data conv1_relu1 -23330=4,3,112,112,32 0=32 1=3 3=2 4=1 5=1 6=864 9=1 5 | ConvolutionDepthWise conv2_1/dw 1 1 conv1_relu1 conv2_1/dw_relu2_1/dw -23330=4,3,112,112,32 0=32 1=3 4=1 5=1 6=288 7=32 9=1 6 | Convolution conv2_1/sep 1 1 conv2_1/dw_relu2_1/dw conv2_1/sep_relu2_1/sep -23330=4,3,112,112,64 0=64 1=1 5=1 6=2048 9=1 7 | ConvolutionDepthWise conv2_2/dw 1 1 conv2_1/sep_relu2_1/sep conv2_2/dw_relu2_2/dw -23330=4,3,56,56,64 0=64 1=3 3=2 4=1 5=1 6=576 7=64 9=1 8 | Convolution conv2_2/sep 1 1 conv2_2/dw_relu2_2/dw conv2_2/sep_relu2_2/sep -23330=4,3,56,56,128 0=128 1=1 5=1 6=8192 9=1 9 | ConvolutionDepthWise conv3_1/dw 1 1 conv2_2/sep_relu2_2/sep conv3_1/dw_relu3_1/dw -23330=4,3,56,56,128 0=128 1=3 4=1 5=1 6=1152 7=128 9=1 10 | Convolution conv3_1/sep 1 1 conv3_1/dw_relu3_1/dw conv3_1/sep_relu3_1/sep -23330=4,3,56,56,128 0=128 1=1 5=1 6=16384 9=1 11 | ConvolutionDepthWise conv3_2/dw 1 1 conv3_1/sep_relu3_1/sep conv3_2/dw_relu3_2/dw -23330=4,3,28,28,128 0=128 1=3 3=2 4=1 5=1 6=1152 7=128 9=1 12 | Convolution conv3_2/sep 1 1 conv3_2/dw_relu3_2/dw conv3_2/sep_relu3_2/sep -23330=4,3,28,28,256 0=256 1=1 5=1 6=32768 9=1 13 | ConvolutionDepthWise conv4_1/dw 1 1 conv3_2/sep_relu3_2/sep conv4_1/dw_relu4_1/dw -23330=4,3,28,28,256 0=256 1=3 4=1 5=1 6=2304 7=256 9=1 14 | Convolution conv4_1/sep 1 1 conv4_1/dw_relu4_1/dw conv4_1/sep_relu4_1/sep -23330=4,3,28,28,256 0=256 1=1 5=1 6=65536 9=1 15 | ConvolutionDepthWise conv4_2/dw 1 1 conv4_1/sep_relu4_1/sep conv4_2/dw_relu4_2/dw -23330=4,3,14,14,256 0=256 1=3 3=2 4=1 5=1 6=2304 7=256 9=1 16 | Convolution conv4_2/sep 1 1 conv4_2/dw_relu4_2/dw conv4_2/sep_relu4_2/sep -23330=4,3,14,14,512 0=512 1=1 5=1 6=131072 9=1 17 | ConvolutionDepthWise conv5_1/dw 1 1 conv4_2/sep_relu4_2/sep conv5_1/dw_relu5_1/dw -23330=4,3,14,14,512 0=512 1=3 4=1 5=1 6=4608 7=512 9=1 18 | Convolution conv5_1/sep 1 1 conv5_1/dw_relu5_1/dw conv5_1/sep_relu5_1/sep -23330=4,3,14,14,512 0=512 1=1 5=1 6=262144 9=1 19 | ConvolutionDepthWise conv5_2/dw 1 1 conv5_1/sep_relu5_1/sep conv5_2/dw_relu5_2/dw -23330=4,3,14,14,512 0=512 1=3 4=1 5=1 6=4608 7=512 9=1 20 | Convolution conv5_2/sep 1 1 conv5_2/dw_relu5_2/dw conv5_2/sep_relu5_2/sep -23330=4,3,14,14,512 0=512 1=1 5=1 6=262144 9=1 21 | ConvolutionDepthWise conv5_3/dw 1 1 conv5_2/sep_relu5_2/sep conv5_3/dw_relu5_3/dw -23330=4,3,14,14,512 0=512 1=3 4=1 5=1 6=4608 7=512 9=1 22 | Convolution conv5_3/sep 1 1 conv5_3/dw_relu5_3/dw conv5_3/sep_relu5_3/sep -23330=4,3,14,14,512 0=512 1=1 5=1 6=262144 9=1 23 | ConvolutionDepthWise conv5_4/dw 1 1 conv5_3/sep_relu5_3/sep conv5_4/dw_relu5_4/dw -23330=4,3,14,14,512 0=512 1=3 4=1 5=1 6=4608 7=512 9=1 24 | Convolution conv5_4/sep 1 1 conv5_4/dw_relu5_4/dw conv5_4/sep_relu5_4/sep -23330=4,3,14,14,512 0=512 1=1 5=1 6=262144 9=1 25 | ConvolutionDepthWise conv5_5/dw 1 1 conv5_4/sep_relu5_4/sep conv5_5/dw_relu5_5/dw -23330=4,3,14,14,512 0=512 1=3 4=1 5=1 6=4608 7=512 9=1 26 | Convolution conv5_5/sep 1 1 conv5_5/dw_relu5_5/dw conv5_5/sep_relu5_5/sep -23330=4,3,14,14,512 0=512 1=1 5=1 6=262144 9=1 27 | ConvolutionDepthWise conv5_6/dw 1 1 conv5_5/sep_relu5_5/sep conv5_6/dw_relu5_6/dw -23330=4,3,7,7,512 0=512 1=3 3=2 4=1 5=1 6=4608 7=512 9=1 28 | Convolution conv5_6/sep 1 1 conv5_6/dw_relu5_6/dw conv5_6/sep_relu5_6/sep -23330=4,3,7,7,1024 0=1024 1=1 5=1 6=524288 9=1 29 | ConvolutionDepthWise conv6/dw 1 1 conv5_6/sep_relu5_6/sep conv6/dw_relu6/dw -23330=4,3,7,7,1024 0=1024 1=3 4=1 5=1 6=9216 7=1024 9=1 30 | Convolution conv6/sep 1 1 conv6/dw_relu6/dw conv6/sep_relu6/sep -23330=4,3,7,7,1024 0=1024 1=1 5=1 6=1048576 9=1 31 | Pooling pool6 1 1 conv6/sep_relu6/sep pool6 -23330=4,1,1024,1,1 0=1 4=1 32 | InnerProduct fc7 1 1 pool6 fc7 -23330=4,1,1000,1,1 0=1000 1=1 2=1024000 33 | Softmax prob 1 1 fc7 output -23330=4,1,1000,1,1 34 | -------------------------------------------------------------------------------- /params/mobilenet_yolo.param: -------------------------------------------------------------------------------- 1 | 7767517 2 | 39 41 3 | Input data 0 1 data -23330=4,3,416,416,3 0=416 1=416 2=3 4 | Convolution conv0 1 1 data conv0_conv0/relu -23330=4,3,208,208,32 0=32 1=3 3=2 4=1 5=1 6=864 9=1 5 | ConvolutionDepthWise conv1/dw 1 1 conv0_conv0/relu conv1/dw_conv1/dw/relu -23330=4,3,208,208,32 0=32 1=3 4=1 5=1 6=288 7=32 9=1 6 | Convolution conv1 1 1 conv1/dw_conv1/dw/relu conv1_conv1/relu -23330=4,3,208,208,64 0=64 1=1 5=1 6=2048 9=1 7 | ConvolutionDepthWise conv2/dw 1 1 conv1_conv1/relu conv2/dw_conv2/dw/relu -23330=4,3,104,104,64 0=64 1=3 3=2 4=1 5=1 6=576 7=64 9=1 8 | Convolution conv2 1 1 conv2/dw_conv2/dw/relu conv2_conv2/relu -23330=4,3,104,104,128 0=128 1=1 5=1 6=8192 9=1 9 | ConvolutionDepthWise conv3/dw 1 1 conv2_conv2/relu conv3/dw_conv3/dw/relu -23330=4,3,104,104,128 0=128 1=3 4=1 5=1 6=1152 7=128 9=1 10 | Convolution conv3 1 1 conv3/dw_conv3/dw/relu conv3_conv3/relu -23330=4,3,104,104,128 0=128 1=1 5=1 6=16384 9=1 11 | ConvolutionDepthWise conv4/dw 1 1 conv3_conv3/relu conv4/dw_conv4/dw/relu -23330=4,3,52,52,128 0=128 1=3 3=2 4=1 5=1 6=1152 7=128 9=1 12 | Convolution conv4 1 1 conv4/dw_conv4/dw/relu conv4_conv4/relu -23330=4,3,52,52,256 0=256 1=1 5=1 6=32768 9=1 13 | ConvolutionDepthWise conv5/dw 1 1 conv4_conv4/relu conv5/dw_conv5/dw/relu -23330=4,3,52,52,256 0=256 1=3 4=1 5=1 6=2304 7=256 9=1 14 | Convolution conv5 1 1 conv5/dw_conv5/dw/relu conv5_conv5/relu -23330=4,3,52,52,256 0=256 1=1 5=1 6=65536 9=1 15 | ConvolutionDepthWise conv6/dw 1 1 conv5_conv5/relu conv6/dw_conv6/dw/relu -23330=4,3,26,26,256 0=256 1=3 3=2 4=1 5=1 6=2304 7=256 9=1 16 | Convolution conv6 1 1 conv6/dw_conv6/dw/relu conv6_conv6/relu -23330=4,3,26,26,512 0=512 1=1 5=1 6=131072 9=1 17 | ConvolutionDepthWise conv7/dw 1 1 conv6_conv6/relu conv7/dw_conv7/dw/relu -23330=4,3,26,26,512 0=512 1=3 4=1 5=1 6=4608 7=512 9=1 18 | Convolution conv7 1 1 conv7/dw_conv7/dw/relu conv7_conv7/relu -23330=4,3,26,26,512 0=512 1=1 5=1 6=262144 9=1 19 | ConvolutionDepthWise conv8/dw 1 1 conv7_conv7/relu conv8/dw_conv8/dw/relu -23330=4,3,26,26,512 0=512 1=3 4=1 5=1 6=4608 7=512 9=1 20 | Convolution conv8 1 1 conv8/dw_conv8/dw/relu conv8_conv8/relu -23330=4,3,26,26,512 0=512 1=1 5=1 6=262144 9=1 21 | ConvolutionDepthWise conv9/dw 1 1 conv8_conv8/relu conv9/dw_conv9/dw/relu -23330=4,3,26,26,512 0=512 1=3 4=1 5=1 6=4608 7=512 9=1 22 | Convolution conv9 1 1 conv9/dw_conv9/dw/relu conv9_conv9/relu -23330=4,3,26,26,512 0=512 1=1 5=1 6=262144 9=1 23 | ConvolutionDepthWise conv10/dw 1 1 conv9_conv9/relu conv10/dw_conv10/dw/relu -23330=4,3,26,26,512 0=512 1=3 4=1 5=1 6=4608 7=512 9=1 24 | Convolution conv10 1 1 conv10/dw_conv10/dw/relu conv10_conv10/relu -23330=4,3,26,26,512 0=512 1=1 5=1 6=262144 9=1 25 | ConvolutionDepthWise conv11/dw 1 1 conv10_conv10/relu conv11/dw_conv11/dw/relu -23330=4,3,26,26,512 0=512 1=3 4=1 5=1 6=4608 7=512 9=1 26 | Convolution conv11 1 1 conv11/dw_conv11/dw/relu conv11_conv11/relu -23330=4,3,26,26,512 0=512 1=1 5=1 6=262144 9=1 27 | Split splitncnn_0 1 2 conv11_conv11/relu conv11_conv11/relu_splitncnn_0 conv11_conv11/relu_splitncnn_1 -23330=8,3,26,26,512,3,26,26,512 28 | ConvolutionDepthWise conv12/dw 1 1 conv11_conv11/relu_splitncnn_1 conv12/dw_conv12/dw/relu -23330=4,3,13,13,512 0=512 1=3 3=2 4=1 5=1 6=4608 7=512 9=1 29 | Convolution conv12 1 1 conv12/dw_conv12/dw/relu conv12_conv12/relu -23330=4,3,13,13,1024 0=1024 1=1 5=1 6=524288 9=1 30 | ConvolutionDepthWise conv13/dw 1 1 conv12_conv12/relu conv13/dw_conv13/dw/relu -23330=4,3,13,13,1024 0=1024 1=3 4=1 5=1 6=9216 7=1024 9=1 31 | Convolution conv13 1 1 conv13/dw_conv13/dw/relu conv13_conv13/relu -23330=4,3,13,13,1024 0=1024 1=1 5=1 6=1048576 9=1 32 | ConvolutionDepthWise conv16/dw 1 1 conv13_conv13/relu conv16/dw_conv16/dw/relu -23330=4,3,13,13,1024 0=1024 1=3 4=1 5=1 6=9216 7=1024 9=1 33 | Convolution conv17 1 1 conv16/dw_conv16/dw/relu conv17_conv17/relu -23330=4,3,13,13,1024 0=1024 1=1 5=1 6=1048576 9=1 34 | Split splitncnn_1 1 2 conv17_conv17/relu conv17_conv17/relu_splitncnn_0 conv17_conv17/relu_splitncnn_1 -23330=8,3,13,13,1024,3,13,13,1024 35 | DeconvolutionDepthWise upsample 1 1 conv17_conv17/relu_splitncnn_1 upsample -23330=4,3,26,26,512 0=512 1=4 3=2 4=1 6=16384 7=512 36 | Eltwise conv_18/sum 2 1 conv11_conv11/relu_splitncnn_0 upsample conv_18/sum -23330=4,3,26,26,512 0=1 37 | ConvolutionDepthWise conv19/dw 1 1 conv_18/sum conv19/dw_conv19/dw/relu -23330=4,3,26,26,512 0=512 1=3 4=1 5=1 6=4608 7=512 9=1 38 | Convolution conv20 1 1 conv19/dw_conv19/dw/relu conv20_conv20/relu -23330=4,3,26,26,1024 0=1024 1=1 5=1 6=524288 9=1 39 | Convolution conv22_indoor 1 1 conv17_conv17/relu_splitncnn_0 conv22 -23330=4,3,13,13,125 0=125 1=1 5=1 6=128000 40 | Convolution conv23_indoor 1 1 conv20_conv20/relu conv23 -23330=4,3,26,26,125 0=125 1=1 5=1 6=128000 41 | YoloDetectionOutput detection_out 2 1 conv22 conv23 output -23330=4,3,13,13,125 2=4.000000e-01 -23304=10,1.080000e+00,1.190000e+00,3.420000e+00,4.410000e+00,6.630000e+00,1.138000e+01,9.420000e+00,5.110000e+00,1.662000e+01,1.052000e+01 42 | -------------------------------------------------------------------------------- /params/resnet18_int8.param: -------------------------------------------------------------------------------- 1 | 7767517 2 | 50 58 3 | Input data 0 1 data 0=224 1=224 2=3 4 | Convolution conv1 1 1 data conv1_conv1_relu 0=64 1=7 3=2 4=3 5=1 6=9408 8=2 9=1 5 | Pooling pool1 1 1 conv1_conv1_relu pool1 1=3 2=2 6 | Split splitncnn_0 1 2 pool1 pool1_splitncnn_0 pool1_splitncnn_1 7 | Convolution res2a_branch1 1 1 pool1_splitncnn_1 res2a_branch1_scale2a_branch1 0=64 1=1 5=1 6=4096 8=2 8 | Convolution res2a_branch2a 1 1 pool1_splitncnn_0 res2a_branch2a_res2a_branch2a_relu 0=64 1=3 4=1 5=1 6=36864 8=102 9=1 9 | Convolution res2a_branch2b 1 1 res2a_branch2a_res2a_branch2a_relu res2a_branch2b_scale2a_branch2b 0=64 1=3 4=1 5=1 6=36864 8=2 10 | Eltwise res2a 2 1 res2a_branch1_scale2a_branch1 res2a_branch2b_scale2a_branch2b res2a 0=1 11 | ReLU res2a_relu 1 1 res2a res2a_res2a_relu 12 | Split splitncnn_1 1 2 res2a_res2a_relu res2a_res2a_relu_splitncnn_0 res2a_res2a_relu_splitncnn_1 13 | Convolution res2b_branch2a 1 1 res2a_res2a_relu_splitncnn_1 res2b_branch2a_res2b_branch2a_relu 0=64 1=3 4=1 5=1 6=36864 8=102 9=1 14 | Convolution res2b_branch2b 1 1 res2b_branch2a_res2b_branch2a_relu res2b_branch2b_scale2b_branch2b 0=64 1=3 4=1 5=1 6=36864 8=2 15 | Eltwise res2b 2 1 res2a_res2a_relu_splitncnn_0 res2b_branch2b_scale2b_branch2b res2b 0=1 16 | ReLU res2b_relu 1 1 res2b res2b_res2b_relu 17 | Split splitncnn_2 1 2 res2b_res2b_relu res2b_res2b_relu_splitncnn_0 res2b_res2b_relu_splitncnn_1 18 | Convolution res3a_branch1 1 1 res2b_res2b_relu_splitncnn_1 res3a_branch1_scale3a_branch1 0=128 1=1 3=2 5=1 6=8192 8=2 19 | Convolution res3a_branch2a 1 1 res2b_res2b_relu_splitncnn_0 res3a_branch2a_res3a_branch2a_relu 0=128 1=3 3=2 4=1 5=1 6=73728 8=102 9=1 20 | Convolution res3a_branch2b 1 1 res3a_branch2a_res3a_branch2a_relu res3a_branch2b_scale3a_branch2b 0=128 1=3 4=1 5=1 6=147456 8=2 21 | Eltwise res3a 2 1 res3a_branch1_scale3a_branch1 res3a_branch2b_scale3a_branch2b res3a 0=1 22 | ReLU res3a_relu 1 1 res3a res3a_res3a_relu 23 | Split splitncnn_3 1 2 res3a_res3a_relu res3a_res3a_relu_splitncnn_0 res3a_res3a_relu_splitncnn_1 24 | Convolution res3b_branch2a 1 1 res3a_res3a_relu_splitncnn_1 res3b_branch2a_res3b_branch2a_relu 0=128 1=3 4=1 5=1 6=147456 8=102 9=1 25 | Convolution res3b_branch2b 1 1 res3b_branch2a_res3b_branch2a_relu res3b_branch2b_scale3b_branch2b 0=128 1=3 4=1 5=1 6=147456 8=2 26 | Eltwise res3b 2 1 res3a_res3a_relu_splitncnn_0 res3b_branch2b_scale3b_branch2b res3b 0=1 27 | ReLU res3b_relu 1 1 res3b res3b_res3b_relu 28 | Split splitncnn_4 1 2 res3b_res3b_relu res3b_res3b_relu_splitncnn_0 res3b_res3b_relu_splitncnn_1 29 | Convolution res4a_branch1 1 1 res3b_res3b_relu_splitncnn_1 res4a_branch1_scale4a_branch1 0=256 1=1 3=2 5=1 6=32768 8=2 30 | Convolution res4a_branch2a 1 1 res3b_res3b_relu_splitncnn_0 res4a_branch2a_res4a_branch2a_relu 0=256 1=3 3=2 4=1 5=1 6=294912 8=102 9=1 31 | Convolution res4a_branch2b 1 1 res4a_branch2a_res4a_branch2a_relu res4a_branch2b_scale4a_branch2b 0=256 1=3 4=1 5=1 6=589824 8=2 32 | Eltwise res4a 2 1 res4a_branch1_scale4a_branch1 res4a_branch2b_scale4a_branch2b res4a 0=1 33 | ReLU res4a_relu 1 1 res4a res4a_res4a_relu 34 | Split splitncnn_5 1 2 res4a_res4a_relu res4a_res4a_relu_splitncnn_0 res4a_res4a_relu_splitncnn_1 35 | Convolution res4b_branch2a 1 1 res4a_res4a_relu_splitncnn_1 res4b_branch2a_res4b_branch2a_relu 0=256 1=3 4=1 5=1 6=589824 8=102 9=1 36 | Convolution res4b_branch2b 1 1 res4b_branch2a_res4b_branch2a_relu res4b_branch2b_scale4b_branch2b 0=256 1=3 4=1 5=1 6=589824 8=2 37 | Eltwise res4b 2 1 res4a_res4a_relu_splitncnn_0 res4b_branch2b_scale4b_branch2b res4b 0=1 38 | ReLU res4b_relu 1 1 res4b res4b_res4b_relu 39 | Split splitncnn_6 1 2 res4b_res4b_relu res4b_res4b_relu_splitncnn_0 res4b_res4b_relu_splitncnn_1 40 | Convolution res5a_branch1 1 1 res4b_res4b_relu_splitncnn_1 res5a_branch1_scale5a_branch1 0=512 1=1 3=2 5=1 6=131072 8=2 41 | Convolution res5a_branch2a 1 1 res4b_res4b_relu_splitncnn_0 res5a_branch2a_res5a_branch2a_relu 0=512 1=3 3=2 4=1 5=1 6=1179648 8=102 9=1 42 | Convolution res5a_branch2b 1 1 res5a_branch2a_res5a_branch2a_relu res5a_branch2b_scale5a_branch2b 0=512 1=3 4=1 5=1 6=2359296 8=2 43 | Eltwise res5a 2 1 res5a_branch1_scale5a_branch1 res5a_branch2b_scale5a_branch2b res5a 0=1 44 | ReLU res5a_relu 1 1 res5a res5a_res5a_relu 45 | Split splitncnn_7 1 2 res5a_res5a_relu res5a_res5a_relu_splitncnn_0 res5a_res5a_relu_splitncnn_1 46 | Convolution res5b_branch2a 1 1 res5a_res5a_relu_splitncnn_1 res5b_branch2a_res5b_branch2a_relu 0=512 1=3 4=1 5=1 6=2359296 8=102 9=1 47 | Convolution res5b_branch2b 1 1 res5b_branch2a_res5b_branch2a_relu res5b_branch2b_scale5b_branch2b 0=512 1=3 4=1 5=1 6=2359296 8=2 48 | Eltwise res5b 2 1 res5a_res5a_relu_splitncnn_0 res5b_branch2b_scale5b_branch2b res5b 0=1 49 | ReLU res5b_relu 1 1 res5b res5b_res5b_relu 50 | Pooling pool5 1 1 res5b_res5b_relu pool5 0=1 1=7 51 | InnerProduct fc1000 1 1 pool5 fc1000 0=1000 1=1 2=512000 52 | Softmax prob 1 1 fc1000 output 53 | -------------------------------------------------------------------------------- /params/yolov4-tiny.param: -------------------------------------------------------------------------------- 1 | 7767517 2 | 45 53 3 | Input data 0 1 data -23330=4,3,416,416,3 0=416 1=416 2=3 4 | Convolution 0_25 1 1 data 0_25_bn_leaky -23330=4,3,208,208,32 0=32 1=3 3=2 4=1 5=1 6=864 9=2 -23310=1,1.000000e-01 5 | Convolution 1_33 1 1 0_25_bn_leaky 1_33_bn_leaky -23330=4,3,104,104,64 0=64 1=3 3=2 4=1 5=1 6=18432 9=2 -23310=1,1.000000e-01 6 | Convolution 2_41 1 1 1_33_bn_leaky 2_41_bn_leaky -23330=4,3,104,104,64 0=64 1=3 4=1 5=1 6=36864 9=2 -23310=1,1.000000e-01 7 | Split 2_41_bn_leaky_split 1 2 2_41_bn_leaky 2_41_bn_leaky_split_0 2_41_bn_leaky_split_1 -23330=8,3,104,104,64,3,104,104,64 8 | Crop 3_49 1 1 2_41_bn_leaky_split_0 3_49 -23330=4,3,104,104,32 2=32 3=104 4=104 5=32 9 | Convolution 4_54 1 1 3_49 4_54_bn_leaky -23330=4,3,104,104,32 0=32 1=3 4=1 5=1 6=9216 9=2 -23310=1,1.000000e-01 10 | Split 4_54_bn_leaky_split 1 2 4_54_bn_leaky 4_54_bn_leaky_split_0 4_54_bn_leaky_split_1 -23330=8,3,104,104,32,3,104,104,32 11 | Convolution 5_62 1 1 4_54_bn_leaky_split_0 5_62_bn_leaky -23330=4,3,104,104,32 0=32 1=3 4=1 5=1 6=9216 9=2 -23310=1,1.000000e-01 12 | Concat 6_70 2 1 5_62_bn_leaky 4_54_bn_leaky_split_1 6_70 -23330=4,3,104,104,64 13 | Convolution 7_73 1 1 6_70 7_73_bn_leaky -23330=4,3,104,104,64 0=64 1=1 5=1 6=4096 9=2 -23310=1,1.000000e-01 14 | Concat 8_81 2 1 2_41_bn_leaky_split_1 7_73_bn_leaky 8_81 -23330=4,3,104,104,128 15 | Pooling 9_84 1 1 8_81 9_84 -23330=4,3,52,52,128 1=2 2=2 14=1 15=1 5=1 16 | Convolution 10_88 1 1 9_84 10_88_bn_leaky -23330=4,3,52,52,128 0=128 1=3 4=1 5=1 6=147456 9=2 -23310=1,1.000000e-01 17 | Split 10_88_bn_leaky_split 1 2 10_88_bn_leaky 10_88_bn_leaky_split_0 10_88_bn_leaky_split_1 -23330=8,3,52,52,128,3,52,52,128 18 | Crop 11_96 1 1 10_88_bn_leaky_split_0 11_96 -23330=4,3,52,52,64 2=64 3=52 4=52 5=64 19 | Convolution 12_101 1 1 11_96 12_101_bn_leaky -23330=4,3,52,52,64 0=64 1=3 4=1 5=1 6=36864 9=2 -23310=1,1.000000e-01 20 | Split 12_101_bn_leaky_split 1 2 12_101_bn_leaky 12_101_bn_leaky_split_0 12_101_bn_leaky_split_1 -23330=8,3,52,52,64,3,52,52,64 21 | Convolution 13_109 1 1 12_101_bn_leaky_split_0 13_109_bn_leaky -23330=4,3,52,52,64 0=64 1=3 4=1 5=1 6=36864 9=2 -23310=1,1.000000e-01 22 | Concat 14_117 2 1 13_109_bn_leaky 12_101_bn_leaky_split_1 14_117 -23330=4,3,52,52,128 23 | Convolution 15_120 1 1 14_117 15_120_bn_leaky -23330=4,3,52,52,128 0=128 1=1 5=1 6=16384 9=2 -23310=1,1.000000e-01 24 | Concat 16_128 2 1 10_88_bn_leaky_split_1 15_120_bn_leaky 16_128 -23330=4,3,52,52,256 25 | Pooling 17_131 1 1 16_128 17_131 -23330=4,3,26,26,256 1=2 2=2 14=1 15=1 5=1 26 | Convolution 18_135 1 1 17_131 18_135_bn_leaky -23330=4,3,26,26,256 0=256 1=3 4=1 5=1 6=589824 9=2 -23310=1,1.000000e-01 27 | Split 18_135_bn_leaky_split 1 2 18_135_bn_leaky 18_135_bn_leaky_split_0 18_135_bn_leaky_split_1 -23330=8,3,26,26,256,3,26,26,256 28 | Crop 19_143 1 1 18_135_bn_leaky_split_0 19_143 -23330=4,3,26,26,128 2=128 3=26 4=26 5=128 29 | Convolution 20_148 1 1 19_143 20_148_bn_leaky -23330=4,3,26,26,128 0=128 1=3 4=1 5=1 6=147456 9=2 -23310=1,1.000000e-01 30 | Split 20_148_bn_leaky_split 1 2 20_148_bn_leaky 20_148_bn_leaky_split_0 20_148_bn_leaky_split_1 -23330=8,3,26,26,128,3,26,26,128 31 | Convolution 21_156 1 1 20_148_bn_leaky_split_0 21_156_bn_leaky -23330=4,3,26,26,128 0=128 1=3 4=1 5=1 6=147456 9=2 -23310=1,1.000000e-01 32 | Concat 22_164 2 1 21_156_bn_leaky 20_148_bn_leaky_split_1 22_164 -23330=4,3,26,26,256 33 | Convolution 23_167 1 1 22_164 23_167_bn_leaky -23330=4,3,26,26,256 0=256 1=1 5=1 6=65536 9=2 -23310=1,1.000000e-01 34 | Split 23_167_bn_leaky_split 1 2 23_167_bn_leaky 23_167_bn_leaky_split_0 23_167_bn_leaky_split_1 -23330=8,3,26,26,256,3,26,26,256 35 | Concat 24_175 2 1 18_135_bn_leaky_split_1 23_167_bn_leaky_split_0 24_175 -23330=4,3,26,26,512 36 | Pooling 25_178 1 1 24_175 25_178 -23330=4,3,13,13,512 1=2 2=2 14=1 15=1 5=1 37 | Convolution 26_182 1 1 25_178 26_182_bn_leaky -23330=4,3,13,13,512 0=512 1=3 4=1 5=1 6=2359296 9=2 -23310=1,1.000000e-01 38 | Convolution 27_192 1 1 26_182_bn_leaky 27_192_bn_leaky -23330=4,3,13,13,256 0=256 1=1 5=1 6=131072 9=2 -23310=1,1.000000e-01 39 | Split 27_192_bn_leaky_split 1 2 27_192_bn_leaky 27_192_bn_leaky_split_0 27_192_bn_leaky_split_1 -23330=8,3,13,13,256,3,13,13,256 40 | Convolution 28_200 1 1 27_192_bn_leaky_split_0 28_200_bn_leaky -23330=4,3,13,13,512 0=512 1=3 4=1 5=1 6=1179648 9=2 -23310=1,1.000000e-01 41 | Convolution 29_208 1 1 28_200_bn_leaky 29_208 -23330=4,3,13,13,255 0=255 1=1 5=1 6=130560 42 | Convolution 32_237 1 1 27_192_bn_leaky_split_1 32_237_bn_leaky -23330=4,3,13,13,128 0=128 1=1 5=1 6=32768 9=2 -23310=1,1.000000e-01 43 | Interp 33_245 1 1 32_237_bn_leaky 33_245 -23330=4,3,26,26,128 0=1 1=2.000000e+00 2=2.000000e+00 44 | Concat 34_248 2 1 33_245 23_167_bn_leaky_split_1 34_248 -23330=4,3,26,26,384 45 | Convolution 35_251 1 1 34_248 35_251_bn_leaky -23330=4,3,26,26,256 0=256 1=3 4=1 5=1 6=884736 9=2 -23310=1,1.000000e-01 46 | Convolution 36_259 1 1 35_251_bn_leaky 36_259 -23330=4,3,26,26,255 0=255 1=1 5=1 6=65280 47 | Yolov3DetectionOutput detection_out 2 1 29_208 36_259 output -23330=4,2,6,1637,1 0=80 1=3 2=3.000001e-01 -23304=12,1.000000e+01,1.400000e+01,2.300000e+01,2.700000e+01,3.700000e+01,5.800000e+01,8.100000e+01,8.200000e+01,1.350000e+02,1.690000e+02,3.440000e+02,3.190000e+02 -23305=6,1077936128,1082130432,1084227584,1065353216,1073741824,1077936128 -23306=2,3.360000e+01,1.680000e+01 48 | -------------------------------------------------------------------------------- /ncnn-rs/examples/benchmark.rs: -------------------------------------------------------------------------------- 1 | use ncnn_rs::DataReader; 2 | use ncnn_rs::Mat; 3 | use ncnn_rs::Net; 4 | use ncnn_rs::Option as ncnn_option; 5 | use std::time; 6 | 7 | fn param_path() -> std::path::PathBuf { 8 | let path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")); 9 | path 10 | } 11 | 12 | fn benchmark(name: &str, mut mat_in: Mat, opt: &ncnn_option, out: &str) -> anyhow::Result<()> { 13 | let mut mat_out = Mat::new(); 14 | mat_in.fill(1.0 as f32); 15 | 16 | let mut net = Net::new(); 17 | let path = param_path().join("../params").join(name); 18 | if !path.exists() { 19 | anyhow::bail!("param not found: {:?}", path) 20 | } 21 | 22 | net.set_option(opt); 23 | net.load_param(path.to_str().unwrap())?; 24 | let dr = DataReader::empty(); 25 | net.load_model_datareader(&dr)?; 26 | 27 | // warmup 28 | let mut ex_warmup = net.create_extractor(); 29 | ex_warmup.input("data", &mat_in)?; 30 | ex_warmup.extract(out, &mut mat_out)?; 31 | 32 | let loop_cnt = 10; 33 | let now = time::Instant::now(); 34 | for _ in 0..loop_cnt { 35 | let mut ex = net.create_extractor(); 36 | ex.input("data", &mat_in)?; 37 | ex.extract(out, &mut mat_out)?; 38 | } 39 | let duration = now.elapsed().as_millis() / loop_cnt; 40 | println!("{} \t\t {} ms", name, duration); 41 | 42 | Ok(()) 43 | } 44 | 45 | fn main() -> anyhow::Result<()> { 46 | let opt = ncnn_option::new(); 47 | // opt.set_num_threads(8); 48 | // opt.set_vulkan_compute(false); 49 | 50 | benchmark( 51 | "squeezenet.param", 52 | Mat::new_3d(227, 227, 3, None), 53 | &opt, 54 | "output", 55 | )?; 56 | 57 | benchmark( 58 | "squeezenet_int8.param", 59 | Mat::new_3d(227, 227, 3, None), 60 | &opt, 61 | "output", 62 | )?; 63 | 64 | benchmark( 65 | "mobilenet.param", 66 | Mat::new_3d(224, 224, 3, None), 67 | &opt, 68 | "output", 69 | )?; 70 | 71 | benchmark( 72 | "mobilenet_int8.param", 73 | Mat::new_3d(224, 224, 3, None), 74 | &opt, 75 | "output", 76 | )?; 77 | 78 | benchmark( 79 | "mobilenet_v2.param", 80 | Mat::new_3d(224, 224, 3, None), 81 | &opt, 82 | "output", 83 | )?; 84 | 85 | benchmark( 86 | "mobilenet_v3.param", 87 | Mat::new_3d(224, 224, 3, None), 88 | &opt, 89 | "output", 90 | )?; 91 | 92 | benchmark( 93 | "shufflenet.param", 94 | Mat::new_3d(224, 224, 3, None), 95 | &opt, 96 | "output", 97 | )?; 98 | 99 | benchmark( 100 | "shufflenet_v2.param", 101 | Mat::new_3d(224, 224, 3, None), 102 | &opt, 103 | "output", 104 | )?; 105 | 106 | benchmark( 107 | "mnasnet.param", 108 | Mat::new_3d(224, 224, 3, None), 109 | &opt, 110 | "output", 111 | )?; 112 | 113 | benchmark( 114 | "proxylessnasnet.param", 115 | Mat::new_3d(224, 224, 3, None), 116 | &opt, 117 | "output", 118 | )?; 119 | 120 | benchmark( 121 | "efficientnet_b0.param", 122 | Mat::new_3d(224, 224, 3, None), 123 | &opt, 124 | "output", 125 | )?; 126 | 127 | // benchmark("efficientnetv2_b0.param", Mat::new_3d(224, 224, 3, None), &opt, "output")?; 128 | 129 | benchmark( 130 | "regnety_400m.param", 131 | Mat::new_3d(224, 224, 3, None), 132 | &opt, 133 | "output", 134 | )?; 135 | 136 | benchmark( 137 | "blazeface.param", 138 | Mat::new_3d(128, 128, 3, None), 139 | &opt, 140 | "output", 141 | )?; 142 | 143 | benchmark( 144 | "googlenet.param", 145 | Mat::new_3d(224, 224, 3, None), 146 | &opt, 147 | "output", 148 | )?; 149 | 150 | benchmark( 151 | "googlenet_int8.param", 152 | Mat::new_3d(224, 224, 3, None), 153 | &opt, 154 | "output", 155 | )?; 156 | 157 | benchmark( 158 | "resnet18.param", 159 | Mat::new_3d(224, 224, 3, None), 160 | &opt, 161 | "output", 162 | )?; 163 | 164 | benchmark( 165 | "resnet18_int8.param", 166 | Mat::new_3d(224, 224, 3, None), 167 | &opt, 168 | "output", 169 | )?; 170 | 171 | benchmark( 172 | "alexnet.param", 173 | Mat::new_3d(227, 227, 3, None), 174 | &opt, 175 | "output", 176 | )?; 177 | 178 | benchmark( 179 | "vgg16.param", 180 | Mat::new_3d(224, 224, 3, None), 181 | &opt, 182 | "output", 183 | )?; 184 | 185 | benchmark( 186 | "vgg16_int8.param", 187 | Mat::new_3d(224, 224, 3, None), 188 | &opt, 189 | "output", 190 | )?; 191 | 192 | benchmark( 193 | "resnet50.param", 194 | Mat::new_3d(224, 224, 3, None), 195 | &opt, 196 | "output", 197 | )?; 198 | 199 | benchmark( 200 | "resnet50_int8.param", 201 | Mat::new_3d(224, 224, 3, None), 202 | &opt, 203 | "output", 204 | )?; 205 | 206 | benchmark( 207 | "squeezenet_ssd.param", 208 | Mat::new_3d(300, 300, 3, None), 209 | &opt, 210 | "output", 211 | )?; 212 | 213 | benchmark( 214 | "squeezenet_ssd_int8.param", 215 | Mat::new_3d(300, 300, 3, None), 216 | &opt, 217 | "output", 218 | )?; 219 | 220 | benchmark( 221 | "mobilenet_ssd.param", 222 | Mat::new_3d(300, 300, 3, None), 223 | &opt, 224 | "output", 225 | )?; 226 | 227 | benchmark( 228 | "mobilenet_ssd_int8.param", 229 | Mat::new_3d(300, 300, 3, None), 230 | &opt, 231 | "output", 232 | )?; 233 | 234 | benchmark( 235 | "mobilenet_yolo.param", 236 | Mat::new_3d(416, 416, 3, None), 237 | &opt, 238 | "output", 239 | )?; 240 | 241 | benchmark( 242 | "mobilenetv2_yolov3.param", 243 | Mat::new_3d(352, 352, 3, None), 244 | &opt, 245 | "output", 246 | )?; 247 | 248 | benchmark( 249 | "yolov4-tiny.param", 250 | Mat::new_3d(416, 416, 3, None), 251 | &opt, 252 | "output", 253 | )?; 254 | 255 | benchmark( 256 | "nanodet-plus-m_416.param", 257 | Mat::new_3d(416, 416, 3, None), 258 | &opt, 259 | "output", 260 | )?; 261 | 262 | benchmark( 263 | "nanodet-plus-m_416-int8.param", 264 | Mat::new_3d(416, 416, 3, None), 265 | &opt, 266 | "output", 267 | )?; 268 | 269 | Ok(()) 270 | } 271 | -------------------------------------------------------------------------------- /params/resnet18.param: -------------------------------------------------------------------------------- 1 | 7767517 2 | 50 58 3 | Input data 0 1 data -23330=4,3,224,224,3 0=224 1=224 2=3 4 | Convolution conv1 1 1 data conv1_conv1_relu -23330=4,3,112,112,64 0=64 1=7 3=2 4=3 5=1 6=9408 9=1 5 | Pooling pool1 1 1 conv1_conv1_relu pool1 -23330=4,3,56,56,64 1=3 2=2 6 | Split splitncnn_0 1 2 pool1 pool1_splitncnn_0 pool1_splitncnn_1 -23330=8,3,56,56,64,3,56,56,64 7 | Convolution res2a_branch1 1 1 pool1_splitncnn_1 res2a_branch1_scale2a_branch1 -23330=4,3,56,56,64 0=64 1=1 5=1 6=4096 8 | Convolution res2a_branch2a 1 1 pool1_splitncnn_0 res2a_branch2a_res2a_branch2a_relu -23330=4,3,56,56,64 0=64 1=3 4=1 5=1 6=36864 9=1 9 | Convolution res2a_branch2b 1 1 res2a_branch2a_res2a_branch2a_relu res2a_branch2b_scale2a_branch2b -23330=4,3,56,56,64 0=64 1=3 4=1 5=1 6=36864 10 | Eltwise res2a 2 1 res2a_branch1_scale2a_branch1 res2a_branch2b_scale2a_branch2b res2a -23330=4,3,56,56,64 0=1 11 | ReLU res2a_relu 1 1 res2a res2a_res2a_relu -23330=4,3,56,56,64 12 | Split splitncnn_1 1 2 res2a_res2a_relu res2a_res2a_relu_splitncnn_0 res2a_res2a_relu_splitncnn_1 -23330=8,3,56,56,64,3,56,56,64 13 | Convolution res2b_branch2a 1 1 res2a_res2a_relu_splitncnn_1 res2b_branch2a_res2b_branch2a_relu -23330=4,3,56,56,64 0=64 1=3 4=1 5=1 6=36864 9=1 14 | Convolution res2b_branch2b 1 1 res2b_branch2a_res2b_branch2a_relu res2b_branch2b_scale2b_branch2b -23330=4,3,56,56,64 0=64 1=3 4=1 5=1 6=36864 15 | Eltwise res2b 2 1 res2a_res2a_relu_splitncnn_0 res2b_branch2b_scale2b_branch2b res2b -23330=4,3,56,56,64 0=1 16 | ReLU res2b_relu 1 1 res2b res2b_res2b_relu -23330=4,3,56,56,64 17 | Split splitncnn_2 1 2 res2b_res2b_relu res2b_res2b_relu_splitncnn_0 res2b_res2b_relu_splitncnn_1 -23330=8,3,56,56,64,3,56,56,64 18 | Convolution res3a_branch1 1 1 res2b_res2b_relu_splitncnn_1 res3a_branch1_scale3a_branch1 -23330=4,3,28,28,128 0=128 1=1 3=2 5=1 6=8192 19 | Convolution res3a_branch2a 1 1 res2b_res2b_relu_splitncnn_0 res3a_branch2a_res3a_branch2a_relu -23330=4,3,28,28,128 0=128 1=3 3=2 4=1 5=1 6=73728 9=1 20 | Convolution res3a_branch2b 1 1 res3a_branch2a_res3a_branch2a_relu res3a_branch2b_scale3a_branch2b -23330=4,3,28,28,128 0=128 1=3 4=1 5=1 6=147456 21 | Eltwise res3a 2 1 res3a_branch1_scale3a_branch1 res3a_branch2b_scale3a_branch2b res3a -23330=4,3,28,28,128 0=1 22 | ReLU res3a_relu 1 1 res3a res3a_res3a_relu -23330=4,3,28,28,128 23 | Split splitncnn_3 1 2 res3a_res3a_relu res3a_res3a_relu_splitncnn_0 res3a_res3a_relu_splitncnn_1 -23330=8,3,28,28,128,3,28,28,128 24 | Convolution res3b_branch2a 1 1 res3a_res3a_relu_splitncnn_1 res3b_branch2a_res3b_branch2a_relu -23330=4,3,28,28,128 0=128 1=3 4=1 5=1 6=147456 9=1 25 | Convolution res3b_branch2b 1 1 res3b_branch2a_res3b_branch2a_relu res3b_branch2b_scale3b_branch2b -23330=4,3,28,28,128 0=128 1=3 4=1 5=1 6=147456 26 | Eltwise res3b 2 1 res3a_res3a_relu_splitncnn_0 res3b_branch2b_scale3b_branch2b res3b -23330=4,3,28,28,128 0=1 27 | ReLU res3b_relu 1 1 res3b res3b_res3b_relu -23330=4,3,28,28,128 28 | Split splitncnn_4 1 2 res3b_res3b_relu res3b_res3b_relu_splitncnn_0 res3b_res3b_relu_splitncnn_1 -23330=8,3,28,28,128,3,28,28,128 29 | Convolution res4a_branch1 1 1 res3b_res3b_relu_splitncnn_1 res4a_branch1_scale4a_branch1 -23330=4,3,14,14,256 0=256 1=1 3=2 5=1 6=32768 30 | Convolution res4a_branch2a 1 1 res3b_res3b_relu_splitncnn_0 res4a_branch2a_res4a_branch2a_relu -23330=4,3,14,14,256 0=256 1=3 3=2 4=1 5=1 6=294912 9=1 31 | Convolution res4a_branch2b 1 1 res4a_branch2a_res4a_branch2a_relu res4a_branch2b_scale4a_branch2b -23330=4,3,14,14,256 0=256 1=3 4=1 5=1 6=589824 32 | Eltwise res4a 2 1 res4a_branch1_scale4a_branch1 res4a_branch2b_scale4a_branch2b res4a -23330=4,3,14,14,256 0=1 33 | ReLU res4a_relu 1 1 res4a res4a_res4a_relu -23330=4,3,14,14,256 34 | Split splitncnn_5 1 2 res4a_res4a_relu res4a_res4a_relu_splitncnn_0 res4a_res4a_relu_splitncnn_1 -23330=8,3,14,14,256,3,14,14,256 35 | Convolution res4b_branch2a 1 1 res4a_res4a_relu_splitncnn_1 res4b_branch2a_res4b_branch2a_relu -23330=4,3,14,14,256 0=256 1=3 4=1 5=1 6=589824 9=1 36 | Convolution res4b_branch2b 1 1 res4b_branch2a_res4b_branch2a_relu res4b_branch2b_scale4b_branch2b -23330=4,3,14,14,256 0=256 1=3 4=1 5=1 6=589824 37 | Eltwise res4b 2 1 res4a_res4a_relu_splitncnn_0 res4b_branch2b_scale4b_branch2b res4b -23330=4,3,14,14,256 0=1 38 | ReLU res4b_relu 1 1 res4b res4b_res4b_relu -23330=4,3,14,14,256 39 | Split splitncnn_6 1 2 res4b_res4b_relu res4b_res4b_relu_splitncnn_0 res4b_res4b_relu_splitncnn_1 -23330=8,3,14,14,256,3,14,14,256 40 | Convolution res5a_branch1 1 1 res4b_res4b_relu_splitncnn_1 res5a_branch1_scale5a_branch1 -23330=4,3,7,7,512 0=512 1=1 3=2 5=1 6=131072 41 | Convolution res5a_branch2a 1 1 res4b_res4b_relu_splitncnn_0 res5a_branch2a_res5a_branch2a_relu -23330=4,3,7,7,512 0=512 1=3 3=2 4=1 5=1 6=1179648 9=1 42 | Convolution res5a_branch2b 1 1 res5a_branch2a_res5a_branch2a_relu res5a_branch2b_scale5a_branch2b -23330=4,3,7,7,512 0=512 1=3 4=1 5=1 6=2359296 43 | Eltwise res5a 2 1 res5a_branch1_scale5a_branch1 res5a_branch2b_scale5a_branch2b res5a -23330=4,3,7,7,512 0=1 44 | ReLU res5a_relu 1 1 res5a res5a_res5a_relu -23330=4,3,7,7,512 45 | Split splitncnn_7 1 2 res5a_res5a_relu res5a_res5a_relu_splitncnn_0 res5a_res5a_relu_splitncnn_1 -23330=8,3,7,7,512,3,7,7,512 46 | Convolution res5b_branch2a 1 1 res5a_res5a_relu_splitncnn_1 res5b_branch2a_res5b_branch2a_relu -23330=4,3,7,7,512 0=512 1=3 4=1 5=1 6=2359296 9=1 47 | Convolution res5b_branch2b 1 1 res5b_branch2a_res5b_branch2a_relu res5b_branch2b_scale5b_branch2b -23330=4,3,7,7,512 0=512 1=3 4=1 5=1 6=2359296 48 | Eltwise res5b 2 1 res5a_res5a_relu_splitncnn_0 res5b_branch2b_scale5b_branch2b res5b -23330=4,3,7,7,512 0=1 49 | ReLU res5b_relu 1 1 res5b res5b_res5b_relu -23330=4,3,7,7,512 50 | Pooling pool5 1 1 res5b_res5b_relu pool5 -23330=4,3,1,1,512 0=1 1=7 51 | InnerProduct fc1000 1 1 pool5 fc1000 -23330=4,1,1000,1,1 0=1000 1=1 2=512000 52 | Softmax prob 1 1 fc1000 output -23330=4,1,1000,1,1 53 | -------------------------------------------------------------------------------- /params/squeezenet_int8.param: -------------------------------------------------------------------------------- 1 | 7767517 2 | 48 56 3 | Input data 0 1 data 0=227 1=227 2=3 4 | Convolution conv1 1 1 data conv1_relu_conv1 0=64 1=3 3=2 5=1 6=1728 8=2 9=1 5 | Pooling pool1 1 1 conv1_relu_conv1 pool1 1=3 2=2 6 | Convolution fire2/squeeze1x1 1 1 pool1 fire2/squeeze1x1_fire2/relu_squeeze1x1 0=16 1=1 5=1 6=1024 8=102 9=1 7 | Split splitncnn_0 1 2 fire2/squeeze1x1_fire2/relu_squeeze1x1 fire2/squeeze1x1_fire2/relu_squeeze1x1_splitncnn_0 fire2/squeeze1x1_fire2/relu_squeeze1x1_splitncnn_1 8 | Convolution fire2/expand1x1 1 1 fire2/squeeze1x1_fire2/relu_squeeze1x1_splitncnn_1 fire2/expand1x1_fire2/relu_expand1x1 0=64 1=1 5=1 6=1024 8=2 9=1 9 | Convolution fire2/expand3x3 1 1 fire2/squeeze1x1_fire2/relu_squeeze1x1_splitncnn_0 fire2/expand3x3_fire2/relu_expand3x3 0=64 1=3 4=1 5=1 6=9216 8=2 9=1 10 | Concat fire2/concat 2 1 fire2/expand1x1_fire2/relu_expand1x1 fire2/expand3x3_fire2/relu_expand3x3 fire2/concat 11 | Convolution fire3/squeeze1x1 1 1 fire2/concat fire3/squeeze1x1_fire3/relu_squeeze1x1 0=16 1=1 5=1 6=2048 8=102 9=1 12 | Split splitncnn_1 1 2 fire3/squeeze1x1_fire3/relu_squeeze1x1 fire3/squeeze1x1_fire3/relu_squeeze1x1_splitncnn_0 fire3/squeeze1x1_fire3/relu_squeeze1x1_splitncnn_1 13 | Convolution fire3/expand1x1 1 1 fire3/squeeze1x1_fire3/relu_squeeze1x1_splitncnn_1 fire3/expand1x1_fire3/relu_expand1x1 0=64 1=1 5=1 6=1024 8=2 9=1 14 | Convolution fire3/expand3x3 1 1 fire3/squeeze1x1_fire3/relu_squeeze1x1_splitncnn_0 fire3/expand3x3_fire3/relu_expand3x3 0=64 1=3 4=1 5=1 6=9216 8=2 9=1 15 | Concat fire3/concat 2 1 fire3/expand1x1_fire3/relu_expand1x1 fire3/expand3x3_fire3/relu_expand3x3 fire3/concat 16 | Pooling pool3 1 1 fire3/concat pool3 1=3 2=2 17 | Convolution fire4/squeeze1x1 1 1 pool3 fire4/squeeze1x1_fire4/relu_squeeze1x1 0=32 1=1 5=1 6=4096 8=102 9=1 18 | Split splitncnn_2 1 2 fire4/squeeze1x1_fire4/relu_squeeze1x1 fire4/squeeze1x1_fire4/relu_squeeze1x1_splitncnn_0 fire4/squeeze1x1_fire4/relu_squeeze1x1_splitncnn_1 19 | Convolution fire4/expand1x1 1 1 fire4/squeeze1x1_fire4/relu_squeeze1x1_splitncnn_1 fire4/expand1x1_fire4/relu_expand1x1 0=128 1=1 5=1 6=4096 8=2 9=1 20 | Convolution fire4/expand3x3 1 1 fire4/squeeze1x1_fire4/relu_squeeze1x1_splitncnn_0 fire4/expand3x3_fire4/relu_expand3x3 0=128 1=3 4=1 5=1 6=36864 8=2 9=1 21 | Concat fire4/concat 2 1 fire4/expand1x1_fire4/relu_expand1x1 fire4/expand3x3_fire4/relu_expand3x3 fire4/concat 22 | Convolution fire5/squeeze1x1 1 1 fire4/concat fire5/squeeze1x1_fire5/relu_squeeze1x1 0=32 1=1 5=1 6=8192 8=102 9=1 23 | Split splitncnn_3 1 2 fire5/squeeze1x1_fire5/relu_squeeze1x1 fire5/squeeze1x1_fire5/relu_squeeze1x1_splitncnn_0 fire5/squeeze1x1_fire5/relu_squeeze1x1_splitncnn_1 24 | Convolution fire5/expand1x1 1 1 fire5/squeeze1x1_fire5/relu_squeeze1x1_splitncnn_1 fire5/expand1x1_fire5/relu_expand1x1 0=128 1=1 5=1 6=4096 8=2 9=1 25 | Convolution fire5/expand3x3 1 1 fire5/squeeze1x1_fire5/relu_squeeze1x1_splitncnn_0 fire5/expand3x3_fire5/relu_expand3x3 0=128 1=3 4=1 5=1 6=36864 8=2 9=1 26 | Concat fire5/concat 2 1 fire5/expand1x1_fire5/relu_expand1x1 fire5/expand3x3_fire5/relu_expand3x3 fire5/concat 27 | Pooling pool5 1 1 fire5/concat pool5 1=3 2=2 28 | Convolution fire6/squeeze1x1 1 1 pool5 fire6/squeeze1x1_fire6/relu_squeeze1x1 0=48 1=1 5=1 6=12288 8=102 9=1 29 | Split splitncnn_4 1 2 fire6/squeeze1x1_fire6/relu_squeeze1x1 fire6/squeeze1x1_fire6/relu_squeeze1x1_splitncnn_0 fire6/squeeze1x1_fire6/relu_squeeze1x1_splitncnn_1 30 | Convolution fire6/expand1x1 1 1 fire6/squeeze1x1_fire6/relu_squeeze1x1_splitncnn_1 fire6/expand1x1_fire6/relu_expand1x1 0=192 1=1 5=1 6=9216 8=2 9=1 31 | Convolution fire6/expand3x3 1 1 fire6/squeeze1x1_fire6/relu_squeeze1x1_splitncnn_0 fire6/expand3x3_fire6/relu_expand3x3 0=192 1=3 4=1 5=1 6=82944 8=2 9=1 32 | Concat fire6/concat 2 1 fire6/expand1x1_fire6/relu_expand1x1 fire6/expand3x3_fire6/relu_expand3x3 fire6/concat 33 | Convolution fire7/squeeze1x1 1 1 fire6/concat fire7/squeeze1x1_fire7/relu_squeeze1x1 0=48 1=1 5=1 6=18432 8=102 9=1 34 | Split splitncnn_5 1 2 fire7/squeeze1x1_fire7/relu_squeeze1x1 fire7/squeeze1x1_fire7/relu_squeeze1x1_splitncnn_0 fire7/squeeze1x1_fire7/relu_squeeze1x1_splitncnn_1 35 | Convolution fire7/expand1x1 1 1 fire7/squeeze1x1_fire7/relu_squeeze1x1_splitncnn_1 fire7/expand1x1_fire7/relu_expand1x1 0=192 1=1 5=1 6=9216 8=2 9=1 36 | Convolution fire7/expand3x3 1 1 fire7/squeeze1x1_fire7/relu_squeeze1x1_splitncnn_0 fire7/expand3x3_fire7/relu_expand3x3 0=192 1=3 4=1 5=1 6=82944 8=2 9=1 37 | Concat fire7/concat 2 1 fire7/expand1x1_fire7/relu_expand1x1 fire7/expand3x3_fire7/relu_expand3x3 fire7/concat 38 | Convolution fire8/squeeze1x1 1 1 fire7/concat fire8/squeeze1x1_fire8/relu_squeeze1x1 0=64 1=1 5=1 6=24576 8=102 9=1 39 | Split splitncnn_6 1 2 fire8/squeeze1x1_fire8/relu_squeeze1x1 fire8/squeeze1x1_fire8/relu_squeeze1x1_splitncnn_0 fire8/squeeze1x1_fire8/relu_squeeze1x1_splitncnn_1 40 | Convolution fire8/expand1x1 1 1 fire8/squeeze1x1_fire8/relu_squeeze1x1_splitncnn_1 fire8/expand1x1_fire8/relu_expand1x1 0=256 1=1 5=1 6=16384 8=2 9=1 41 | Convolution fire8/expand3x3 1 1 fire8/squeeze1x1_fire8/relu_squeeze1x1_splitncnn_0 fire8/expand3x3_fire8/relu_expand3x3 0=256 1=3 4=1 5=1 6=147456 8=2 9=1 42 | Concat fire8/concat 2 1 fire8/expand1x1_fire8/relu_expand1x1 fire8/expand3x3_fire8/relu_expand3x3 fire8/concat 43 | Convolution fire9/squeeze1x1 1 1 fire8/concat fire9/squeeze1x1_fire9/relu_squeeze1x1 0=64 1=1 5=1 6=32768 8=102 9=1 44 | Split splitncnn_7 1 2 fire9/squeeze1x1_fire9/relu_squeeze1x1 fire9/squeeze1x1_fire9/relu_squeeze1x1_splitncnn_0 fire9/squeeze1x1_fire9/relu_squeeze1x1_splitncnn_1 45 | Convolution fire9/expand1x1 1 1 fire9/squeeze1x1_fire9/relu_squeeze1x1_splitncnn_1 fire9/expand1x1_fire9/relu_expand1x1 0=256 1=1 5=1 6=16384 8=2 9=1 46 | Convolution fire9/expand3x3 1 1 fire9/squeeze1x1_fire9/relu_squeeze1x1_splitncnn_0 fire9/expand3x3_fire9/relu_expand3x3 0=256 1=3 4=1 5=1 6=147456 8=2 9=1 47 | Concat fire9/concat 2 1 fire9/expand1x1_fire9/relu_expand1x1 fire9/expand3x3_fire9/relu_expand3x3 fire9/concat_drop9 48 | Convolution conv10 1 1 fire9/concat_drop9 conv10_relu_conv10 0=1000 1=1 4=1 5=1 6=512000 8=2 9=1 49 | Pooling pool10 1 1 conv10_relu_conv10 pool10 0=1 4=1 50 | Softmax prob 1 1 pool10 output 51 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "anyhow" 7 | version = "1.0.51" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "8b26702f315f53b6071259e15dd9d64528213b44d61de1ec926eca7715d62203" 10 | 11 | [[package]] 12 | name = "bindgen" 13 | version = "0.59.2" 14 | source = "registry+https://github.com/rust-lang/crates.io-index" 15 | checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8" 16 | dependencies = [ 17 | "bitflags", 18 | "cexpr", 19 | "clang-sys", 20 | "lazy_static", 21 | "lazycell", 22 | "peeking_take_while", 23 | "proc-macro2", 24 | "quote", 25 | "regex", 26 | "rustc-hash", 27 | "shlex", 28 | ] 29 | 30 | [[package]] 31 | name = "bitflags" 32 | version = "1.3.2" 33 | source = "registry+https://github.com/rust-lang/crates.io-index" 34 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 35 | 36 | [[package]] 37 | name = "cc" 38 | version = "1.0.72" 39 | source = "registry+https://github.com/rust-lang/crates.io-index" 40 | checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" 41 | 42 | [[package]] 43 | name = "cexpr" 44 | version = "0.6.0" 45 | source = "registry+https://github.com/rust-lang/crates.io-index" 46 | checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" 47 | dependencies = [ 48 | "nom", 49 | ] 50 | 51 | [[package]] 52 | name = "cfg-if" 53 | version = "1.0.0" 54 | source = "registry+https://github.com/rust-lang/crates.io-index" 55 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 56 | 57 | [[package]] 58 | name = "clang-sys" 59 | version = "1.3.0" 60 | source = "registry+https://github.com/rust-lang/crates.io-index" 61 | checksum = "fa66045b9cb23c2e9c1520732030608b02ee07e5cfaa5a521ec15ded7fa24c90" 62 | dependencies = [ 63 | "glob", 64 | "libc", 65 | "libloading", 66 | ] 67 | 68 | [[package]] 69 | name = "cmake" 70 | version = "0.1.46" 71 | source = "registry+https://github.com/rust-lang/crates.io-index" 72 | checksum = "b7b858541263efe664aead4a5209a4ae5c5d2811167d4ed4ee0944503f8d2089" 73 | dependencies = [ 74 | "cc", 75 | ] 76 | 77 | [[package]] 78 | name = "glob" 79 | version = "0.3.0" 80 | source = "registry+https://github.com/rust-lang/crates.io-index" 81 | checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" 82 | 83 | [[package]] 84 | name = "lazy_static" 85 | version = "1.4.0" 86 | source = "registry+https://github.com/rust-lang/crates.io-index" 87 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 88 | 89 | [[package]] 90 | name = "lazycell" 91 | version = "1.3.0" 92 | source = "registry+https://github.com/rust-lang/crates.io-index" 93 | checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" 94 | 95 | [[package]] 96 | name = "libc" 97 | version = "0.2.109" 98 | source = "registry+https://github.com/rust-lang/crates.io-index" 99 | checksum = "f98a04dce437184842841303488f70d0188c5f51437d2a834dc097eafa909a01" 100 | 101 | [[package]] 102 | name = "libloading" 103 | version = "0.7.2" 104 | source = "registry+https://github.com/rust-lang/crates.io-index" 105 | checksum = "afe203d669ec979b7128619bae5a63b7b42e9203c1b29146079ee05e2f604b52" 106 | dependencies = [ 107 | "cfg-if", 108 | "winapi", 109 | ] 110 | 111 | [[package]] 112 | name = "memchr" 113 | version = "2.4.1" 114 | source = "registry+https://github.com/rust-lang/crates.io-index" 115 | checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" 116 | 117 | [[package]] 118 | name = "minimal-lexical" 119 | version = "0.2.1" 120 | source = "registry+https://github.com/rust-lang/crates.io-index" 121 | checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" 122 | 123 | [[package]] 124 | name = "ncnn-bind" 125 | version = "0.1.2" 126 | dependencies = [ 127 | "bindgen", 128 | "cmake", 129 | "libc", 130 | "vcpkg", 131 | ] 132 | 133 | [[package]] 134 | name = "ncnn-rs" 135 | version = "0.1.2" 136 | dependencies = [ 137 | "anyhow", 138 | "libc", 139 | "ncnn-bind", 140 | ] 141 | 142 | [[package]] 143 | name = "nom" 144 | version = "7.1.0" 145 | source = "registry+https://github.com/rust-lang/crates.io-index" 146 | checksum = "1b1d11e1ef389c76fe5b81bcaf2ea32cf88b62bc494e19f493d0b30e7a930109" 147 | dependencies = [ 148 | "memchr", 149 | "minimal-lexical", 150 | "version_check", 151 | ] 152 | 153 | [[package]] 154 | name = "peeking_take_while" 155 | version = "0.1.2" 156 | source = "registry+https://github.com/rust-lang/crates.io-index" 157 | checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" 158 | 159 | [[package]] 160 | name = "proc-macro2" 161 | version = "1.0.33" 162 | source = "registry+https://github.com/rust-lang/crates.io-index" 163 | checksum = "fb37d2df5df740e582f28f8560cf425f52bb267d872fe58358eadb554909f07a" 164 | dependencies = [ 165 | "unicode-xid", 166 | ] 167 | 168 | [[package]] 169 | name = "quote" 170 | version = "1.0.10" 171 | source = "registry+https://github.com/rust-lang/crates.io-index" 172 | checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" 173 | dependencies = [ 174 | "proc-macro2", 175 | ] 176 | 177 | [[package]] 178 | name = "regex" 179 | version = "1.5.4" 180 | source = "registry+https://github.com/rust-lang/crates.io-index" 181 | checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" 182 | dependencies = [ 183 | "regex-syntax", 184 | ] 185 | 186 | [[package]] 187 | name = "regex-syntax" 188 | version = "0.6.25" 189 | source = "registry+https://github.com/rust-lang/crates.io-index" 190 | checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" 191 | 192 | [[package]] 193 | name = "rustc-hash" 194 | version = "1.1.0" 195 | source = "registry+https://github.com/rust-lang/crates.io-index" 196 | checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" 197 | 198 | [[package]] 199 | name = "shlex" 200 | version = "1.1.0" 201 | source = "registry+https://github.com/rust-lang/crates.io-index" 202 | checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" 203 | 204 | [[package]] 205 | name = "unicode-xid" 206 | version = "0.2.2" 207 | source = "registry+https://github.com/rust-lang/crates.io-index" 208 | checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" 209 | 210 | [[package]] 211 | name = "vcpkg" 212 | version = "0.2.15" 213 | source = "registry+https://github.com/rust-lang/crates.io-index" 214 | checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" 215 | 216 | [[package]] 217 | name = "version_check" 218 | version = "0.9.3" 219 | source = "registry+https://github.com/rust-lang/crates.io-index" 220 | checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" 221 | 222 | [[package]] 223 | name = "winapi" 224 | version = "0.3.9" 225 | source = "registry+https://github.com/rust-lang/crates.io-index" 226 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 227 | dependencies = [ 228 | "winapi-i686-pc-windows-gnu", 229 | "winapi-x86_64-pc-windows-gnu", 230 | ] 231 | 232 | [[package]] 233 | name = "winapi-i686-pc-windows-gnu" 234 | version = "0.4.0" 235 | source = "registry+https://github.com/rust-lang/crates.io-index" 236 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 237 | 238 | [[package]] 239 | name = "winapi-x86_64-pc-windows-gnu" 240 | version = "0.4.0" 241 | source = "registry+https://github.com/rust-lang/crates.io-index" 242 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 243 | -------------------------------------------------------------------------------- /params/squeezenet.param: -------------------------------------------------------------------------------- 1 | 7767517 2 | 48 56 3 | Input data 0 1 data -23330=4,3,227,227,3 0=227 1=227 2=3 4 | Convolution conv1 1 1 data conv1_relu_conv1 -23330=4,3,113,113,64 0=64 1=3 3=2 5=1 6=1728 9=1 5 | Pooling pool1 1 1 conv1_relu_conv1 pool1 -23330=4,3,56,56,64 1=3 2=2 6 | Convolution fire2/squeeze1x1 1 1 pool1 fire2/squeeze1x1_fire2/relu_squeeze1x1 -23330=4,3,56,56,16 0=16 1=1 5=1 6=1024 9=1 7 | Split splitncnn_0 1 2 fire2/squeeze1x1_fire2/relu_squeeze1x1 fire2/squeeze1x1_fire2/relu_squeeze1x1_splitncnn_0 fire2/squeeze1x1_fire2/relu_squeeze1x1_splitncnn_1 -23330=8,3,56,56,16,3,56,56,16 8 | Convolution fire2/expand1x1 1 1 fire2/squeeze1x1_fire2/relu_squeeze1x1_splitncnn_1 fire2/expand1x1_fire2/relu_expand1x1 -23330=4,3,56,56,64 0=64 1=1 5=1 6=1024 9=1 9 | Convolution fire2/expand3x3 1 1 fire2/squeeze1x1_fire2/relu_squeeze1x1_splitncnn_0 fire2/expand3x3_fire2/relu_expand3x3 -23330=4,3,56,56,64 0=64 1=3 4=1 5=1 6=9216 9=1 10 | Concat fire2/concat 2 1 fire2/expand1x1_fire2/relu_expand1x1 fire2/expand3x3_fire2/relu_expand3x3 fire2/concat -23330=4,3,56,56,128 11 | Convolution fire3/squeeze1x1 1 1 fire2/concat fire3/squeeze1x1_fire3/relu_squeeze1x1 -23330=4,3,56,56,16 0=16 1=1 5=1 6=2048 9=1 12 | Split splitncnn_1 1 2 fire3/squeeze1x1_fire3/relu_squeeze1x1 fire3/squeeze1x1_fire3/relu_squeeze1x1_splitncnn_0 fire3/squeeze1x1_fire3/relu_squeeze1x1_splitncnn_1 -23330=8,3,56,56,16,3,56,56,16 13 | Convolution fire3/expand1x1 1 1 fire3/squeeze1x1_fire3/relu_squeeze1x1_splitncnn_1 fire3/expand1x1_fire3/relu_expand1x1 -23330=4,3,56,56,64 0=64 1=1 5=1 6=1024 9=1 14 | Convolution fire3/expand3x3 1 1 fire3/squeeze1x1_fire3/relu_squeeze1x1_splitncnn_0 fire3/expand3x3_fire3/relu_expand3x3 -23330=4,3,56,56,64 0=64 1=3 4=1 5=1 6=9216 9=1 15 | Concat fire3/concat 2 1 fire3/expand1x1_fire3/relu_expand1x1 fire3/expand3x3_fire3/relu_expand3x3 fire3/concat -23330=4,3,56,56,128 16 | Pooling pool3 1 1 fire3/concat pool3 -23330=4,3,28,28,128 1=3 2=2 17 | Convolution fire4/squeeze1x1 1 1 pool3 fire4/squeeze1x1_fire4/relu_squeeze1x1 -23330=4,3,28,28,32 0=32 1=1 5=1 6=4096 9=1 18 | Split splitncnn_2 1 2 fire4/squeeze1x1_fire4/relu_squeeze1x1 fire4/squeeze1x1_fire4/relu_squeeze1x1_splitncnn_0 fire4/squeeze1x1_fire4/relu_squeeze1x1_splitncnn_1 -23330=8,3,28,28,32,3,28,28,32 19 | Convolution fire4/expand1x1 1 1 fire4/squeeze1x1_fire4/relu_squeeze1x1_splitncnn_1 fire4/expand1x1_fire4/relu_expand1x1 -23330=4,3,28,28,128 0=128 1=1 5=1 6=4096 9=1 20 | Convolution fire4/expand3x3 1 1 fire4/squeeze1x1_fire4/relu_squeeze1x1_splitncnn_0 fire4/expand3x3_fire4/relu_expand3x3 -23330=4,3,28,28,128 0=128 1=3 4=1 5=1 6=36864 9=1 21 | Concat fire4/concat 2 1 fire4/expand1x1_fire4/relu_expand1x1 fire4/expand3x3_fire4/relu_expand3x3 fire4/concat -23330=4,3,28,28,256 22 | Convolution fire5/squeeze1x1 1 1 fire4/concat fire5/squeeze1x1_fire5/relu_squeeze1x1 -23330=4,3,28,28,32 0=32 1=1 5=1 6=8192 9=1 23 | Split splitncnn_3 1 2 fire5/squeeze1x1_fire5/relu_squeeze1x1 fire5/squeeze1x1_fire5/relu_squeeze1x1_splitncnn_0 fire5/squeeze1x1_fire5/relu_squeeze1x1_splitncnn_1 -23330=8,3,28,28,32,3,28,28,32 24 | Convolution fire5/expand1x1 1 1 fire5/squeeze1x1_fire5/relu_squeeze1x1_splitncnn_1 fire5/expand1x1_fire5/relu_expand1x1 -23330=4,3,28,28,128 0=128 1=1 5=1 6=4096 9=1 25 | Convolution fire5/expand3x3 1 1 fire5/squeeze1x1_fire5/relu_squeeze1x1_splitncnn_0 fire5/expand3x3_fire5/relu_expand3x3 -23330=4,3,28,28,128 0=128 1=3 4=1 5=1 6=36864 9=1 26 | Concat fire5/concat 2 1 fire5/expand1x1_fire5/relu_expand1x1 fire5/expand3x3_fire5/relu_expand3x3 fire5/concat -23330=4,3,28,28,256 27 | Pooling pool5 1 1 fire5/concat pool5 -23330=4,3,14,14,256 1=3 2=2 28 | Convolution fire6/squeeze1x1 1 1 pool5 fire6/squeeze1x1_fire6/relu_squeeze1x1 -23330=4,3,14,14,48 0=48 1=1 5=1 6=12288 9=1 29 | Split splitncnn_4 1 2 fire6/squeeze1x1_fire6/relu_squeeze1x1 fire6/squeeze1x1_fire6/relu_squeeze1x1_splitncnn_0 fire6/squeeze1x1_fire6/relu_squeeze1x1_splitncnn_1 -23330=8,3,14,14,48,3,14,14,48 30 | Convolution fire6/expand1x1 1 1 fire6/squeeze1x1_fire6/relu_squeeze1x1_splitncnn_1 fire6/expand1x1_fire6/relu_expand1x1 -23330=4,3,14,14,192 0=192 1=1 5=1 6=9216 9=1 31 | Convolution fire6/expand3x3 1 1 fire6/squeeze1x1_fire6/relu_squeeze1x1_splitncnn_0 fire6/expand3x3_fire6/relu_expand3x3 -23330=4,3,14,14,192 0=192 1=3 4=1 5=1 6=82944 9=1 32 | Concat fire6/concat 2 1 fire6/expand1x1_fire6/relu_expand1x1 fire6/expand3x3_fire6/relu_expand3x3 fire6/concat -23330=4,3,14,14,384 33 | Convolution fire7/squeeze1x1 1 1 fire6/concat fire7/squeeze1x1_fire7/relu_squeeze1x1 -23330=4,3,14,14,48 0=48 1=1 5=1 6=18432 9=1 34 | Split splitncnn_5 1 2 fire7/squeeze1x1_fire7/relu_squeeze1x1 fire7/squeeze1x1_fire7/relu_squeeze1x1_splitncnn_0 fire7/squeeze1x1_fire7/relu_squeeze1x1_splitncnn_1 -23330=8,3,14,14,48,3,14,14,48 35 | Convolution fire7/expand1x1 1 1 fire7/squeeze1x1_fire7/relu_squeeze1x1_splitncnn_1 fire7/expand1x1_fire7/relu_expand1x1 -23330=4,3,14,14,192 0=192 1=1 5=1 6=9216 9=1 36 | Convolution fire7/expand3x3 1 1 fire7/squeeze1x1_fire7/relu_squeeze1x1_splitncnn_0 fire7/expand3x3_fire7/relu_expand3x3 -23330=4,3,14,14,192 0=192 1=3 4=1 5=1 6=82944 9=1 37 | Concat fire7/concat 2 1 fire7/expand1x1_fire7/relu_expand1x1 fire7/expand3x3_fire7/relu_expand3x3 fire7/concat -23330=4,3,14,14,384 38 | Convolution fire8/squeeze1x1 1 1 fire7/concat fire8/squeeze1x1_fire8/relu_squeeze1x1 -23330=4,3,14,14,64 0=64 1=1 5=1 6=24576 9=1 39 | Split splitncnn_6 1 2 fire8/squeeze1x1_fire8/relu_squeeze1x1 fire8/squeeze1x1_fire8/relu_squeeze1x1_splitncnn_0 fire8/squeeze1x1_fire8/relu_squeeze1x1_splitncnn_1 -23330=8,3,14,14,64,3,14,14,64 40 | Convolution fire8/expand1x1 1 1 fire8/squeeze1x1_fire8/relu_squeeze1x1_splitncnn_1 fire8/expand1x1_fire8/relu_expand1x1 -23330=4,3,14,14,256 0=256 1=1 5=1 6=16384 9=1 41 | Convolution fire8/expand3x3 1 1 fire8/squeeze1x1_fire8/relu_squeeze1x1_splitncnn_0 fire8/expand3x3_fire8/relu_expand3x3 -23330=4,3,14,14,256 0=256 1=3 4=1 5=1 6=147456 9=1 42 | Concat fire8/concat 2 1 fire8/expand1x1_fire8/relu_expand1x1 fire8/expand3x3_fire8/relu_expand3x3 fire8/concat -23330=4,3,14,14,512 43 | Convolution fire9/squeeze1x1 1 1 fire8/concat fire9/squeeze1x1_fire9/relu_squeeze1x1 -23330=4,3,14,14,64 0=64 1=1 5=1 6=32768 9=1 44 | Split splitncnn_7 1 2 fire9/squeeze1x1_fire9/relu_squeeze1x1 fire9/squeeze1x1_fire9/relu_squeeze1x1_splitncnn_0 fire9/squeeze1x1_fire9/relu_squeeze1x1_splitncnn_1 -23330=8,3,14,14,64,3,14,14,64 45 | Convolution fire9/expand1x1 1 1 fire9/squeeze1x1_fire9/relu_squeeze1x1_splitncnn_1 fire9/expand1x1_fire9/relu_expand1x1 -23330=4,3,14,14,256 0=256 1=1 5=1 6=16384 9=1 46 | Convolution fire9/expand3x3 1 1 fire9/squeeze1x1_fire9/relu_squeeze1x1_splitncnn_0 fire9/expand3x3_fire9/relu_expand3x3 -23330=4,3,14,14,256 0=256 1=3 4=1 5=1 6=147456 9=1 47 | Concat fire9/concat 2 1 fire9/expand1x1_fire9/relu_expand1x1 fire9/expand3x3_fire9/relu_expand3x3 fire9/concat_drop9 -23330=4,3,14,14,512 48 | Convolution conv10 1 1 fire9/concat_drop9 conv10_relu_conv10 -23330=4,3,16,16,1000 0=1000 1=1 4=1 5=1 6=512000 9=1 49 | Pooling pool10 1 1 conv10_relu_conv10 pool10 -23330=4,1,1000,1,1 0=1 4=1 50 | Softmax prob 1 1 pool10 output -23330=4,1,1000,1,1 51 | -------------------------------------------------------------------------------- /params/blazeface.param: -------------------------------------------------------------------------------- 1 | 7767517 2 | 101 117 3 | Input data 0 1 data 0=128 1=128 2=3 4 | Padding 75 1 1 data 75 0=1 1=2 2=1 3=2 4=0 5=0.000000e+00 7=0 8=0 5 | Convolution 76 1 1 75 76 0=24 1=5 11=5 2=1 12=1 3=2 13=2 4=0 14=0 15=0 16=0 5=1 6=1800 6 | ReLU 77 1 1 76 77 7 | Split splitncnn_0 1 2 77 77_splitncnn_0 77_splitncnn_1 8 | ConvolutionDepthWise 78 1 1 77_splitncnn_1 78 0=24 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=216 7=24 9 | Convolution 79 1 1 78 79 0=24 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=576 10 | BinaryOp 80 2 1 79 77_splitncnn_0 80 0=0 11 | ReLU 81 1 1 80 81 12 | Split splitncnn_1 1 2 81 81_splitncnn_0 81_splitncnn_1 13 | Padding 82 1 1 81_splitncnn_1 82 0=0 1=0 2=0 3=0 4=0 5=0.000000e+00 7=0 8=4 14 | ConvolutionDepthWise 83 1 1 81_splitncnn_0 83 0=24 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=216 7=24 15 | Convolution 84 1 1 83 84 0=28 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=672 16 | BinaryOp 85 2 1 84 82 85 0=0 17 | ReLU 86 1 1 85 86 18 | Split splitncnn_2 1 2 86 86_splitncnn_0 86_splitncnn_1 19 | Padding 87 1 1 86_splitncnn_1 87 0=0 1=2 2=0 3=2 4=0 5=0.000000e+00 7=0 8=0 20 | Pooling 88 1 1 86_splitncnn_0 88 0=0 1=2 11=2 2=2 12=2 3=0 13=0 14=0 15=0 5=1 21 | Padding 89 1 1 88 89 0=0 1=0 2=0 3=0 4=0 5=0.000000e+00 7=0 8=4 22 | ConvolutionDepthWise 90 1 1 87 90 0=28 1=3 11=3 2=1 12=1 3=2 13=2 4=0 14=0 15=0 16=0 5=1 6=252 7=28 23 | Convolution 91 1 1 90 91 0=32 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=896 24 | BinaryOp 92 2 1 91 89 92 0=0 25 | ReLU 93 1 1 92 93 26 | Split splitncnn_3 1 2 93 93_splitncnn_0 93_splitncnn_1 27 | Padding 94 1 1 93_splitncnn_1 94 0=0 1=0 2=0 3=0 4=0 5=0.000000e+00 7=0 8=4 28 | ConvolutionDepthWise 95 1 1 93_splitncnn_0 95 0=32 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=288 7=32 29 | Convolution 96 1 1 95 96 0=36 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=1152 30 | BinaryOp 97 2 1 96 94 97 0=0 31 | ReLU 98 1 1 97 98 32 | Split splitncnn_4 1 2 98 98_splitncnn_0 98_splitncnn_1 33 | Padding 99 1 1 98_splitncnn_1 99 0=0 1=0 2=0 3=0 4=0 5=0.000000e+00 7=0 8=6 34 | ConvolutionDepthWise 100 1 1 98_splitncnn_0 100 0=36 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=324 7=36 35 | Convolution 101 1 1 100 101 0=42 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=1512 36 | BinaryOp 102 2 1 101 99 102 0=0 37 | ReLU 103 1 1 102 103 38 | Split splitncnn_5 1 2 103 103_splitncnn_0 103_splitncnn_1 39 | Padding 104 1 1 103_splitncnn_1 104 0=0 1=2 2=0 3=2 4=0 5=0.000000e+00 7=0 8=0 40 | Pooling 105 1 1 103_splitncnn_0 105 0=0 1=2 11=2 2=2 12=2 3=0 13=0 14=0 15=0 5=1 41 | Padding 106 1 1 105 106 0=0 1=0 2=0 3=0 4=0 5=0.000000e+00 7=0 8=6 42 | ConvolutionDepthWise 107 1 1 104 107 0=42 1=3 11=3 2=1 12=1 3=2 13=2 4=0 14=0 15=0 16=0 5=1 6=378 7=42 43 | Convolution 108 1 1 107 108 0=48 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=2016 44 | BinaryOp 109 2 1 108 106 109 0=0 45 | ReLU 110 1 1 109 110 46 | Split splitncnn_6 1 2 110 110_splitncnn_0 110_splitncnn_1 47 | Padding 111 1 1 110_splitncnn_1 111 0=0 1=0 2=0 3=0 4=0 5=0.000000e+00 7=0 8=8 48 | ConvolutionDepthWise 112 1 1 110_splitncnn_0 112 0=48 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=432 7=48 49 | Convolution 113 1 1 112 113 0=56 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=2688 50 | BinaryOp 114 2 1 113 111 114 0=0 51 | ReLU 115 1 1 114 115 52 | Split splitncnn_7 1 2 115 115_splitncnn_0 115_splitncnn_1 53 | Padding 116 1 1 115_splitncnn_1 116 0=0 1=0 2=0 3=0 4=0 5=0.000000e+00 7=0 8=8 54 | ConvolutionDepthWise 117 1 1 115_splitncnn_0 117 0=56 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=504 7=56 55 | Convolution 118 1 1 117 118 0=64 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=3584 56 | BinaryOp 119 2 1 118 116 119 0=0 57 | ReLU 120 1 1 119 120 58 | Split splitncnn_8 1 2 120 120_splitncnn_0 120_splitncnn_1 59 | Padding 121 1 1 120_splitncnn_1 121 0=0 1=0 2=0 3=0 4=0 5=0.000000e+00 7=0 8=8 60 | ConvolutionDepthWise 122 1 1 120_splitncnn_0 122 0=64 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=576 7=64 61 | Convolution 123 1 1 122 123 0=72 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=4608 62 | BinaryOp 124 2 1 123 121 124 0=0 63 | ReLU 125 1 1 124 125 64 | Split splitncnn_9 1 2 125 125_splitncnn_0 125_splitncnn_1 65 | Padding 126 1 1 125_splitncnn_1 126 0=0 1=0 2=0 3=0 4=0 5=0.000000e+00 7=0 8=8 66 | ConvolutionDepthWise 127 1 1 125_splitncnn_0 127 0=72 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=648 7=72 67 | Convolution 128 1 1 127 128 0=80 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=5760 68 | BinaryOp 129 2 1 128 126 129 0=0 69 | ReLU 130 1 1 129 130 70 | Split splitncnn_10 1 2 130 130_splitncnn_0 130_splitncnn_1 71 | Padding 131 1 1 130_splitncnn_1 131 0=0 1=0 2=0 3=0 4=0 5=0.000000e+00 7=0 8=8 72 | ConvolutionDepthWise 132 1 1 130_splitncnn_0 132 0=80 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=720 7=80 73 | Convolution 133 1 1 132 133 0=88 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=7040 74 | BinaryOp 134 2 1 133 131 134 0=0 75 | ReLU 135 1 1 134 135 76 | Split splitncnn_11 1 2 135 135_splitncnn_0 135_splitncnn_1 77 | Padding 136 1 1 135_splitncnn_1 136 0=0 1=2 2=0 3=2 4=0 5=0.000000e+00 7=0 8=0 78 | Pooling 137 1 1 135_splitncnn_0 137 0=0 1=2 11=2 2=2 12=2 3=0 13=0 14=0 15=0 5=1 79 | Padding 138 1 1 137 138 0=0 1=0 2=0 3=0 4=0 5=0.000000e+00 7=0 8=8 80 | ConvolutionDepthWise 139 1 1 136 139 0=88 1=3 11=3 2=1 12=1 3=2 13=2 4=0 14=0 15=0 16=0 5=1 6=792 7=88 81 | Convolution 140 1 1 139 140 0=96 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=8448 82 | BinaryOp 141 2 1 140 138 141 0=0 83 | ReLU 142 1 1 141 142 84 | Split splitncnn_12 1 2 142 142_splitncnn_0 142_splitncnn_1 85 | ConvolutionDepthWise 143 1 1 142_splitncnn_1 143 0=96 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=864 7=96 86 | Convolution 144 1 1 143 144 0=96 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=9216 87 | BinaryOp 145 2 1 144 142_splitncnn_0 145 0=0 88 | ReLU 146 1 1 145 146 89 | Split splitncnn_13 1 2 146 146_splitncnn_0 146_splitncnn_1 90 | ConvolutionDepthWise 147 1 1 146_splitncnn_1 147 0=96 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=864 7=96 91 | Convolution 148 1 1 147 148 0=96 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=9216 92 | BinaryOp 149 2 1 148 146_splitncnn_0 149 0=0 93 | ReLU 150 1 1 149 150 94 | Split splitncnn_14 1 2 150 150_splitncnn_0 150_splitncnn_1 95 | ConvolutionDepthWise 151 1 1 150_splitncnn_1 151 0=96 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=864 7=96 96 | Convolution 152 1 1 151 152 0=96 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=9216 97 | BinaryOp 153 2 1 152 150_splitncnn_0 153 0=0 98 | ReLU 154 1 1 153 154 99 | Split splitncnn_15 1 2 154 154_splitncnn_0 154_splitncnn_1 100 | ConvolutionDepthWise 155 1 1 154_splitncnn_1 155 0=96 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=864 7=96 101 | Convolution 156 1 1 155 156 0=96 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=9216 102 | BinaryOp 157 2 1 156 154_splitncnn_0 157 0=0 103 | ReLU output 1 1 157 output 104 | -------------------------------------------------------------------------------- /params/mnasnet.param: -------------------------------------------------------------------------------- 1 | 7767517 2 | 76 86 3 | Input data 0 1 data -23330=4,3,224,224,3 0=224 1=224 2=3 4 | Convolution first-3x3-conv 1 1 data first-3x3-conv_relu -23330=4,3,112,112,32 0=32 1=3 3=2 4=1 5=1 6=864 9=1 5 | ConvolutionDepthWise A0_dw 1 1 first-3x3-conv_relu A0_dw_relu -23330=4,3,112,112,32 0=32 1=3 4=1 5=1 6=288 7=32 9=1 6 | Convolution A0_linear 1 1 A0_dw_relu A0_linear_bn -23330=4,3,112,112,16 0=16 1=1 5=1 6=512 7 | Convolution B0_expand 1 1 A0_linear_bn B0_expand_relu -23330=4,3,112,112,48 0=48 1=1 5=1 6=768 9=1 8 | ConvolutionDepthWise B0_dw 1 1 B0_expand_relu B0_dw_relu -23330=4,3,56,56,48 0=48 1=3 3=2 4=1 5=1 6=432 7=48 9=1 9 | Convolution B0_linear 1 1 B0_dw_relu B0_linear_bn -23330=4,3,56,56,24 0=24 1=1 5=1 6=1152 10 | Split splitncnn_0 1 2 B0_linear_bn B0_linear_bn_splitncnn_0 B0_linear_bn_splitncnn_1 -23330=8,3,56,56,24,3,56,56,24 11 | Convolution B1_expand 1 1 B0_linear_bn_splitncnn_1 B1_expand_relu -23330=4,3,56,56,72 0=72 1=1 5=1 6=1728 9=1 12 | ConvolutionDepthWise B1_dw 1 1 B1_expand_relu B1_dw_relu -23330=4,3,56,56,72 0=72 1=3 4=1 5=1 6=648 7=72 9=1 13 | Convolution B1_linear 1 1 B1_dw_relu B1_linear_bn -23330=4,3,56,56,24 0=24 1=1 5=1 6=1728 14 | BinaryOp unknownncnn_0 2 1 B0_linear_bn_splitncnn_0 B1_linear_bn unknownncnn_0 -23330=4,3,56,56,24 15 | Split splitncnn_1 1 2 unknownncnn_0 unknownncnn_0_splitncnn_0 unknownncnn_0_splitncnn_1 -23330=8,3,56,56,24,3,56,56,24 16 | Convolution B2_expand 1 1 unknownncnn_0_splitncnn_1 B2_expand_relu -23330=4,3,56,56,72 0=72 1=1 5=1 6=1728 9=1 17 | ConvolutionDepthWise B2_dw 1 1 B2_expand_relu B2_dw_relu -23330=4,3,56,56,72 0=72 1=3 4=1 5=1 6=648 7=72 9=1 18 | Convolution B2_linear 1 1 B2_dw_relu B2_linear_bn -23330=4,3,56,56,24 0=24 1=1 5=1 6=1728 19 | BinaryOp unknownncnn_1 2 1 unknownncnn_0_splitncnn_0 B2_linear_bn unknownncnn_1 -23330=4,3,56,56,24 20 | Convolution C0_expand 1 1 unknownncnn_1 C0_expand_relu -23330=4,3,56,56,72 0=72 1=1 5=1 6=1728 9=1 21 | ConvolutionDepthWise C0_dw 1 1 C0_expand_relu C0_dw_relu -23330=4,3,28,28,72 0=72 1=5 3=2 4=2 5=1 6=1800 7=72 9=1 22 | Convolution C0_linear 1 1 C0_dw_relu C0_linear_bn -23330=4,3,28,28,40 0=40 1=1 5=1 6=2880 23 | Split splitncnn_2 1 2 C0_linear_bn C0_linear_bn_splitncnn_0 C0_linear_bn_splitncnn_1 -23330=8,3,28,28,40,3,28,28,40 24 | Convolution C1_expand 1 1 C0_linear_bn_splitncnn_1 C1_expand_relu -23330=4,3,28,28,120 0=120 1=1 5=1 6=4800 9=1 25 | ConvolutionDepthWise C1_dw 1 1 C1_expand_relu C1_dw_relu -23330=4,3,28,28,120 0=120 1=5 4=2 5=1 6=3000 7=120 9=1 26 | Convolution C1_linear 1 1 C1_dw_relu C1_linear_bn -23330=4,3,28,28,40 0=40 1=1 5=1 6=4800 27 | BinaryOp unknownncnn_2 2 1 C0_linear_bn_splitncnn_0 C1_linear_bn unknownncnn_2 -23330=4,3,28,28,40 28 | Split splitncnn_3 1 2 unknownncnn_2 unknownncnn_2_splitncnn_0 unknownncnn_2_splitncnn_1 -23330=8,3,28,28,40,3,28,28,40 29 | Convolution C2_expand 1 1 unknownncnn_2_splitncnn_1 C2_expand_relu -23330=4,3,28,28,120 0=120 1=1 5=1 6=4800 9=1 30 | ConvolutionDepthWise C2_dw 1 1 C2_expand_relu C2_dw_relu -23330=4,3,28,28,120 0=120 1=5 4=2 5=1 6=3000 7=120 9=1 31 | Convolution C2_linear 1 1 C2_dw_relu C2_linear_bn -23330=4,3,28,28,40 0=40 1=1 5=1 6=4800 32 | BinaryOp unknownncnn_3 2 1 unknownncnn_2_splitncnn_0 C2_linear_bn unknownncnn_3 -23330=4,3,28,28,40 33 | Convolution D0_expand 1 1 unknownncnn_3 D0_expand_relu -23330=4,3,28,28,240 0=240 1=1 5=1 6=9600 9=1 34 | ConvolutionDepthWise D0_dw 1 1 D0_expand_relu D0_dw_relu -23330=4,3,14,14,240 0=240 1=5 3=2 4=2 5=1 6=6000 7=240 9=1 35 | Convolution D0_linear 1 1 D0_dw_relu D0_linear_bn -23330=4,3,14,14,80 0=80 1=1 5=1 6=19200 36 | Split splitncnn_4 1 2 D0_linear_bn D0_linear_bn_splitncnn_0 D0_linear_bn_splitncnn_1 -23330=8,3,14,14,80,3,14,14,80 37 | Convolution D1_expand 1 1 D0_linear_bn_splitncnn_1 D1_expand_relu -23330=4,3,14,14,480 0=480 1=1 5=1 6=38400 9=1 38 | ConvolutionDepthWise D1_dw 1 1 D1_expand_relu D1_dw_relu -23330=4,3,14,14,480 0=480 1=5 4=2 5=1 6=12000 7=480 9=1 39 | Convolution D1_linear 1 1 D1_dw_relu D1_linear_bn -23330=4,3,14,14,80 0=80 1=1 5=1 6=38400 40 | BinaryOp unknownncnn_4 2 1 D0_linear_bn_splitncnn_0 D1_linear_bn unknownncnn_4 -23330=4,3,14,14,80 41 | Split splitncnn_5 1 2 unknownncnn_4 unknownncnn_4_splitncnn_0 unknownncnn_4_splitncnn_1 -23330=8,3,14,14,80,3,14,14,80 42 | Convolution D2_expand 1 1 unknownncnn_4_splitncnn_1 D2_expand_relu -23330=4,3,14,14,480 0=480 1=1 5=1 6=38400 9=1 43 | ConvolutionDepthWise D2_dw 1 1 D2_expand_relu D2_dw_relu -23330=4,3,14,14,480 0=480 1=5 4=2 5=1 6=12000 7=480 9=1 44 | Convolution D2_linear 1 1 D2_dw_relu D2_linear_bn -23330=4,3,14,14,80 0=80 1=1 5=1 6=38400 45 | BinaryOp unknownncnn_5 2 1 unknownncnn_4_splitncnn_0 D2_linear_bn unknownncnn_5 -23330=4,3,14,14,80 46 | Convolution E0_expand 1 1 unknownncnn_5 E0_expand_relu -23330=4,3,14,14,480 0=480 1=1 5=1 6=38400 9=1 47 | ConvolutionDepthWise E0_dw 1 1 E0_expand_relu E0_dw_relu -23330=4,3,14,14,480 0=480 1=3 4=1 5=1 6=4320 7=480 9=1 48 | Convolution E0_linear 1 1 E0_dw_relu E0_linear_bn -23330=4,3,14,14,96 0=96 1=1 5=1 6=46080 49 | Split splitncnn_6 1 2 E0_linear_bn E0_linear_bn_splitncnn_0 E0_linear_bn_splitncnn_1 -23330=8,3,14,14,96,3,14,14,96 50 | Convolution E1_expand 1 1 E0_linear_bn_splitncnn_1 E1_expand_relu -23330=4,3,14,14,576 0=576 1=1 5=1 6=55296 9=1 51 | ConvolutionDepthWise E1_dw 1 1 E1_expand_relu E1_dw_relu -23330=4,3,14,14,576 0=576 1=3 4=1 5=1 6=5184 7=576 9=1 52 | Convolution E1_linear 1 1 E1_dw_relu E1_linear_bn -23330=4,3,14,14,96 0=96 1=1 5=1 6=55296 53 | BinaryOp unknownncnn_6 2 1 E0_linear_bn_splitncnn_0 E1_linear_bn unknownncnn_6 -23330=4,3,14,14,96 54 | Convolution F0_expand 1 1 unknownncnn_6 F0_expand_relu -23330=4,3,14,14,576 0=576 1=1 5=1 6=55296 9=1 55 | ConvolutionDepthWise F0_dw 1 1 F0_expand_relu F0_dw_relu -23330=4,3,7,7,576 0=576 1=5 3=2 4=2 5=1 6=14400 7=576 9=1 56 | Convolution F0_linear 1 1 F0_dw_relu F0_linear_bn -23330=4,3,7,7,192 0=192 1=1 5=1 6=110592 57 | Split splitncnn_7 1 2 F0_linear_bn F0_linear_bn_splitncnn_0 F0_linear_bn_splitncnn_1 -23330=8,3,7,7,192,3,7,7,192 58 | Convolution F1_expand 1 1 F0_linear_bn_splitncnn_1 F1_expand_relu -23330=4,3,7,7,1152 0=1152 1=1 5=1 6=221184 9=1 59 | ConvolutionDepthWise F1_dw 1 1 F1_expand_relu F1_dw_relu -23330=4,3,7,7,1152 0=1152 1=5 4=2 5=1 6=28800 7=1152 9=1 60 | Convolution F1_linear 1 1 F1_dw_relu F1_linear_bn -23330=4,3,7,7,192 0=192 1=1 5=1 6=221184 61 | BinaryOp unknownncnn_7 2 1 F0_linear_bn_splitncnn_0 F1_linear_bn unknownncnn_7 -23330=4,3,7,7,192 62 | Split splitncnn_8 1 2 unknownncnn_7 unknownncnn_7_splitncnn_0 unknownncnn_7_splitncnn_1 -23330=8,3,7,7,192,3,7,7,192 63 | Convolution F2_expand 1 1 unknownncnn_7_splitncnn_1 F2_expand_relu -23330=4,3,7,7,1152 0=1152 1=1 5=1 6=221184 9=1 64 | ConvolutionDepthWise F2_dw 1 1 F2_expand_relu F2_dw_relu -23330=4,3,7,7,1152 0=1152 1=5 4=2 5=1 6=28800 7=1152 9=1 65 | Convolution F2_linear 1 1 F2_dw_relu F2_linear_bn -23330=4,3,7,7,192 0=192 1=1 5=1 6=221184 66 | BinaryOp unknownncnn_8 2 1 unknownncnn_7_splitncnn_0 F2_linear_bn unknownncnn_8 -23330=4,3,7,7,192 67 | Split splitncnn_9 1 2 unknownncnn_8 unknownncnn_8_splitncnn_0 unknownncnn_8_splitncnn_1 -23330=8,3,7,7,192,3,7,7,192 68 | Convolution F3_expand 1 1 unknownncnn_8_splitncnn_1 F3_expand_relu -23330=4,3,7,7,1152 0=1152 1=1 5=1 6=221184 9=1 69 | ConvolutionDepthWise F3_dw 1 1 F3_expand_relu F3_dw_relu -23330=4,3,7,7,1152 0=1152 1=5 4=2 5=1 6=28800 7=1152 9=1 70 | Convolution F3_linear 1 1 F3_dw_relu F3_linear_bn -23330=4,3,7,7,192 0=192 1=1 5=1 6=221184 71 | BinaryOp unknownncnn_9 2 1 unknownncnn_8_splitncnn_0 F3_linear_bn unknownncnn_9 -23330=4,3,7,7,192 72 | Convolution G0_expand 1 1 unknownncnn_9 G0_expand_relu -23330=4,3,7,7,1152 0=1152 1=1 5=1 6=221184 9=1 73 | ConvolutionDepthWise G0_dw 1 1 G0_expand_relu G0_dw_relu -23330=4,3,7,7,1152 0=1152 1=3 4=1 5=1 6=10368 7=1152 9=1 74 | Convolution G0_linear 1 1 G0_dw_relu G0_linear_bn -23330=4,3,7,7,320 0=320 1=1 5=1 6=368640 75 | Convolution last-1x1-conv 1 1 G0_linear_bn last-1x1-conv_relu -23330=4,3,7,7,1280 0=1280 1=1 5=1 6=409600 9=1 76 | Pooling avgpool 1 1 last-1x1-conv_relu flatten -23330=4,1,1280,1,1 0=1 1=7 4=1 5=1 77 | InnerProduct fc 1 1 flatten fc -23330=4,1,1000,1,1 0=1000 1=1 2=1280000 78 | Softmax prob 1 1 fc output -23330=4,1,1000,1,1 79 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | -------------------------------------------------------------------------------- /ncnn-bind/build.rs: -------------------------------------------------------------------------------- 1 | extern crate bindgen; 2 | use cmake::Config; 3 | 4 | use std::env; 5 | use std::fs; 6 | use std::io; 7 | use std::path::PathBuf; 8 | use std::process::Command; 9 | use std::str; 10 | 11 | const DEFAULT_NCNN_TAG: &'static str = "20230517"; 12 | 13 | #[derive(PartialEq)] 14 | enum VulkanMode { 15 | Static, 16 | System, 17 | } 18 | 19 | fn output_dir() -> PathBuf { 20 | PathBuf::from(env::var("OUT_DIR").unwrap()) 21 | } 22 | 23 | fn ncnn_src_dir() -> PathBuf { 24 | output_dir().join(format!("ncnn-src-{}", ncnn_tag())) 25 | } 26 | 27 | fn ncnn_tag() -> String { 28 | env::var("NCNN_TAG").unwrap_or(DEFAULT_NCNN_TAG.to_string()) 29 | } 30 | 31 | fn fetch() -> io::Result<()> { 32 | let target_dir = ncnn_src_dir(); 33 | 34 | let static_glslang = vulkan_mode().map_or_else(|| false, |mode| mode == VulkanMode::Static); 35 | 36 | if static_glslang { 37 | if target_dir.exists() { 38 | let stdout = Command::new("git") 39 | .arg("-C") 40 | .arg(&target_dir) 41 | .arg("submodule") 42 | .arg("foreach") 43 | .arg("true") 44 | .output()? 45 | .stdout; 46 | let out_text = String::from_utf8(stdout) 47 | .map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))?; 48 | let submodule_rows = out_text.chars().filter(|c| *c == '\n').count(); 49 | 50 | if submodule_rows > 0 { 51 | Ok(()) 52 | } else { 53 | let status = Command::new("git") 54 | .arg("-C") 55 | .arg(&target_dir) 56 | .arg("submodule") 57 | .arg("update") 58 | .arg("--init") 59 | .arg("--recursive") 60 | .status()?; 61 | 62 | if status.success() { 63 | Ok(()) 64 | } else { 65 | Err(io::Error::new( 66 | io::ErrorKind::Other, 67 | "submodule update failed", 68 | )) 69 | } 70 | } 71 | } else { 72 | let status = Command::new("git") 73 | .arg("clone") 74 | .arg("--recursive") 75 | .arg("-b") 76 | .arg(ncnn_tag()) 77 | .arg("https://github.com/Tencent/ncnn") 78 | .arg(&target_dir) 79 | .status()?; 80 | 81 | if status.success() { 82 | Ok(()) 83 | } else { 84 | Err(io::Error::new(io::ErrorKind::Other, "fetch failed")) 85 | } 86 | } 87 | } else { 88 | if target_dir.exists() { 89 | Ok(()) 90 | } else { 91 | let status = Command::new("git") 92 | .arg("clone") 93 | .arg("-b") 94 | .arg(ncnn_tag()) 95 | .arg("https://github.com/Tencent/ncnn") 96 | .arg(&target_dir) 97 | .status()?; 98 | 99 | if status.success() { 100 | Ok(()) 101 | } else { 102 | Err(io::Error::new(io::ErrorKind::Other, "fetch failed")) 103 | } 104 | } 105 | } 106 | } 107 | 108 | fn build() -> io::Result<()> { 109 | let mut config = Config::new(ncnn_src_dir()); 110 | config.define("NCNN_BUILD_TOOLS", "OFF"); 111 | config.define("NCNN_BUILD_EXAMPLES", "OFF"); 112 | config.define("NCNN_BUILD_BENCHMARK", "OFF"); 113 | config.define("NCNN_DISABLE_RTTI", "ON"); // Not used. 114 | config.define("NCNN_PIXEL_DRAWING", "OFF"); // Not exposed by ncnn-rs. 115 | config.define("NCNN_PIXEL_ROTATE", "OFF"); // Not exposed by ncnn-rs. 116 | config.define("NCNN_PIXEL_AFFINE", "OFF"); // Not exposed by ncnn-rs. 117 | config.define("CMAKE_BUILD_TYPE", "Release"); 118 | 119 | if cfg!(feature = "openmp") { 120 | config.define("NCNN_OPENMP", "ON"); 121 | } else { 122 | config.define("NCNN_OPENMP", "OFF"); 123 | } 124 | 125 | if let Some(mode) = vulkan_mode() { 126 | config.define("NCNN_VULKAN", "ON"); 127 | 128 | match mode { 129 | VulkanMode::Static => config.define("NCNN_SYSTEM_GLSLANG", "OFF"), 130 | VulkanMode::System => config.define("NCNN_SYSTEM_GLSLANG", "ON"), 131 | }; 132 | } 133 | 134 | if use_dynamic_linking() { 135 | config.define("NCNN_SHARED_LIB", "ON"); 136 | } else { 137 | config.define("NCNN_SHARED_LIB", "OFF"); 138 | } 139 | 140 | let dst = config.build(); 141 | 142 | println!("cargo:rustc-link-search=native={}", dst.display()); 143 | 144 | Ok(()) 145 | } 146 | 147 | fn search_include(include_paths: &[PathBuf], header: &str) -> String { 148 | for dir in include_paths { 149 | let include = dir.join(header); 150 | if fs::metadata(&include).is_ok() { 151 | return include.as_path().to_str().unwrap().to_string(); 152 | } 153 | } 154 | format!("/usr/include/{}", header) 155 | } 156 | 157 | fn use_dynamic_linking() -> bool { 158 | if cfg!(feature = "static") && cfg!(feature = "dynamic") { 159 | panic!( 160 | "Both `static` and `dynamic` features are specified. Only one can be used at a time." 161 | ); 162 | } else if cfg!(feature = "static") { 163 | false 164 | } else if cfg!(feature = "dynamic") { 165 | true 166 | } else { 167 | // By default use static linking for windows and dynamic for linux 168 | if cfg!(windows) { 169 | false 170 | } else { 171 | true 172 | } 173 | } 174 | } 175 | 176 | fn vulkan_mode() -> Option { 177 | match ( 178 | cfg!(feature = "vulkan"), 179 | cfg!(feature = "vulkan-system-glslang"), 180 | cfg!(feature = "vulkan-static-glslang"), 181 | ) { 182 | (true, true, true) | (true, true, false) | (true, false, true) | (false, true, true) => { 183 | panic!("Cannot specify more than one `vulkan*` feature") 184 | } 185 | (true, false, false) => { 186 | if cfg!(windows) { 187 | Some(VulkanMode::Static) 188 | } else { 189 | Some(VulkanMode::System) 190 | } 191 | } 192 | (false, true, false) => Some(VulkanMode::System), 193 | (false, false, true) => Some(VulkanMode::Static), 194 | (false, false, false) => None, 195 | } 196 | } 197 | 198 | fn handle_openmp() { 199 | if cfg!(feature = "openmp") { 200 | // Maybe see https://gitlab.com/kornelski/openmp-rs/-/blob/master/build.rs ? 201 | //println!("cargo:rustc-link-lib=gomp"); 202 | todo!() 203 | } 204 | } 205 | 206 | fn handle_vulkan() { 207 | if let Some(mode) = vulkan_mode() { 208 | let target_family = env::var("CARGO_CFG_TARGET_FAMILY").unwrap(); 209 | let target_pointer_width = env::var("CARGO_CFG_TARGET_POINTER_WIDTH").unwrap(); 210 | 211 | println!("cargo:rerun-if-env-changed=VULKAN_SDK"); 212 | if let Ok(var) = env::var("VULKAN_SDK") { 213 | let suffix = match (&*target_family, &*target_pointer_width) { 214 | ("windows", "32") => "Lib32", 215 | ("windows", "64") => "Lib", 216 | _ => "lib", 217 | }; 218 | println!("cargo:rustc-link-search={}/{}", var, suffix); 219 | } 220 | let lib = match &*target_family { 221 | "windows" => "vulkan-1", 222 | _ => "vulkan", 223 | }; 224 | println!("cargo:rustc-link-lib={}", lib); 225 | 226 | match mode { 227 | VulkanMode::System => { 228 | println!("cargo:rustc-link-lib=dylib=SPIRV"); 229 | println!("cargo:rustc-link-lib=dylib=glslang"); 230 | 231 | if !use_dynamic_linking() { 232 | // Glslang still depend on the C++ std. 233 | println!("cargo:rustc-link-lib=dylib=stdc++"); 234 | } 235 | } 236 | VulkanMode::Static => todo!(), 237 | } 238 | } 239 | } 240 | 241 | fn build_ncnn() -> Vec { 242 | println!("cargo:rerun-if-env-changed=NCNN_DIR"); 243 | println!("cargo:rerun-if-env-changed=NCNN_TAG"); 244 | 245 | let include_paths: Vec = if let Ok(ncnn_dir) = env::var("NCNN_DIR") { 246 | // use prebuild ncnn dir 247 | let dir = PathBuf::from(ncnn_dir); 248 | 249 | for suffix in ["lib", "lib64"].iter() { 250 | println!( 251 | "cargo:rustc-link-search=native={}", 252 | output_dir().join(suffix).to_string_lossy() 253 | ); 254 | } 255 | 256 | vec![dir.join("include").join("ncnn")] 257 | } else { 258 | // fetch from github and build 259 | fetch().unwrap(); 260 | build().unwrap(); 261 | 262 | for suffix in ["lib", "lib64"].iter() { 263 | println!( 264 | "cargo:rustc-link-search=native={}", 265 | output_dir().join(suffix).to_string_lossy() 266 | ); 267 | } 268 | 269 | vec![output_dir().join("include").join("ncnn")] 270 | }; 271 | 272 | if use_dynamic_linking() { 273 | println!("cargo:rustc-link-lib=dylib=ncnn"); 274 | } else { 275 | println!("cargo:rustc-link-lib=static=ncnn"); 276 | } 277 | 278 | if !cfg!(windows) { 279 | println!("cargo:rustc-link-lib=dylib=pthread"); 280 | } 281 | 282 | handle_openmp(); 283 | 284 | handle_vulkan(); 285 | 286 | return include_paths; 287 | } 288 | 289 | fn main() { 290 | let include_paths = if let Ok(vcpkg_lib) = vcpkg::find_package("ncnn") { 291 | vec![vcpkg_lib.include_paths[0].join("ncnn")] 292 | } else { 293 | build_ncnn() 294 | }; 295 | 296 | let header = search_include(&include_paths, "c_api.h"); 297 | 298 | let bindings = bindgen::Builder::default() 299 | .header(header) 300 | .allowlist_type("regex") 301 | .allowlist_function("ncnn.*") 302 | .allowlist_var("NCNN.*") 303 | .allowlist_type("ncnn.*") 304 | .generate() 305 | .expect("Unable to generate bindings"); 306 | 307 | bindings 308 | .write_to_file(output_dir().join("bindings.rs")) 309 | .expect("Couldn't write bindings!"); 310 | } 311 | -------------------------------------------------------------------------------- /params/mobilenetv2_yolov3.param: -------------------------------------------------------------------------------- 1 | 7767517 2 | 87 99 3 | Input data 0 1 data -23330=4,3,352,352,3 0=352 1=352 2=3 4 | Convolution conv1 1 1 data conv1_relu1 -23330=4,3,176,176,32 0=32 1=3 3=2 4=1 5=1 6=864 9=1 5 | ConvolutionDepthWise conv2 1 1 conv1_relu1 conv2_relu2 -23330=4,3,176,176,32 0=32 1=3 4=1 5=1 6=288 7=32 9=1 6 | Convolution conv3 1 1 conv2_relu2 conv3 -23330=4,3,176,176,16 0=16 1=1 5=1 6=512 7 | Convolution conv4 1 1 conv3 conv4_relu3 -23330=4,3,176,176,96 0=96 1=1 5=1 6=1536 9=1 8 | ConvolutionDepthWise conv5 1 1 conv4_relu3 conv5_relu4 -23330=4,3,88,88,96 0=96 1=3 3=2 4=1 5=1 6=864 7=96 9=1 9 | Convolution conv6 1 1 conv5_relu4 conv6 -23330=4,3,88,88,24 0=24 1=1 5=1 6=2304 10 | Split splitncnn_0 1 2 conv6 conv6_splitncnn_0 conv6_splitncnn_1 -23330=8,3,88,88,24,3,88,88,24 11 | Convolution conv7 1 1 conv6_splitncnn_1 conv7_relu5 -23330=4,3,88,88,144 0=144 1=1 5=1 6=3456 9=1 12 | ConvolutionDepthWise conv8 1 1 conv7_relu5 conv8_relu6 -23330=4,3,88,88,144 0=144 1=3 4=1 5=1 6=1296 7=144 9=1 13 | Convolution conv9 1 1 conv8_relu6 conv9 -23330=4,3,88,88,24 0=24 1=1 5=1 6=3456 14 | Eltwise add1 2 1 conv6_splitncnn_0 conv9 add1 -23330=4,3,88,88,24 0=1 15 | Convolution conv10 1 1 add1 conv10_relu7 -23330=4,3,88,88,144 0=144 1=1 5=1 6=3456 9=1 16 | ConvolutionDepthWise conv11 1 1 conv10_relu7 conv11_relu8 -23330=4,3,44,44,144 0=144 1=3 3=2 4=1 5=1 6=1296 7=144 9=1 17 | Convolution conv12 1 1 conv11_relu8 conv12 -23330=4,3,44,44,32 0=32 1=1 5=1 6=4608 18 | Split splitncnn_1 1 2 conv12 conv12_splitncnn_0 conv12_splitncnn_1 -23330=8,3,44,44,32,3,44,44,32 19 | Convolution conv13 1 1 conv12_splitncnn_1 conv13_relu9 -23330=4,3,44,44,192 0=192 1=1 5=1 6=6144 9=1 20 | ConvolutionDepthWise conv14 1 1 conv13_relu9 conv14_relu10 -23330=4,3,44,44,192 0=192 1=3 4=1 5=1 6=1728 7=192 9=1 21 | Convolution conv15 1 1 conv14_relu10 conv15 -23330=4,3,44,44,32 0=32 1=1 5=1 6=6144 22 | Eltwise add2 2 1 conv12_splitncnn_0 conv15 add2 -23330=4,3,44,44,32 0=1 23 | Split splitncnn_2 1 2 add2 add2_splitncnn_0 add2_splitncnn_1 -23330=8,3,44,44,32,3,44,44,32 24 | Convolution conv16 1 1 add2_splitncnn_1 conv16_relu11 -23330=4,3,44,44,192 0=192 1=1 5=1 6=6144 9=1 25 | ConvolutionDepthWise conv17 1 1 conv16_relu11 conv17_relu12 -23330=4,3,44,44,192 0=192 1=3 4=1 5=1 6=1728 7=192 9=1 26 | Convolution conv18 1 1 conv17_relu12 conv18 -23330=4,3,44,44,32 0=32 1=1 5=1 6=6144 27 | Eltwise add3 2 1 add2_splitncnn_0 conv18 add3 -23330=4,3,44,44,32 0=1 28 | Convolution conv19 1 1 add3 conv19_relu13 -23330=4,3,44,44,192 0=192 1=1 5=1 6=6144 9=1 29 | ConvolutionDepthWise conv20 1 1 conv19_relu13 conv20_relu14 -23330=4,3,22,22,192 0=192 1=3 3=2 4=1 5=1 6=1728 7=192 9=1 30 | Convolution conv21 1 1 conv20_relu14 conv21 -23330=4,3,22,22,64 0=64 1=1 5=1 6=12288 31 | Split splitncnn_3 1 2 conv21 conv21_splitncnn_0 conv21_splitncnn_1 -23330=8,3,22,22,64,3,22,22,64 32 | Convolution conv22 1 1 conv21_splitncnn_1 conv22_relu15 -23330=4,3,22,22,384 0=384 1=1 5=1 6=24576 9=1 33 | ConvolutionDepthWise conv23 1 1 conv22_relu15 conv23_relu16 -23330=4,3,22,22,384 0=384 1=3 4=1 5=1 6=3456 7=384 9=1 34 | Convolution conv24 1 1 conv23_relu16 conv24 -23330=4,3,22,22,64 0=64 1=1 5=1 6=24576 35 | Eltwise add4 2 1 conv21_splitncnn_0 conv24 add4 -23330=4,3,22,22,64 0=1 36 | Split splitncnn_4 1 2 add4 add4_splitncnn_0 add4_splitncnn_1 -23330=8,3,22,22,64,3,22,22,64 37 | Convolution conv25 1 1 add4_splitncnn_1 conv25_relu17 -23330=4,3,22,22,384 0=384 1=1 5=1 6=24576 9=1 38 | ConvolutionDepthWise conv26 1 1 conv25_relu17 conv26_relu18 -23330=4,3,22,22,384 0=384 1=3 4=1 5=1 6=3456 7=384 9=1 39 | Convolution conv27 1 1 conv26_relu18 conv27 -23330=4,3,22,22,64 0=64 1=1 5=1 6=24576 40 | Eltwise add5 2 1 add4_splitncnn_0 conv27 add5 -23330=4,3,22,22,64 0=1 41 | Split splitncnn_5 1 2 add5 add5_splitncnn_0 add5_splitncnn_1 -23330=8,3,22,22,64,3,22,22,64 42 | Convolution conv28 1 1 add5_splitncnn_1 conv28_relu19 -23330=4,3,22,22,384 0=384 1=1 5=1 6=24576 9=1 43 | ConvolutionDepthWise conv29 1 1 conv28_relu19 conv29_relu20 -23330=4,3,22,22,384 0=384 1=3 4=1 5=1 6=3456 7=384 9=1 44 | Convolution conv30 1 1 conv29_relu20 conv30 -23330=4,3,22,22,64 0=64 1=1 5=1 6=24576 45 | Eltwise add6 2 1 add5_splitncnn_0 conv30 add6 -23330=4,3,22,22,64 0=1 46 | Convolution conv31 1 1 add6 conv31_relu21 -23330=4,3,22,22,384 0=384 1=1 5=1 6=24576 9=1 47 | ConvolutionDepthWise conv32 1 1 conv31_relu21 conv32_relu22 -23330=4,3,22,22,384 0=384 1=3 4=1 5=1 6=3456 7=384 9=1 48 | Convolution conv33 1 1 conv32_relu22 conv33 -23330=4,3,22,22,96 0=96 1=1 5=1 6=36864 49 | Split splitncnn_6 1 2 conv33 conv33_splitncnn_0 conv33_splitncnn_1 -23330=8,3,22,22,96,3,22,22,96 50 | Convolution conv34 1 1 conv33_splitncnn_1 conv34_relu23 -23330=4,3,22,22,576 0=576 1=1 5=1 6=55296 9=1 51 | ConvolutionDepthWise conv35 1 1 conv34_relu23 conv35_relu24 -23330=4,3,22,22,576 0=576 1=3 4=1 5=1 6=5184 7=576 9=1 52 | Convolution conv36 1 1 conv35_relu24 conv36 -23330=4,3,22,22,96 0=96 1=1 5=1 6=55296 53 | Eltwise add7 2 1 conv33_splitncnn_0 conv36 add7 -23330=4,3,22,22,96 0=1 54 | Split splitncnn_7 1 2 add7 add7_splitncnn_0 add7_splitncnn_1 -23330=8,3,22,22,96,3,22,22,96 55 | Convolution conv37 1 1 add7_splitncnn_1 conv37_relu25 -23330=4,3,22,22,576 0=576 1=1 5=1 6=55296 9=1 56 | ConvolutionDepthWise conv38 1 1 conv37_relu25 conv38_relu26 -23330=4,3,22,22,576 0=576 1=3 4=1 5=1 6=5184 7=576 9=1 57 | Convolution conv39 1 1 conv38_relu26 conv39 -23330=4,3,22,22,96 0=96 1=1 5=1 6=55296 58 | Eltwise add8 2 1 add7_splitncnn_0 conv39 add8 -23330=4,3,22,22,96 0=1 59 | Convolution conv40 1 1 add8 conv40_relu27 -23330=4,3,22,22,576 0=576 1=1 5=1 6=55296 9=1 60 | Split splitncnn_8 1 2 conv40_relu27 conv40_relu27_splitncnn_0 conv40_relu27_splitncnn_1 -23330=8,3,22,22,576,3,22,22,576 61 | ConvolutionDepthWise conv41 1 1 conv40_relu27_splitncnn_1 conv41_relu28 -23330=4,3,11,11,576 0=576 1=3 3=2 4=1 5=1 6=5184 7=576 9=1 62 | Convolution conv42 1 1 conv41_relu28 conv42 -23330=4,3,11,11,160 0=160 1=1 5=1 6=92160 63 | Split splitncnn_9 1 2 conv42 conv42_splitncnn_0 conv42_splitncnn_1 -23330=8,3,11,11,160,3,11,11,160 64 | Convolution conv43 1 1 conv42_splitncnn_1 conv43_relu29 -23330=4,3,11,11,960 0=960 1=1 5=1 6=153600 9=1 65 | ConvolutionDepthWise conv44 1 1 conv43_relu29 conv44_relu30 -23330=4,3,11,11,960 0=960 1=3 4=1 5=1 6=8640 7=960 9=1 66 | Convolution conv45 1 1 conv44_relu30 conv45 -23330=4,3,11,11,160 0=160 1=1 5=1 6=153600 67 | Eltwise add9 2 1 conv42_splitncnn_0 conv45 add9 -23330=4,3,11,11,160 0=1 68 | Split splitncnn_10 1 2 add9 add9_splitncnn_0 add9_splitncnn_1 -23330=8,3,11,11,160,3,11,11,160 69 | Convolution conv46 1 1 add9_splitncnn_1 conv46_relu31 -23330=4,3,11,11,960 0=960 1=1 5=1 6=153600 9=1 70 | ConvolutionDepthWise conv47 1 1 conv46_relu31 conv47_relu32 -23330=4,3,11,11,960 0=960 1=3 4=1 5=1 6=8640 7=960 9=1 71 | Convolution conv48 1 1 conv47_relu32 conv48 -23330=4,3,11,11,160 0=160 1=1 5=1 6=153600 72 | Eltwise add10 2 1 add9_splitncnn_0 conv48 add10 -23330=4,3,11,11,160 0=1 73 | Convolution conv49 1 1 add10 conv49_relu33 -23330=4,3,11,11,960 0=960 1=1 5=1 6=153600 9=1 74 | ConvolutionDepthWise conv50 1 1 conv49_relu33 conv50_relu34 -23330=4,3,11,11,960 0=960 1=3 4=1 5=1 6=8640 7=960 9=1 75 | Convolution conv51 1 1 conv50_relu34 conv51 -23330=4,3,11,11,320 0=320 1=1 5=1 6=307200 76 | Convolution conv52 1 1 conv51 conv52_relu35 -23330=4,3,11,11,1280 0=1280 1=1 5=1 6=409600 9=1 77 | ConvolutionDepthWise yolo/conv1/dw 1 1 conv52_relu35 yolo/conv1/dw_yolo/conv1/dw/relu -23330=4,3,11,11,1280 0=1280 1=3 4=1 5=1 6=11520 7=1280 9=1 78 | Convolution yolo/conv1 1 1 yolo/conv1/dw_yolo/conv1/dw/relu yolo/conv1_yolo/conv1/relu -23330=4,3,11,11,576 0=576 1=1 5=1 6=737280 9=1 79 | Split splitncnn_11 1 2 yolo/conv1_yolo/conv1/relu yolo/conv1_yolo/conv1/relu_splitncnn_0 yolo/conv1_yolo/conv1/relu_splitncnn_1 -23330=8,3,11,11,576,3,11,11,576 80 | DeconvolutionDepthWise upsample 1 1 yolo/conv1_yolo/conv1/relu_splitncnn_1 upsample -23330=4,3,21,21,576 0=576 1=1 3=2 6=576 7=576 81 | Pooling maxpool 1 1 upsample maxpool -23330=4,3,22,22,576 1=2 3=1 82 | ConvolutionDepthWise yolo/conv2/dw 1 1 conv40_relu27_splitncnn_0 yolo/conv2/dw_yolo/conv2/dw/relu -23330=4,3,22,22,576 0=576 1=3 4=1 5=1 6=5184 7=576 9=1 83 | Convolution yolo/conv2 1 1 yolo/conv2/dw_yolo/conv2/dw/relu yolo/conv2_yolo/conv2/relu -23330=4,3,22,22,576 0=576 1=1 5=1 6=331776 9=1 84 | Eltwise yolo/conv2/sum 2 1 maxpool yolo/conv2_yolo/conv2/relu yolo/conv2/sum -23330=4,3,22,22,576 0=1 85 | ConvolutionDepthWise yolo/conv3/dw 1 1 yolo/conv2/sum yolo/conv3/dw_yolo/conv3/dw/relu -23330=4,3,22,22,576 0=576 1=3 4=1 5=1 6=5184 7=576 9=1 86 | Convolution yolo/conv3 1 1 yolo/conv3/dw_yolo/conv3/dw/relu yolo/conv3_yolo/conv3/relu -23330=4,3,22,22,576 0=576 1=1 5=1 6=331776 9=1 87 | Convolution yolo/conv4 1 1 yolo/conv1_yolo/conv1/relu_splitncnn_0 yolo/conv4 -23330=4,3,11,11,75 0=75 1=1 5=1 6=43200 88 | Convolution yolo/conv5 1 1 yolo/conv3_yolo/conv3/relu yolo/conv5 -23330=4,3,22,22,75 0=75 1=1 5=1 6=43200 89 | Yolov3DetectionOutput detection_out 2 1 yolo/conv4 yolo/conv5 output 1=3 2=3.000000e-01 -23304=12,2.000000e+01,3.700000e+01,4.900000e+01,9.400000e+01,7.300000e+01,2.010000e+02,1.430000e+02,2.650000e+02,1.530000e+02,1.210000e+02,2.800000e+02,2.790000e+02 -23305=6,1077936128,1082130432,1084227584,0,1065353216,1073741824 -23306=2,3.200000e+01,1.600000e+01 90 | -------------------------------------------------------------------------------- /params/proxylessnasnet.param: -------------------------------------------------------------------------------- 1 | 7767517 2 | 91 104 3 | Input data 0 1 data -23330=4,3,224,224,3 0=224 1=224 2=3 4 | Convolution first-3x3-conv 1 1 data first-3x3-conv_relu -23330=4,3,112,112,32 0=32 1=3 3=2 4=1 5=1 6=864 9=1 5 | ConvolutionDepthWise A0_dw 1 1 first-3x3-conv_relu A0_dw_relu -23330=4,3,112,112,32 0=32 1=3 4=1 5=1 6=288 7=32 9=1 6 | Convolution A0_linear 1 1 A0_dw_relu A0_linear_bn -23330=4,3,112,112,32 0=32 1=1 5=1 6=1024 7 | Convolution B0_expand 1 1 A0_linear_bn B0_expand_relu -23330=4,3,112,112,48 0=48 1=1 5=1 6=1536 9=1 8 | ConvolutionDepthWise B0_dw 1 1 B0_expand_relu B0_dw_relu -23330=4,3,56,56,48 0=48 1=5 3=2 4=2 5=1 6=1200 7=48 9=1 9 | Convolution B0_linear 1 1 B0_dw_relu B0_linear_bn -23330=4,3,56,56,32 0=32 1=1 5=1 6=1536 10 | Split splitncnn_0 1 2 B0_linear_bn B0_linear_bn_splitncnn_0 B0_linear_bn_splitncnn_1 -23330=8,3,56,56,32,3,56,56,32 11 | Convolution B1_expand 1 1 B0_linear_bn_splitncnn_1 B1_expand_relu -23330=4,3,56,56,96 0=96 1=1 5=1 6=3072 9=1 12 | ConvolutionDepthWise B1_dw 1 1 B1_expand_relu B1_dw_relu -23330=4,3,56,56,96 0=96 1=3 4=1 5=1 6=864 7=96 9=1 13 | Convolution B1_linear 1 1 B1_dw_relu B1_linear_bn -23330=4,3,56,56,32 0=32 1=1 5=1 6=3072 14 | BinaryOp unknownncnn_0 2 1 B0_linear_bn_splitncnn_0 B1_linear_bn unknownncnn_0 -23330=4,3,56,56,32 15 | Convolution C0_expand 1 1 unknownncnn_0 C0_expand_relu -23330=4,3,56,56,96 0=96 1=1 5=1 6=3072 9=1 16 | ConvolutionDepthWise C0_dw 1 1 C0_expand_relu C0_dw_relu -23330=4,3,28,28,96 0=96 1=7 3=2 4=3 5=1 6=4704 7=96 9=1 17 | Convolution C0_linear 1 1 C0_dw_relu C0_linear_bn -23330=4,3,28,28,40 0=40 1=1 5=1 6=3840 18 | Split splitncnn_1 1 2 C0_linear_bn C0_linear_bn_splitncnn_0 C0_linear_bn_splitncnn_1 -23330=8,3,28,28,40,3,28,28,40 19 | Convolution C1_expand 1 1 C0_linear_bn_splitncnn_1 C1_expand_relu -23330=4,3,28,28,120 0=120 1=1 5=1 6=4800 9=1 20 | ConvolutionDepthWise C1_dw 1 1 C1_expand_relu C1_dw_relu -23330=4,3,28,28,120 0=120 1=3 4=1 5=1 6=1080 7=120 9=1 21 | Convolution C1_linear 1 1 C1_dw_relu C1_linear_bn -23330=4,3,28,28,40 0=40 1=1 5=1 6=4800 22 | BinaryOp unknownncnn_1 2 1 C0_linear_bn_splitncnn_0 C1_linear_bn unknownncnn_1 -23330=4,3,28,28,40 23 | Split splitncnn_2 1 2 unknownncnn_1 unknownncnn_1_splitncnn_0 unknownncnn_1_splitncnn_1 -23330=8,3,28,28,40,3,28,28,40 24 | Convolution C2_expand 1 1 unknownncnn_1_splitncnn_1 C2_expand_relu -23330=4,3,28,28,120 0=120 1=1 5=1 6=4800 9=1 25 | ConvolutionDepthWise C2_dw 1 1 C2_expand_relu C2_dw_relu -23330=4,3,28,28,120 0=120 1=5 4=2 5=1 6=3000 7=120 9=1 26 | Convolution C2_linear 1 1 C2_dw_relu C2_linear_bn -23330=4,3,28,28,40 0=40 1=1 5=1 6=4800 27 | BinaryOp unknownncnn_2 2 1 unknownncnn_1_splitncnn_0 C2_linear_bn unknownncnn_2 -23330=4,3,28,28,40 28 | Split splitncnn_3 1 2 unknownncnn_2 unknownncnn_2_splitncnn_0 unknownncnn_2_splitncnn_1 -23330=8,3,28,28,40,3,28,28,40 29 | Convolution C3_expand 1 1 unknownncnn_2_splitncnn_1 C3_expand_relu -23330=4,3,28,28,120 0=120 1=1 5=1 6=4800 9=1 30 | ConvolutionDepthWise C3_dw 1 1 C3_expand_relu C3_dw_relu -23330=4,3,28,28,120 0=120 1=5 4=2 5=1 6=3000 7=120 9=1 31 | Convolution C3_linear 1 1 C3_dw_relu C3_linear_bn -23330=4,3,28,28,40 0=40 1=1 5=1 6=4800 32 | BinaryOp unknownncnn_3 2 1 unknownncnn_2_splitncnn_0 C3_linear_bn unknownncnn_3 -23330=4,3,28,28,40 33 | Convolution D0_expand 1 1 unknownncnn_3 D0_expand_relu -23330=4,3,28,28,240 0=240 1=1 5=1 6=9600 9=1 34 | ConvolutionDepthWise D0_dw 1 1 D0_expand_relu D0_dw_relu -23330=4,3,14,14,240 0=240 1=7 3=2 4=3 5=1 6=11760 7=240 9=1 35 | Convolution D0_linear 1 1 D0_dw_relu D0_linear_bn -23330=4,3,14,14,80 0=80 1=1 5=1 6=19200 36 | Split splitncnn_4 1 2 D0_linear_bn D0_linear_bn_splitncnn_0 D0_linear_bn_splitncnn_1 -23330=8,3,14,14,80,3,14,14,80 37 | Convolution D1_expand 1 1 D0_linear_bn_splitncnn_1 D1_expand_relu -23330=4,3,14,14,240 0=240 1=1 5=1 6=19200 9=1 38 | ConvolutionDepthWise D1_dw 1 1 D1_expand_relu D1_dw_relu -23330=4,3,14,14,240 0=240 1=5 4=2 5=1 6=6000 7=240 9=1 39 | Convolution D1_linear 1 1 D1_dw_relu D1_linear_bn -23330=4,3,14,14,80 0=80 1=1 5=1 6=19200 40 | BinaryOp unknownncnn_4 2 1 D0_linear_bn_splitncnn_0 D1_linear_bn unknownncnn_4 -23330=4,3,14,14,80 41 | Split splitncnn_5 1 2 unknownncnn_4 unknownncnn_4_splitncnn_0 unknownncnn_4_splitncnn_1 -23330=8,3,14,14,80,3,14,14,80 42 | Convolution D2_expand 1 1 unknownncnn_4_splitncnn_1 D2_expand_relu -23330=4,3,14,14,240 0=240 1=1 5=1 6=19200 9=1 43 | ConvolutionDepthWise D2_dw 1 1 D2_expand_relu D2_dw_relu -23330=4,3,14,14,240 0=240 1=5 4=2 5=1 6=6000 7=240 9=1 44 | Convolution D2_linear 1 1 D2_dw_relu D2_linear_bn -23330=4,3,14,14,80 0=80 1=1 5=1 6=19200 45 | BinaryOp unknownncnn_5 2 1 unknownncnn_4_splitncnn_0 D2_linear_bn unknownncnn_5 -23330=4,3,14,14,80 46 | Split splitncnn_6 1 2 unknownncnn_5 unknownncnn_5_splitncnn_0 unknownncnn_5_splitncnn_1 -23330=8,3,14,14,80,3,14,14,80 47 | Convolution D3_expand 1 1 unknownncnn_5_splitncnn_1 D3_expand_relu -23330=4,3,14,14,240 0=240 1=1 5=1 6=19200 9=1 48 | ConvolutionDepthWise D3_dw 1 1 D3_expand_relu D3_dw_relu -23330=4,3,14,14,240 0=240 1=5 4=2 5=1 6=6000 7=240 9=1 49 | Convolution D3_linear 1 1 D3_dw_relu D3_linear_bn -23330=4,3,14,14,80 0=80 1=1 5=1 6=19200 50 | BinaryOp unknownncnn_6 2 1 unknownncnn_5_splitncnn_0 D3_linear_bn unknownncnn_6 -23330=4,3,14,14,80 51 | Convolution E0_expand 1 1 unknownncnn_6 E0_expand_relu -23330=4,3,14,14,480 0=480 1=1 5=1 6=38400 9=1 52 | ConvolutionDepthWise E0_dw 1 1 E0_expand_relu E0_dw_relu -23330=4,3,14,14,480 0=480 1=5 4=2 5=1 6=12000 7=480 9=1 53 | Convolution E0_linear 1 1 E0_dw_relu E0_linear_bn -23330=4,3,14,14,96 0=96 1=1 5=1 6=46080 54 | Split splitncnn_7 1 2 E0_linear_bn E0_linear_bn_splitncnn_0 E0_linear_bn_splitncnn_1 -23330=8,3,14,14,96,3,14,14,96 55 | Convolution E1_expand 1 1 E0_linear_bn_splitncnn_1 E1_expand_relu -23330=4,3,14,14,288 0=288 1=1 5=1 6=27648 9=1 56 | ConvolutionDepthWise E1_dw 1 1 E1_expand_relu E1_dw_relu -23330=4,3,14,14,288 0=288 1=5 4=2 5=1 6=7200 7=288 9=1 57 | Convolution E1_linear 1 1 E1_dw_relu E1_linear_bn -23330=4,3,14,14,96 0=96 1=1 5=1 6=27648 58 | BinaryOp unknownncnn_7 2 1 E0_linear_bn_splitncnn_0 E1_linear_bn unknownncnn_7 -23330=4,3,14,14,96 59 | Split splitncnn_8 1 2 unknownncnn_7 unknownncnn_7_splitncnn_0 unknownncnn_7_splitncnn_1 -23330=8,3,14,14,96,3,14,14,96 60 | Convolution E2_expand 1 1 unknownncnn_7_splitncnn_1 E2_expand_relu -23330=4,3,14,14,288 0=288 1=1 5=1 6=27648 9=1 61 | ConvolutionDepthWise E2_dw 1 1 E2_expand_relu E2_dw_relu -23330=4,3,14,14,288 0=288 1=5 4=2 5=1 6=7200 7=288 9=1 62 | Convolution E2_linear 1 1 E2_dw_relu E2_linear_bn -23330=4,3,14,14,96 0=96 1=1 5=1 6=27648 63 | BinaryOp unknownncnn_8 2 1 unknownncnn_7_splitncnn_0 E2_linear_bn unknownncnn_8 -23330=4,3,14,14,96 64 | Split splitncnn_9 1 2 unknownncnn_8 unknownncnn_8_splitncnn_0 unknownncnn_8_splitncnn_1 -23330=8,3,14,14,96,3,14,14,96 65 | Convolution E3_expand 1 1 unknownncnn_8_splitncnn_1 E3_expand_relu -23330=4,3,14,14,288 0=288 1=1 5=1 6=27648 9=1 66 | ConvolutionDepthWise E3_dw 1 1 E3_expand_relu E3_dw_relu -23330=4,3,14,14,288 0=288 1=5 4=2 5=1 6=7200 7=288 9=1 67 | Convolution E3_linear 1 1 E3_dw_relu E3_linear_bn -23330=4,3,14,14,96 0=96 1=1 5=1 6=27648 68 | BinaryOp unknownncnn_9 2 1 unknownncnn_8_splitncnn_0 E3_linear_bn unknownncnn_9 -23330=4,3,14,14,96 69 | Convolution F0_expand 1 1 unknownncnn_9 F0_expand_relu -23330=4,3,14,14,576 0=576 1=1 5=1 6=55296 9=1 70 | ConvolutionDepthWise F0_dw 1 1 F0_expand_relu F0_dw_relu -23330=4,3,7,7,576 0=576 1=7 3=2 4=3 5=1 6=28224 7=576 9=1 71 | Convolution F0_linear 1 1 F0_dw_relu F0_linear_bn -23330=4,3,7,7,192 0=192 1=1 5=1 6=110592 72 | Split splitncnn_10 1 2 F0_linear_bn F0_linear_bn_splitncnn_0 F0_linear_bn_splitncnn_1 -23330=8,3,7,7,192,3,7,7,192 73 | Convolution F1_expand 1 1 F0_linear_bn_splitncnn_1 F1_expand_relu -23330=4,3,7,7,1152 0=1152 1=1 5=1 6=221184 9=1 74 | ConvolutionDepthWise F1_dw 1 1 F1_expand_relu F1_dw_relu -23330=4,3,7,7,1152 0=1152 1=7 4=3 5=1 6=56448 7=1152 9=1 75 | Convolution F1_linear 1 1 F1_dw_relu F1_linear_bn -23330=4,3,7,7,192 0=192 1=1 5=1 6=221184 76 | BinaryOp unknownncnn_10 2 1 F0_linear_bn_splitncnn_0 F1_linear_bn unknownncnn_10 -23330=4,3,7,7,192 77 | Split splitncnn_11 1 2 unknownncnn_10 unknownncnn_10_splitncnn_0 unknownncnn_10_splitncnn_1 -23330=8,3,7,7,192,3,7,7,192 78 | Convolution F2_expand 1 1 unknownncnn_10_splitncnn_1 F2_expand_relu -23330=4,3,7,7,576 0=576 1=1 5=1 6=110592 9=1 79 | ConvolutionDepthWise F2_dw 1 1 F2_expand_relu F2_dw_relu -23330=4,3,7,7,576 0=576 1=7 4=3 5=1 6=28224 7=576 9=1 80 | Convolution F2_linear 1 1 F2_dw_relu F2_linear_bn -23330=4,3,7,7,192 0=192 1=1 5=1 6=110592 81 | BinaryOp unknownncnn_11 2 1 unknownncnn_10_splitncnn_0 F2_linear_bn unknownncnn_11 -23330=4,3,7,7,192 82 | Split splitncnn_12 1 2 unknownncnn_11 unknownncnn_11_splitncnn_0 unknownncnn_11_splitncnn_1 -23330=8,3,7,7,192,3,7,7,192 83 | Convolution F3_expand 1 1 unknownncnn_11_splitncnn_1 F3_expand_relu -23330=4,3,7,7,576 0=576 1=1 5=1 6=110592 9=1 84 | ConvolutionDepthWise F3_dw 1 1 F3_expand_relu F3_dw_relu -23330=4,3,7,7,576 0=576 1=7 4=3 5=1 6=28224 7=576 9=1 85 | Convolution F3_linear 1 1 F3_dw_relu F3_linear_bn -23330=4,3,7,7,192 0=192 1=1 5=1 6=110592 86 | BinaryOp unknownncnn_12 2 1 unknownncnn_11_splitncnn_0 F3_linear_bn unknownncnn_12 -23330=4,3,7,7,192 87 | Convolution G0_expand 1 1 unknownncnn_12 G0_expand_relu -23330=4,3,7,7,1152 0=1152 1=1 5=1 6=221184 9=1 88 | ConvolutionDepthWise G0_dw 1 1 G0_expand_relu G0_dw_relu -23330=4,3,7,7,1152 0=1152 1=7 4=3 5=1 6=56448 7=1152 9=1 89 | Convolution G0_linear 1 1 G0_dw_relu G0_linear_bn -23330=4,3,7,7,320 0=320 1=1 5=1 6=368640 90 | Convolution last-1x1-conv 1 1 G0_linear_bn last-1x1-conv_relu -23330=4,3,7,7,1280 0=1280 1=1 5=1 6=409600 9=1 91 | Pooling avgpool 1 1 last-1x1-conv_relu flatten -23330=4,1,1280,1,1 0=1 1=7 4=1 5=1 92 | InnerProduct fc 1 1 flatten fc -23330=4,1,1000,1,1 0=1000 1=1 2=1280000 93 | Softmax prob 1 1 fc output -23330=4,1,1000,1,1 94 | -------------------------------------------------------------------------------- /params/mobilenet_ssd_int8.param: -------------------------------------------------------------------------------- 1 | 7767517 2 | 92 115 3 | Input input 0 1 data 0=300 1=300 2=3 4 | Split splitncnn_0 1 7 data data_splitncnn_0 data_splitncnn_1 data_splitncnn_2 data_splitncnn_3 data_splitncnn_4 data_splitncnn_5 data_splitncnn_6 5 | Convolution conv0 1 1 data_splitncnn_6 conv0_conv0/relu 0=32 1=3 3=2 4=1 5=1 6=864 8=102 9=1 6 | ConvolutionDepthWise conv1/dw 1 1 conv0_conv0/relu conv1/dw_conv1/dw/relu 0=32 1=3 4=1 5=1 6=288 7=32 8=101 9=1 7 | Convolution conv1 1 1 conv1/dw_conv1/dw/relu conv1_conv1/relu 0=64 1=1 5=1 6=2048 8=102 9=1 8 | ConvolutionDepthWise conv2/dw 1 1 conv1_conv1/relu conv2/dw_conv2/dw/relu 0=64 1=3 3=2 4=1 5=1 6=576 7=64 8=101 9=1 9 | Convolution conv2 1 1 conv2/dw_conv2/dw/relu conv2_conv2/relu 0=128 1=1 5=1 6=8192 8=102 9=1 10 | ConvolutionDepthWise conv3/dw 1 1 conv2_conv2/relu conv3/dw_conv3/dw/relu 0=128 1=3 4=1 5=1 6=1152 7=128 8=101 9=1 11 | Convolution conv3 1 1 conv3/dw_conv3/dw/relu conv3_conv3/relu 0=128 1=1 5=1 6=16384 8=102 9=1 12 | ConvolutionDepthWise conv4/dw 1 1 conv3_conv3/relu conv4/dw_conv4/dw/relu 0=128 1=3 3=2 4=1 5=1 6=1152 7=128 8=101 9=1 13 | Convolution conv4 1 1 conv4/dw_conv4/dw/relu conv4_conv4/relu 0=256 1=1 5=1 6=32768 8=102 9=1 14 | ConvolutionDepthWise conv5/dw 1 1 conv4_conv4/relu conv5/dw_conv5/dw/relu 0=256 1=3 4=1 5=1 6=2304 7=256 8=101 9=1 15 | Convolution conv5 1 1 conv5/dw_conv5/dw/relu conv5_conv5/relu 0=256 1=1 5=1 6=65536 8=102 9=1 16 | ConvolutionDepthWise conv6/dw 1 1 conv5_conv5/relu conv6/dw_conv6/dw/relu 0=256 1=3 3=2 4=1 5=1 6=2304 7=256 8=101 9=1 17 | Convolution conv6 1 1 conv6/dw_conv6/dw/relu conv6_conv6/relu 0=512 1=1 5=1 6=131072 8=102 9=1 18 | ConvolutionDepthWise conv7/dw 1 1 conv6_conv6/relu conv7/dw_conv7/dw/relu 0=512 1=3 4=1 5=1 6=4608 7=512 8=101 9=1 19 | Convolution conv7 1 1 conv7/dw_conv7/dw/relu conv7_conv7/relu 0=512 1=1 5=1 6=262144 8=102 9=1 20 | ConvolutionDepthWise conv8/dw 1 1 conv7_conv7/relu conv8/dw_conv8/dw/relu 0=512 1=3 4=1 5=1 6=4608 7=512 8=101 9=1 21 | Convolution conv8 1 1 conv8/dw_conv8/dw/relu conv8_conv8/relu 0=512 1=1 5=1 6=262144 8=102 9=1 22 | ConvolutionDepthWise conv9/dw 1 1 conv8_conv8/relu conv9/dw_conv9/dw/relu 0=512 1=3 4=1 5=1 6=4608 7=512 8=101 9=1 23 | Convolution conv9 1 1 conv9/dw_conv9/dw/relu conv9_conv9/relu 0=512 1=1 5=1 6=262144 8=102 9=1 24 | ConvolutionDepthWise conv10/dw 1 1 conv9_conv9/relu conv10/dw_conv10/dw/relu 0=512 1=3 4=1 5=1 6=4608 7=512 8=101 9=1 25 | Convolution conv10 1 1 conv10/dw_conv10/dw/relu conv10_conv10/relu 0=512 1=1 5=1 6=262144 8=102 9=1 26 | ConvolutionDepthWise conv11/dw 1 1 conv10_conv10/relu conv11/dw_conv11/dw/relu 0=512 1=3 4=1 5=1 6=4608 7=512 8=101 9=1 27 | Convolution conv11 1 1 conv11/dw_conv11/dw/relu conv11_conv11/relu 0=512 1=1 5=1 6=262144 8=2 9=1 28 | Split splitncnn_1 1 4 conv11_conv11/relu conv11_conv11/relu_splitncnn_0 conv11_conv11/relu_splitncnn_1 conv11_conv11/relu_splitncnn_2 conv11_conv11/relu_splitncnn_3 29 | ConvolutionDepthWise conv12/dw 1 1 conv11_conv11/relu_splitncnn_3 conv12/dw_conv12/dw/relu 0=512 1=3 3=2 4=1 5=1 6=4608 7=512 8=101 9=1 30 | Convolution conv12 1 1 conv12/dw_conv12/dw/relu conv12_conv12/relu 0=1024 1=1 5=1 6=524288 8=102 9=1 31 | ConvolutionDepthWise conv13/dw 1 1 conv12_conv12/relu conv13/dw_conv13/dw/relu 0=1024 1=3 4=1 5=1 6=9216 7=1024 8=101 9=1 32 | Convolution conv13 1 1 conv13/dw_conv13/dw/relu conv13_conv13/relu 0=1024 1=1 5=1 6=1048576 8=2 9=1 33 | Split splitncnn_2 1 4 conv13_conv13/relu conv13_conv13/relu_splitncnn_0 conv13_conv13/relu_splitncnn_1 conv13_conv13/relu_splitncnn_2 conv13_conv13/relu_splitncnn_3 34 | Convolution conv14_1 1 1 conv13_conv13/relu_splitncnn_3 conv14_1_conv14_1/relu 0=256 1=1 5=1 6=262144 8=102 9=1 35 | Convolution conv14_2 1 1 conv14_1_conv14_1/relu conv14_2_conv14_2/relu 0=512 1=3 3=2 4=1 5=1 6=1179648 8=2 9=1 36 | Split splitncnn_3 1 4 conv14_2_conv14_2/relu conv14_2_conv14_2/relu_splitncnn_0 conv14_2_conv14_2/relu_splitncnn_1 conv14_2_conv14_2/relu_splitncnn_2 conv14_2_conv14_2/relu_splitncnn_3 37 | Convolution conv15_1 1 1 conv14_2_conv14_2/relu_splitncnn_3 conv15_1_conv15_1/relu 0=128 1=1 5=1 6=65536 8=102 9=1 38 | Convolution conv15_2 1 1 conv15_1_conv15_1/relu conv15_2_conv15_2/relu 0=256 1=3 3=2 4=1 5=1 6=294912 8=2 9=1 39 | Split splitncnn_4 1 4 conv15_2_conv15_2/relu conv15_2_conv15_2/relu_splitncnn_0 conv15_2_conv15_2/relu_splitncnn_1 conv15_2_conv15_2/relu_splitncnn_2 conv15_2_conv15_2/relu_splitncnn_3 40 | Convolution conv16_1 1 1 conv15_2_conv15_2/relu_splitncnn_3 conv16_1_conv16_1/relu 0=128 1=1 5=1 6=32768 8=102 9=1 41 | Convolution conv16_2 1 1 conv16_1_conv16_1/relu conv16_2_conv16_2/relu 0=256 1=3 3=2 4=1 5=1 6=294912 8=2 9=1 42 | Split splitncnn_5 1 4 conv16_2_conv16_2/relu conv16_2_conv16_2/relu_splitncnn_0 conv16_2_conv16_2/relu_splitncnn_1 conv16_2_conv16_2/relu_splitncnn_2 conv16_2_conv16_2/relu_splitncnn_3 43 | Convolution conv17_1 1 1 conv16_2_conv16_2/relu_splitncnn_3 conv17_1_conv17_1/relu 0=64 1=1 5=1 6=16384 8=102 9=1 44 | Convolution conv17_2 1 1 conv17_1_conv17_1/relu conv17_2_conv17_2/relu 0=128 1=3 3=2 4=1 5=1 6=73728 8=2 9=1 45 | Split splitncnn_6 1 3 conv17_2_conv17_2/relu conv17_2_conv17_2/relu_splitncnn_0 conv17_2_conv17_2/relu_splitncnn_1 conv17_2_conv17_2/relu_splitncnn_2 46 | Convolution conv11_mbox_loc 1 1 conv11_conv11/relu_splitncnn_2 conv11_mbox_loc 0=12 1=1 5=1 6=6144 8=2 47 | Permute conv11_mbox_loc_perm 1 1 conv11_mbox_loc conv11_mbox_loc_perm 0=3 48 | Flatten conv11_mbox_loc_flat 1 1 conv11_mbox_loc_perm conv11_mbox_loc_flat 49 | Convolution conv11_mbox_conf 1 1 conv11_conv11/relu_splitncnn_1 conv11_mbox_conf 0=63 1=1 5=1 6=32256 8=2 50 | Permute conv11_mbox_conf_perm 1 1 conv11_mbox_conf conv11_mbox_conf_perm 0=3 51 | Flatten conv11_mbox_conf_flat 1 1 conv11_mbox_conf_perm conv11_mbox_conf_flat 52 | PriorBox conv11_mbox_priorbox 2 1 conv11_conv11/relu_splitncnn_0 data_splitncnn_5 conv11_mbox_priorbox -23300=1,60.000000 -23302=1,2.000000 9=-233 10=-233 13=0.500000 53 | Convolution conv13_mbox_loc 1 1 conv13_conv13/relu_splitncnn_2 conv13_mbox_loc 0=24 1=1 5=1 6=24576 8=2 54 | Permute conv13_mbox_loc_perm 1 1 conv13_mbox_loc conv13_mbox_loc_perm 0=3 55 | Flatten conv13_mbox_loc_flat 1 1 conv13_mbox_loc_perm conv13_mbox_loc_flat 56 | Convolution conv13_mbox_conf 1 1 conv13_conv13/relu_splitncnn_1 conv13_mbox_conf 0=126 1=1 5=1 6=129024 8=2 57 | Permute conv13_mbox_conf_perm 1 1 conv13_mbox_conf conv13_mbox_conf_perm 0=3 58 | Flatten conv13_mbox_conf_flat 1 1 conv13_mbox_conf_perm conv13_mbox_conf_flat 59 | PriorBox conv13_mbox_priorbox 2 1 conv13_conv13/relu_splitncnn_0 data_splitncnn_4 conv13_mbox_priorbox -23300=1,105.000000 -23301=1,150.000000 -23302=2,2.000000,3.000000 9=-233 10=-233 13=0.500000 60 | Convolution conv14_2_mbox_loc 1 1 conv14_2_conv14_2/relu_splitncnn_2 conv14_2_mbox_loc 0=24 1=1 5=1 6=12288 8=2 61 | Permute conv14_2_mbox_loc_perm 1 1 conv14_2_mbox_loc conv14_2_mbox_loc_perm 0=3 62 | Flatten conv14_2_mbox_loc_flat 1 1 conv14_2_mbox_loc_perm conv14_2_mbox_loc_flat 63 | Convolution conv14_2_mbox_conf 1 1 conv14_2_conv14_2/relu_splitncnn_1 conv14_2_mbox_conf 0=126 1=1 5=1 6=64512 8=2 64 | Permute conv14_2_mbox_conf_perm 1 1 conv14_2_mbox_conf conv14_2_mbox_conf_perm 0=3 65 | Flatten conv14_2_mbox_conf_flat 1 1 conv14_2_mbox_conf_perm conv14_2_mbox_conf_flat 66 | PriorBox conv14_2_mbox_priorbox 2 1 conv14_2_conv14_2/relu_splitncnn_0 data_splitncnn_3 conv14_2_mbox_priorbox -23300=1,150.000000 -23301=1,195.000000 -23302=2,2.000000,3.000000 9=-233 10=-233 13=0.500000 67 | Convolution conv15_2_mbox_loc 1 1 conv15_2_conv15_2/relu_splitncnn_2 conv15_2_mbox_loc 0=24 1=1 5=1 6=6144 8=2 68 | Permute conv15_2_mbox_loc_perm 1 1 conv15_2_mbox_loc conv15_2_mbox_loc_perm 0=3 69 | Flatten conv15_2_mbox_loc_flat 1 1 conv15_2_mbox_loc_perm conv15_2_mbox_loc_flat 70 | Convolution conv15_2_mbox_conf 1 1 conv15_2_conv15_2/relu_splitncnn_1 conv15_2_mbox_conf 0=126 1=1 5=1 6=32256 8=2 71 | Permute conv15_2_mbox_conf_perm 1 1 conv15_2_mbox_conf conv15_2_mbox_conf_perm 0=3 72 | Flatten conv15_2_mbox_conf_flat 1 1 conv15_2_mbox_conf_perm conv15_2_mbox_conf_flat 73 | PriorBox conv15_2_mbox_priorbox 2 1 conv15_2_conv15_2/relu_splitncnn_0 data_splitncnn_2 conv15_2_mbox_priorbox -23300=1,195.000000 -23301=1,240.000000 -23302=2,2.000000,3.000000 9=-233 10=-233 13=0.500000 74 | Convolution conv16_2_mbox_loc 1 1 conv16_2_conv16_2/relu_splitncnn_2 conv16_2_mbox_loc 0=24 1=1 5=1 6=6144 8=2 75 | Permute conv16_2_mbox_loc_perm 1 1 conv16_2_mbox_loc conv16_2_mbox_loc_perm 0=3 76 | Flatten conv16_2_mbox_loc_flat 1 1 conv16_2_mbox_loc_perm conv16_2_mbox_loc_flat 77 | Convolution conv16_2_mbox_conf 1 1 conv16_2_conv16_2/relu_splitncnn_1 conv16_2_mbox_conf 0=126 1=1 5=1 6=32256 8=2 78 | Permute conv16_2_mbox_conf_perm 1 1 conv16_2_mbox_conf conv16_2_mbox_conf_perm 0=3 79 | Flatten conv16_2_mbox_conf_flat 1 1 conv16_2_mbox_conf_perm conv16_2_mbox_conf_flat 80 | PriorBox conv16_2_mbox_priorbox 2 1 conv16_2_conv16_2/relu_splitncnn_0 data_splitncnn_1 conv16_2_mbox_priorbox -23300=1,240.000000 -23301=1,285.000000 -23302=2,2.000000,3.000000 9=-233 10=-233 13=0.500000 81 | Convolution conv17_2_mbox_loc 1 1 conv17_2_conv17_2/relu_splitncnn_2 conv17_2_mbox_loc 0=24 1=1 5=1 6=3072 8=2 82 | Permute conv17_2_mbox_loc_perm 1 1 conv17_2_mbox_loc conv17_2_mbox_loc_perm 0=3 83 | Flatten conv17_2_mbox_loc_flat 1 1 conv17_2_mbox_loc_perm conv17_2_mbox_loc_flat 84 | Convolution conv17_2_mbox_conf 1 1 conv17_2_conv17_2/relu_splitncnn_1 conv17_2_mbox_conf 0=126 1=1 5=1 6=16128 8=2 85 | Permute conv17_2_mbox_conf_perm 1 1 conv17_2_mbox_conf conv17_2_mbox_conf_perm 0=3 86 | Flatten conv17_2_mbox_conf_flat 1 1 conv17_2_mbox_conf_perm conv17_2_mbox_conf_flat 87 | PriorBox conv17_2_mbox_priorbox 2 1 conv17_2_conv17_2/relu_splitncnn_0 data_splitncnn_0 conv17_2_mbox_priorbox -23300=1,285.000000 -23301=1,300.000000 -23302=2,2.000000,3.000000 9=-233 10=-233 13=0.500000 88 | Concat mbox_loc 6 1 conv11_mbox_loc_flat conv13_mbox_loc_flat conv14_2_mbox_loc_flat conv15_2_mbox_loc_flat conv16_2_mbox_loc_flat conv17_2_mbox_loc_flat mbox_loc 89 | Concat mbox_conf 6 1 conv11_mbox_conf_flat conv13_mbox_conf_flat conv14_2_mbox_conf_flat conv15_2_mbox_conf_flat conv16_2_mbox_conf_flat conv17_2_mbox_conf_flat mbox_conf 90 | Concat mbox_priorbox 6 1 conv11_mbox_priorbox conv13_mbox_priorbox conv14_2_mbox_priorbox conv15_2_mbox_priorbox conv16_2_mbox_priorbox conv17_2_mbox_priorbox mbox_priorbox 0=1 91 | Reshape mbox_conf_reshape 1 1 mbox_conf mbox_conf_reshape 0=21 1=-1 92 | Softmax mbox_conf_softmax 1 1 mbox_conf_reshape mbox_conf_softmax 0=1 1=1 93 | Flatten mbox_conf_flatten 1 1 mbox_conf_softmax mbox_conf_flatten 94 | DetectionOutput detection_out 3 1 mbox_loc mbox_conf_flatten mbox_priorbox output 0=21 1=0.450000 2=100 4=0.250000 95 | -------------------------------------------------------------------------------- /params/mobilenet_v2.param: -------------------------------------------------------------------------------- 1 | 7767517 2 | 77 87 3 | Input data 0 1 data -23330=4,3,224,224,3 0=224 1=224 2=3 4 | Convolution conv1 1 1 data conv1/bn_relu1 -23330=4,3,112,112,32 0=32 1=3 3=2 4=1 5=1 6=864 9=1 5 | Convolution conv2_1/expand 1 1 conv1/bn_relu1 conv2_1/expand/bn_relu2_1/expand -23330=4,3,112,112,32 0=32 1=1 5=1 6=1024 9=1 6 | ConvolutionDepthWise conv2_1/dwise 1 1 conv2_1/expand/bn_relu2_1/expand conv2_1/dwise/bn_relu2_1/dwise -23330=4,3,112,112,32 0=32 1=3 4=1 5=1 6=288 7=32 9=1 7 | Convolution conv2_1/linear 1 1 conv2_1/dwise/bn_relu2_1/dwise conv2_1/linear/bn_conv2_1/linear/scale -23330=4,3,112,112,16 0=16 1=1 5=1 6=512 8 | Convolution conv2_2/expand 1 1 conv2_1/linear/bn_conv2_1/linear/scale conv2_2/expand/bn_relu2_2/expand -23330=4,3,112,112,96 0=96 1=1 5=1 6=1536 9=1 9 | ConvolutionDepthWise conv2_2/dwise 1 1 conv2_2/expand/bn_relu2_2/expand conv2_2/dwise/bn_relu2_2/dwise -23330=4,3,56,56,96 0=96 1=3 3=2 4=1 5=1 6=864 7=96 9=1 10 | Convolution conv2_2/linear 1 1 conv2_2/dwise/bn_relu2_2/dwise conv2_2/linear/bn_conv2_2/linear/scale -23330=4,3,56,56,24 0=24 1=1 5=1 6=2304 11 | Split splitncnn_0 1 2 conv2_2/linear/bn_conv2_2/linear/scale conv2_2/linear/bn_conv2_2/linear/scale_splitncnn_0 conv2_2/linear/bn_conv2_2/linear/scale_splitncnn_1 -23330=8,3,56,56,24,3,56,56,24 12 | Convolution conv3_1/expand 1 1 conv2_2/linear/bn_conv2_2/linear/scale_splitncnn_1 conv3_1/expand/bn_relu3_1/expand -23330=4,3,56,56,144 0=144 1=1 5=1 6=3456 9=1 13 | ConvolutionDepthWise conv3_1/dwise 1 1 conv3_1/expand/bn_relu3_1/expand conv3_1/dwise/bn_relu3_1/dwise -23330=4,3,56,56,144 0=144 1=3 4=1 5=1 6=1296 7=144 9=1 14 | Convolution conv3_1/linear 1 1 conv3_1/dwise/bn_relu3_1/dwise conv3_1/linear/bn_conv3_1/linear/scale -23330=4,3,56,56,24 0=24 1=1 5=1 6=3456 15 | Eltwise block_3_1 2 1 conv2_2/linear/bn_conv2_2/linear/scale_splitncnn_0 conv3_1/linear/bn_conv3_1/linear/scale block_3_1 -23330=4,3,56,56,24 0=1 16 | Convolution conv3_2/expand 1 1 block_3_1 conv3_2/expand/bn_relu3_2/expand -23330=4,3,56,56,144 0=144 1=1 5=1 6=3456 9=1 17 | ConvolutionDepthWise conv3_2/dwise 1 1 conv3_2/expand/bn_relu3_2/expand conv3_2/dwise/bn_relu3_2/dwise -23330=4,3,28,28,144 0=144 1=3 3=2 4=1 5=1 6=1296 7=144 9=1 18 | Convolution conv3_2/linear 1 1 conv3_2/dwise/bn_relu3_2/dwise conv3_2/linear/bn_conv3_2/linear/scale -23330=4,3,28,28,32 0=32 1=1 5=1 6=4608 19 | Split splitncnn_1 1 2 conv3_2/linear/bn_conv3_2/linear/scale conv3_2/linear/bn_conv3_2/linear/scale_splitncnn_0 conv3_2/linear/bn_conv3_2/linear/scale_splitncnn_1 -23330=8,3,28,28,32,3,28,28,32 20 | Convolution conv4_1/expand 1 1 conv3_2/linear/bn_conv3_2/linear/scale_splitncnn_1 conv4_1/expand/bn_relu4_1/expand -23330=4,3,28,28,192 0=192 1=1 5=1 6=6144 9=1 21 | ConvolutionDepthWise conv4_1/dwise 1 1 conv4_1/expand/bn_relu4_1/expand conv4_1/dwise/bn_relu4_1/dwise -23330=4,3,28,28,192 0=192 1=3 4=1 5=1 6=1728 7=192 9=1 22 | Convolution conv4_1/linear 1 1 conv4_1/dwise/bn_relu4_1/dwise conv4_1/linear/bn_conv4_1/linear/scale -23330=4,3,28,28,32 0=32 1=1 5=1 6=6144 23 | Eltwise block_4_1 2 1 conv3_2/linear/bn_conv3_2/linear/scale_splitncnn_0 conv4_1/linear/bn_conv4_1/linear/scale block_4_1 -23330=4,3,28,28,32 0=1 24 | Split splitncnn_2 1 2 block_4_1 block_4_1_splitncnn_0 block_4_1_splitncnn_1 -23330=8,3,28,28,32,3,28,28,32 25 | Convolution conv4_2/expand 1 1 block_4_1_splitncnn_1 conv4_2/expand/bn_relu4_2/expand -23330=4,3,28,28,192 0=192 1=1 5=1 6=6144 9=1 26 | ConvolutionDepthWise conv4_2/dwise 1 1 conv4_2/expand/bn_relu4_2/expand conv4_2/dwise/bn_relu4_2/dwise -23330=4,3,28,28,192 0=192 1=3 4=1 5=1 6=1728 7=192 9=1 27 | Convolution conv4_2/linear 1 1 conv4_2/dwise/bn_relu4_2/dwise conv4_2/linear/bn_conv4_2/linear/scale -23330=4,3,28,28,32 0=32 1=1 5=1 6=6144 28 | Eltwise block_4_2 2 1 block_4_1_splitncnn_0 conv4_2/linear/bn_conv4_2/linear/scale block_4_2 -23330=4,3,28,28,32 0=1 29 | Convolution conv4_3/expand 1 1 block_4_2 conv4_3/expand/bn_relu4_3/expand -23330=4,3,28,28,192 0=192 1=1 5=1 6=6144 9=1 30 | ConvolutionDepthWise conv4_3/dwise 1 1 conv4_3/expand/bn_relu4_3/expand conv4_3/dwise/bn_relu4_3/dwise -23330=4,3,14,14,192 0=192 1=3 3=2 4=1 5=1 6=1728 7=192 9=1 31 | Convolution conv4_3/linear 1 1 conv4_3/dwise/bn_relu4_3/dwise conv4_3/linear/bn_conv4_3/linear/scale -23330=4,3,14,14,64 0=64 1=1 5=1 6=12288 32 | Split splitncnn_3 1 2 conv4_3/linear/bn_conv4_3/linear/scale conv4_3/linear/bn_conv4_3/linear/scale_splitncnn_0 conv4_3/linear/bn_conv4_3/linear/scale_splitncnn_1 -23330=8,3,14,14,64,3,14,14,64 33 | Convolution conv4_4/expand 1 1 conv4_3/linear/bn_conv4_3/linear/scale_splitncnn_1 conv4_4/expand/bn_relu4_4/expand -23330=4,3,14,14,384 0=384 1=1 5=1 6=24576 9=1 34 | ConvolutionDepthWise conv4_4/dwise 1 1 conv4_4/expand/bn_relu4_4/expand conv4_4/dwise/bn_relu4_4/dwise -23330=4,3,14,14,384 0=384 1=3 4=1 5=1 6=3456 7=384 9=1 35 | Convolution conv4_4/linear 1 1 conv4_4/dwise/bn_relu4_4/dwise conv4_4/linear/bn_conv4_4/linear/scale -23330=4,3,14,14,64 0=64 1=1 5=1 6=24576 36 | Eltwise block_4_4 2 1 conv4_3/linear/bn_conv4_3/linear/scale_splitncnn_0 conv4_4/linear/bn_conv4_4/linear/scale block_4_4 -23330=4,3,14,14,64 0=1 37 | Split splitncnn_4 1 2 block_4_4 block_4_4_splitncnn_0 block_4_4_splitncnn_1 -23330=8,3,14,14,64,3,14,14,64 38 | Convolution conv4_5/expand 1 1 block_4_4_splitncnn_1 conv4_5/expand/bn_relu4_5/expand -23330=4,3,14,14,384 0=384 1=1 5=1 6=24576 9=1 39 | ConvolutionDepthWise conv4_5/dwise 1 1 conv4_5/expand/bn_relu4_5/expand conv4_5/dwise/bn_relu4_5/dwise -23330=4,3,14,14,384 0=384 1=3 4=1 5=1 6=3456 7=384 9=1 40 | Convolution conv4_5/linear 1 1 conv4_5/dwise/bn_relu4_5/dwise conv4_5/linear/bn_conv4_5/linear/scale -23330=4,3,14,14,64 0=64 1=1 5=1 6=24576 41 | Eltwise block_4_5 2 1 block_4_4_splitncnn_0 conv4_5/linear/bn_conv4_5/linear/scale block_4_5 -23330=4,3,14,14,64 0=1 42 | Split splitncnn_5 1 2 block_4_5 block_4_5_splitncnn_0 block_4_5_splitncnn_1 -23330=8,3,14,14,64,3,14,14,64 43 | Convolution conv4_6/expand 1 1 block_4_5_splitncnn_1 conv4_6/expand/bn_relu4_6/expand -23330=4,3,14,14,384 0=384 1=1 5=1 6=24576 9=1 44 | ConvolutionDepthWise conv4_6/dwise 1 1 conv4_6/expand/bn_relu4_6/expand conv4_6/dwise/bn_relu4_6/dwise -23330=4,3,14,14,384 0=384 1=3 4=1 5=1 6=3456 7=384 9=1 45 | Convolution conv4_6/linear 1 1 conv4_6/dwise/bn_relu4_6/dwise conv4_6/linear/bn_conv4_6/linear/scale -23330=4,3,14,14,64 0=64 1=1 5=1 6=24576 46 | Eltwise block_4_6 2 1 block_4_5_splitncnn_0 conv4_6/linear/bn_conv4_6/linear/scale block_4_6 -23330=4,3,14,14,64 0=1 47 | Convolution conv4_7/expand 1 1 block_4_6 conv4_7/expand/bn_relu4_7/expand -23330=4,3,14,14,384 0=384 1=1 5=1 6=24576 9=1 48 | ConvolutionDepthWise conv4_7/dwise 1 1 conv4_7/expand/bn_relu4_7/expand conv4_7/dwise/bn_relu4_7/dwise -23330=4,3,14,14,384 0=384 1=3 4=1 5=1 6=3456 7=384 9=1 49 | Convolution conv4_7/linear 1 1 conv4_7/dwise/bn_relu4_7/dwise conv4_7/linear/bn_conv4_7/linear/scale -23330=4,3,14,14,96 0=96 1=1 5=1 6=36864 50 | Split splitncnn_6 1 2 conv4_7/linear/bn_conv4_7/linear/scale conv4_7/linear/bn_conv4_7/linear/scale_splitncnn_0 conv4_7/linear/bn_conv4_7/linear/scale_splitncnn_1 -23330=8,3,14,14,96,3,14,14,96 51 | Convolution conv5_1/expand 1 1 conv4_7/linear/bn_conv4_7/linear/scale_splitncnn_1 conv5_1/expand/bn_relu5_1/expand -23330=4,3,14,14,576 0=576 1=1 5=1 6=55296 9=1 52 | ConvolutionDepthWise conv5_1/dwise 1 1 conv5_1/expand/bn_relu5_1/expand conv5_1/dwise/bn_relu5_1/dwise -23330=4,3,14,14,576 0=576 1=3 4=1 5=1 6=5184 7=576 9=1 53 | Convolution conv5_1/linear 1 1 conv5_1/dwise/bn_relu5_1/dwise conv5_1/linear/bn_conv5_1/linear/scale -23330=4,3,14,14,96 0=96 1=1 5=1 6=55296 54 | Eltwise block_5_1 2 1 conv4_7/linear/bn_conv4_7/linear/scale_splitncnn_0 conv5_1/linear/bn_conv5_1/linear/scale block_5_1 -23330=4,3,14,14,96 0=1 55 | Split splitncnn_7 1 2 block_5_1 block_5_1_splitncnn_0 block_5_1_splitncnn_1 -23330=8,3,14,14,96,3,14,14,96 56 | Convolution conv5_2/expand 1 1 block_5_1_splitncnn_1 conv5_2/expand/bn_relu5_2/expand -23330=4,3,14,14,576 0=576 1=1 5=1 6=55296 9=1 57 | ConvolutionDepthWise conv5_2/dwise 1 1 conv5_2/expand/bn_relu5_2/expand conv5_2/dwise/bn_relu5_2/dwise -23330=4,3,14,14,576 0=576 1=3 4=1 5=1 6=5184 7=576 9=1 58 | Convolution conv5_2/linear 1 1 conv5_2/dwise/bn_relu5_2/dwise conv5_2/linear/bn_conv5_2/linear/scale -23330=4,3,14,14,96 0=96 1=1 5=1 6=55296 59 | Eltwise block_5_2 2 1 block_5_1_splitncnn_0 conv5_2/linear/bn_conv5_2/linear/scale block_5_2 -23330=4,3,14,14,96 0=1 60 | Convolution conv5_3/expand 1 1 block_5_2 conv5_3/expand/bn_relu5_3/expand -23330=4,3,14,14,576 0=576 1=1 5=1 6=55296 9=1 61 | ConvolutionDepthWise conv5_3/dwise 1 1 conv5_3/expand/bn_relu5_3/expand conv5_3/dwise/bn_relu5_3/dwise -23330=4,3,7,7,576 0=576 1=3 3=2 4=1 5=1 6=5184 7=576 9=1 62 | Convolution conv5_3/linear 1 1 conv5_3/dwise/bn_relu5_3/dwise conv5_3/linear/bn_conv5_3/linear/scale -23330=4,3,7,7,160 0=160 1=1 5=1 6=92160 63 | Split splitncnn_8 1 2 conv5_3/linear/bn_conv5_3/linear/scale conv5_3/linear/bn_conv5_3/linear/scale_splitncnn_0 conv5_3/linear/bn_conv5_3/linear/scale_splitncnn_1 -23330=8,3,7,7,160,3,7,7,160 64 | Convolution conv6_1/expand 1 1 conv5_3/linear/bn_conv5_3/linear/scale_splitncnn_1 conv6_1/expand/bn_relu6_1/expand -23330=4,3,7,7,960 0=960 1=1 5=1 6=153600 9=1 65 | ConvolutionDepthWise conv6_1/dwise 1 1 conv6_1/expand/bn_relu6_1/expand conv6_1/dwise/bn_relu6_1/dwise -23330=4,3,7,7,960 0=960 1=3 4=1 5=1 6=8640 7=960 9=1 66 | Convolution conv6_1/linear 1 1 conv6_1/dwise/bn_relu6_1/dwise conv6_1/linear/bn_conv6_1/linear/scale -23330=4,3,7,7,160 0=160 1=1 5=1 6=153600 67 | Eltwise block_6_1 2 1 conv5_3/linear/bn_conv5_3/linear/scale_splitncnn_0 conv6_1/linear/bn_conv6_1/linear/scale block_6_1 -23330=4,3,7,7,160 0=1 68 | Split splitncnn_9 1 2 block_6_1 block_6_1_splitncnn_0 block_6_1_splitncnn_1 -23330=8,3,7,7,160,3,7,7,160 69 | Convolution conv6_2/expand 1 1 block_6_1_splitncnn_1 conv6_2/expand/bn_relu6_2/expand -23330=4,3,7,7,960 0=960 1=1 5=1 6=153600 9=1 70 | ConvolutionDepthWise conv6_2/dwise 1 1 conv6_2/expand/bn_relu6_2/expand conv6_2/dwise/bn_relu6_2/dwise -23330=4,3,7,7,960 0=960 1=3 4=1 5=1 6=8640 7=960 9=1 71 | Convolution conv6_2/linear 1 1 conv6_2/dwise/bn_relu6_2/dwise conv6_2/linear/bn_conv6_2/linear/scale -23330=4,3,7,7,160 0=160 1=1 5=1 6=153600 72 | Eltwise block_6_2 2 1 block_6_1_splitncnn_0 conv6_2/linear/bn_conv6_2/linear/scale block_6_2 -23330=4,3,7,7,160 0=1 73 | Convolution conv6_3/expand 1 1 block_6_2 conv6_3/expand/bn_relu6_3/expand -23330=4,3,7,7,960 0=960 1=1 5=1 6=153600 9=1 74 | ConvolutionDepthWise conv6_3/dwise 1 1 conv6_3/expand/bn_relu6_3/expand conv6_3/dwise/bn_relu6_3/dwise -23330=4,3,7,7,960 0=960 1=3 4=1 5=1 6=8640 7=960 9=1 75 | Convolution conv6_3/linear 1 1 conv6_3/dwise/bn_relu6_3/dwise conv6_3/linear/bn_conv6_3/linear/scale -23330=4,3,7,7,320 0=320 1=1 5=1 6=307200 76 | Convolution conv6_4 1 1 conv6_3/linear/bn_conv6_3/linear/scale conv6_4/bn_relu6_4 -23330=4,3,7,7,1280 0=1280 1=1 5=1 6=409600 9=1 77 | Pooling pool6 1 1 conv6_4/bn_relu6_4 pool6 -23330=4,1,1280,1,1 0=1 4=1 78 | InnerProduct fc7 1 1 pool6 fc7 -23330=4,1,1000,1,1 0=1000 1=1 2=1280000 79 | Softmax prob 1 1 fc7 output -23330=4,1,1000,1,1 80 | -------------------------------------------------------------------------------- /params/resnet50_int8.param: -------------------------------------------------------------------------------- 1 | 7767517 2 | 106 122 3 | Input data 0 1 data 0=224 1=224 2=3 4 | Convolution conv1 1 1 data conv1_conv1_relu 0=64 1=7 3=2 4=3 5=1 6=9408 8=2 9=1 5 | Pooling pool1 1 1 conv1_conv1_relu pool1 1=3 2=2 6 | Split splitncnn_0 1 2 pool1 pool1_splitncnn_0 pool1_splitncnn_1 7 | Convolution res2a_branch1 1 1 pool1_splitncnn_1 res2a_branch1_scale2a_branch1 0=256 1=1 5=1 6=16384 8=2 8 | Convolution res2a_branch2a 1 1 pool1_splitncnn_0 res2a_branch2a_res2a_branch2a_relu 0=64 1=1 5=1 6=4096 8=102 9=1 9 | Convolution res2a_branch2b 1 1 res2a_branch2a_res2a_branch2a_relu res2a_branch2b_res2a_branch2b_relu 0=64 1=3 4=1 5=1 6=36864 8=102 9=1 10 | Convolution res2a_branch2c 1 1 res2a_branch2b_res2a_branch2b_relu res2a_branch2c_scale2a_branch2c 0=256 1=1 5=1 6=16384 8=2 11 | Eltwise res2a 2 1 res2a_branch1_scale2a_branch1 res2a_branch2c_scale2a_branch2c res2a 0=1 12 | ReLU res2a_relu 1 1 res2a res2a_res2a_relu 13 | Split splitncnn_1 1 2 res2a_res2a_relu res2a_res2a_relu_splitncnn_0 res2a_res2a_relu_splitncnn_1 14 | Convolution res2b_branch2a 1 1 res2a_res2a_relu_splitncnn_1 res2b_branch2a_res2b_branch2a_relu 0=64 1=1 5=1 6=16384 8=102 9=1 15 | Convolution res2b_branch2b 1 1 res2b_branch2a_res2b_branch2a_relu res2b_branch2b_res2b_branch2b_relu 0=64 1=3 4=1 5=1 6=36864 8=102 9=1 16 | Convolution res2b_branch2c 1 1 res2b_branch2b_res2b_branch2b_relu res2b_branch2c_scale2b_branch2c 0=256 1=1 5=1 6=16384 8=2 17 | Eltwise res2b 2 1 res2a_res2a_relu_splitncnn_0 res2b_branch2c_scale2b_branch2c res2b 0=1 18 | ReLU res2b_relu 1 1 res2b res2b_res2b_relu 19 | Split splitncnn_2 1 2 res2b_res2b_relu res2b_res2b_relu_splitncnn_0 res2b_res2b_relu_splitncnn_1 20 | Convolution res2c_branch2a 1 1 res2b_res2b_relu_splitncnn_1 res2c_branch2a_res2c_branch2a_relu 0=64 1=1 5=1 6=16384 8=102 9=1 21 | Convolution res2c_branch2b 1 1 res2c_branch2a_res2c_branch2a_relu res2c_branch2b_res2c_branch2b_relu 0=64 1=3 4=1 5=1 6=36864 8=102 9=1 22 | Convolution res2c_branch2c 1 1 res2c_branch2b_res2c_branch2b_relu res2c_branch2c_scale2c_branch2c 0=256 1=1 5=1 6=16384 8=2 23 | Eltwise res2c 2 1 res2b_res2b_relu_splitncnn_0 res2c_branch2c_scale2c_branch2c res2c 0=1 24 | ReLU res2c_relu 1 1 res2c res2c_res2c_relu 25 | Split splitncnn_3 1 2 res2c_res2c_relu res2c_res2c_relu_splitncnn_0 res2c_res2c_relu_splitncnn_1 26 | Convolution res3a_branch1 1 1 res2c_res2c_relu_splitncnn_1 res3a_branch1_scale3a_branch1 0=512 1=1 3=2 5=1 6=131072 8=2 27 | Convolution res3a_branch2a 1 1 res2c_res2c_relu_splitncnn_0 res3a_branch2a_res3a_branch2a_relu 0=128 1=1 3=2 5=1 6=32768 8=102 9=1 28 | Convolution res3a_branch2b 1 1 res3a_branch2a_res3a_branch2a_relu res3a_branch2b_res3a_branch2b_relu 0=128 1=3 4=1 5=1 6=147456 8=102 9=1 29 | Convolution res3a_branch2c 1 1 res3a_branch2b_res3a_branch2b_relu res3a_branch2c_scale3a_branch2c 0=512 1=1 5=1 6=65536 8=2 30 | Eltwise res3a 2 1 res3a_branch1_scale3a_branch1 res3a_branch2c_scale3a_branch2c res3a 0=1 31 | ReLU res3a_relu 1 1 res3a res3a_res3a_relu 32 | Split splitncnn_4 1 2 res3a_res3a_relu res3a_res3a_relu_splitncnn_0 res3a_res3a_relu_splitncnn_1 33 | Convolution res3b_branch2a 1 1 res3a_res3a_relu_splitncnn_1 res3b_branch2a_res3b_branch2a_relu 0=128 1=1 5=1 6=65536 8=102 9=1 34 | Convolution res3b_branch2b 1 1 res3b_branch2a_res3b_branch2a_relu res3b_branch2b_res3b_branch2b_relu 0=128 1=3 4=1 5=1 6=147456 8=102 9=1 35 | Convolution res3b_branch2c 1 1 res3b_branch2b_res3b_branch2b_relu res3b_branch2c_scale3b_branch2c 0=512 1=1 5=1 6=65536 8=2 36 | Eltwise res3b 2 1 res3a_res3a_relu_splitncnn_0 res3b_branch2c_scale3b_branch2c res3b 0=1 37 | ReLU res3b_relu 1 1 res3b res3b_res3b_relu 38 | Split splitncnn_5 1 2 res3b_res3b_relu res3b_res3b_relu_splitncnn_0 res3b_res3b_relu_splitncnn_1 39 | Convolution res3c_branch2a 1 1 res3b_res3b_relu_splitncnn_1 res3c_branch2a_res3c_branch2a_relu 0=128 1=1 5=1 6=65536 8=102 9=1 40 | Convolution res3c_branch2b 1 1 res3c_branch2a_res3c_branch2a_relu res3c_branch2b_res3c_branch2b_relu 0=128 1=3 4=1 5=1 6=147456 8=102 9=1 41 | Convolution res3c_branch2c 1 1 res3c_branch2b_res3c_branch2b_relu res3c_branch2c_scale3c_branch2c 0=512 1=1 5=1 6=65536 8=2 42 | Eltwise res3c 2 1 res3b_res3b_relu_splitncnn_0 res3c_branch2c_scale3c_branch2c res3c 0=1 43 | ReLU res3c_relu 1 1 res3c res3c_res3c_relu 44 | Split splitncnn_6 1 2 res3c_res3c_relu res3c_res3c_relu_splitncnn_0 res3c_res3c_relu_splitncnn_1 45 | Convolution res3d_branch2a 1 1 res3c_res3c_relu_splitncnn_1 res3d_branch2a_res3d_branch2a_relu 0=128 1=1 5=1 6=65536 8=102 9=1 46 | Convolution res3d_branch2b 1 1 res3d_branch2a_res3d_branch2a_relu res3d_branch2b_res3d_branch2b_relu 0=128 1=3 4=1 5=1 6=147456 8=102 9=1 47 | Convolution res3d_branch2c 1 1 res3d_branch2b_res3d_branch2b_relu res3d_branch2c_scale3d_branch2c 0=512 1=1 5=1 6=65536 8=2 48 | Eltwise res3d 2 1 res3c_res3c_relu_splitncnn_0 res3d_branch2c_scale3d_branch2c res3d 0=1 49 | ReLU res3d_relu 1 1 res3d res3d_res3d_relu 50 | Split splitncnn_7 1 2 res3d_res3d_relu res3d_res3d_relu_splitncnn_0 res3d_res3d_relu_splitncnn_1 51 | Convolution res4a_branch1 1 1 res3d_res3d_relu_splitncnn_1 res4a_branch1_scale4a_branch1 0=1024 1=1 3=2 5=1 6=524288 8=2 52 | Convolution res4a_branch2a 1 1 res3d_res3d_relu_splitncnn_0 res4a_branch2a_res4a_branch2a_relu 0=256 1=1 3=2 5=1 6=131072 8=102 9=1 53 | Convolution res4a_branch2b 1 1 res4a_branch2a_res4a_branch2a_relu res4a_branch2b_res4a_branch2b_relu 0=256 1=3 4=1 5=1 6=589824 8=102 9=1 54 | Convolution res4a_branch2c 1 1 res4a_branch2b_res4a_branch2b_relu res4a_branch2c_scale4a_branch2c 0=1024 1=1 5=1 6=262144 8=2 55 | Eltwise res4a 2 1 res4a_branch1_scale4a_branch1 res4a_branch2c_scale4a_branch2c res4a 0=1 56 | ReLU res4a_relu 1 1 res4a res4a_res4a_relu 57 | Split splitncnn_8 1 2 res4a_res4a_relu res4a_res4a_relu_splitncnn_0 res4a_res4a_relu_splitncnn_1 58 | Convolution res4b_branch2a 1 1 res4a_res4a_relu_splitncnn_1 res4b_branch2a_res4b_branch2a_relu 0=256 1=1 5=1 6=262144 8=102 9=1 59 | Convolution res4b_branch2b 1 1 res4b_branch2a_res4b_branch2a_relu res4b_branch2b_res4b_branch2b_relu 0=256 1=3 4=1 5=1 6=589824 8=102 9=1 60 | Convolution res4b_branch2c 1 1 res4b_branch2b_res4b_branch2b_relu res4b_branch2c_scale4b_branch2c 0=1024 1=1 5=1 6=262144 8=2 61 | Eltwise res4b 2 1 res4a_res4a_relu_splitncnn_0 res4b_branch2c_scale4b_branch2c res4b 0=1 62 | ReLU res4b_relu 1 1 res4b res4b_res4b_relu 63 | Split splitncnn_9 1 2 res4b_res4b_relu res4b_res4b_relu_splitncnn_0 res4b_res4b_relu_splitncnn_1 64 | Convolution res4c_branch2a 1 1 res4b_res4b_relu_splitncnn_1 res4c_branch2a_res4c_branch2a_relu 0=256 1=1 5=1 6=262144 8=102 9=1 65 | Convolution res4c_branch2b 1 1 res4c_branch2a_res4c_branch2a_relu res4c_branch2b_res4c_branch2b_relu 0=256 1=3 4=1 5=1 6=589824 8=102 9=1 66 | Convolution res4c_branch2c 1 1 res4c_branch2b_res4c_branch2b_relu res4c_branch2c_scale4c_branch2c 0=1024 1=1 5=1 6=262144 8=2 67 | Eltwise res4c 2 1 res4b_res4b_relu_splitncnn_0 res4c_branch2c_scale4c_branch2c res4c 0=1 68 | ReLU res4c_relu 1 1 res4c res4c_res4c_relu 69 | Split splitncnn_10 1 2 res4c_res4c_relu res4c_res4c_relu_splitncnn_0 res4c_res4c_relu_splitncnn_1 70 | Convolution res4d_branch2a 1 1 res4c_res4c_relu_splitncnn_1 res4d_branch2a_res4d_branch2a_relu 0=256 1=1 5=1 6=262144 8=102 9=1 71 | Convolution res4d_branch2b 1 1 res4d_branch2a_res4d_branch2a_relu res4d_branch2b_res4d_branch2b_relu 0=256 1=3 4=1 5=1 6=589824 8=102 9=1 72 | Convolution res4d_branch2c 1 1 res4d_branch2b_res4d_branch2b_relu res4d_branch2c_scale4d_branch2c 0=1024 1=1 5=1 6=262144 8=2 73 | Eltwise res4d 2 1 res4c_res4c_relu_splitncnn_0 res4d_branch2c_scale4d_branch2c res4d 0=1 74 | ReLU res4d_relu 1 1 res4d res4d_res4d_relu 75 | Split splitncnn_11 1 2 res4d_res4d_relu res4d_res4d_relu_splitncnn_0 res4d_res4d_relu_splitncnn_1 76 | Convolution res4e_branch2a 1 1 res4d_res4d_relu_splitncnn_1 res4e_branch2a_res4e_branch2a_relu 0=256 1=1 5=1 6=262144 8=102 9=1 77 | Convolution res4e_branch2b 1 1 res4e_branch2a_res4e_branch2a_relu res4e_branch2b_res4e_branch2b_relu 0=256 1=3 4=1 5=1 6=589824 8=102 9=1 78 | Convolution res4e_branch2c 1 1 res4e_branch2b_res4e_branch2b_relu res4e_branch2c_scale4e_branch2c 0=1024 1=1 5=1 6=262144 8=2 79 | Eltwise res4e 2 1 res4d_res4d_relu_splitncnn_0 res4e_branch2c_scale4e_branch2c res4e 0=1 80 | ReLU res4e_relu 1 1 res4e res4e_res4e_relu 81 | Split splitncnn_12 1 2 res4e_res4e_relu res4e_res4e_relu_splitncnn_0 res4e_res4e_relu_splitncnn_1 82 | Convolution res4f_branch2a 1 1 res4e_res4e_relu_splitncnn_1 res4f_branch2a_res4f_branch2a_relu 0=256 1=1 5=1 6=262144 8=102 9=1 83 | Convolution res4f_branch2b 1 1 res4f_branch2a_res4f_branch2a_relu res4f_branch2b_res4f_branch2b_relu 0=256 1=3 4=1 5=1 6=589824 8=102 9=1 84 | Convolution res4f_branch2c 1 1 res4f_branch2b_res4f_branch2b_relu res4f_branch2c_scale4f_branch2c 0=1024 1=1 5=1 6=262144 8=2 85 | Eltwise res4f 2 1 res4e_res4e_relu_splitncnn_0 res4f_branch2c_scale4f_branch2c res4f 0=1 86 | ReLU res4f_relu 1 1 res4f res4f_res4f_relu 87 | Split splitncnn_13 1 2 res4f_res4f_relu res4f_res4f_relu_splitncnn_0 res4f_res4f_relu_splitncnn_1 88 | Convolution res5a_branch1 1 1 res4f_res4f_relu_splitncnn_1 res5a_branch1_scale5a_branch1 0=2048 1=1 3=2 5=1 6=2097152 8=2 89 | Convolution res5a_branch2a 1 1 res4f_res4f_relu_splitncnn_0 res5a_branch2a_res5a_branch2a_relu 0=512 1=1 3=2 5=1 6=524288 8=102 9=1 90 | Convolution res5a_branch2b 1 1 res5a_branch2a_res5a_branch2a_relu res5a_branch2b_res5a_branch2b_relu 0=512 1=3 4=1 5=1 6=2359296 8=102 9=1 91 | Convolution res5a_branch2c 1 1 res5a_branch2b_res5a_branch2b_relu res5a_branch2c_scale5a_branch2c 0=2048 1=1 5=1 6=1048576 8=2 92 | Eltwise res5a 2 1 res5a_branch1_scale5a_branch1 res5a_branch2c_scale5a_branch2c res5a 0=1 93 | ReLU res5a_relu 1 1 res5a res5a_res5a_relu 94 | Split splitncnn_14 1 2 res5a_res5a_relu res5a_res5a_relu_splitncnn_0 res5a_res5a_relu_splitncnn_1 95 | Convolution res5b_branch2a 1 1 res5a_res5a_relu_splitncnn_1 res5b_branch2a_res5b_branch2a_relu 0=512 1=1 5=1 6=1048576 8=102 9=1 96 | Convolution res5b_branch2b 1 1 res5b_branch2a_res5b_branch2a_relu res5b_branch2b_res5b_branch2b_relu 0=512 1=3 4=1 5=1 6=2359296 8=102 9=1 97 | Convolution res5b_branch2c 1 1 res5b_branch2b_res5b_branch2b_relu res5b_branch2c_scale5b_branch2c 0=2048 1=1 5=1 6=1048576 8=2 98 | Eltwise res5b 2 1 res5a_res5a_relu_splitncnn_0 res5b_branch2c_scale5b_branch2c res5b 0=1 99 | ReLU res5b_relu 1 1 res5b res5b_res5b_relu 100 | Split splitncnn_15 1 2 res5b_res5b_relu res5b_res5b_relu_splitncnn_0 res5b_res5b_relu_splitncnn_1 101 | Convolution res5c_branch2a 1 1 res5b_res5b_relu_splitncnn_1 res5c_branch2a_res5c_branch2a_relu 0=512 1=1 5=1 6=1048576 8=102 9=1 102 | Convolution res5c_branch2b 1 1 res5c_branch2a_res5c_branch2a_relu res5c_branch2b_res5c_branch2b_relu 0=512 1=3 4=1 5=1 6=2359296 8=102 9=1 103 | Convolution res5c_branch2c 1 1 res5c_branch2b_res5c_branch2b_relu res5c_branch2c_scale5c_branch2c 0=2048 1=1 5=1 6=1048576 8=2 104 | Eltwise res5c 2 1 res5b_res5b_relu_splitncnn_0 res5c_branch2c_scale5c_branch2c res5c 0=1 105 | ReLU res5c_relu 1 1 res5c res5c_res5c_relu 106 | Pooling pool5 1 1 res5c_res5c_relu pool5 0=1 1=7 107 | InnerProduct fc1000 1 1 pool5 fc1000 0=1000 1=1 2=2048000 108 | Softmax prob 1 1 fc1000 output 109 | -------------------------------------------------------------------------------- /params/mobilenet_ssd.param: -------------------------------------------------------------------------------- 1 | 7767517 2 | 92 115 3 | Input input 0 1 data -23330=4,3,300,300,3 0=300 1=300 2=3 4 | Split splitncnn_0 1 7 data data_splitncnn_0 data_splitncnn_1 data_splitncnn_2 data_splitncnn_3 data_splitncnn_4 data_splitncnn_5 data_splitncnn_6 -23330=28,3,300,300,3,3,300,300,3,3,300,300,3,3,300,300,3,3,300,300,3,3,300,300,3,3,300,300,3 5 | Convolution conv0 1 1 data_splitncnn_6 conv0_conv0/relu -23330=4,3,150,150,32 0=32 1=3 3=2 4=1 5=1 6=864 9=1 6 | ConvolutionDepthWise conv1/dw 1 1 conv0_conv0/relu conv1/dw_conv1/dw/relu -23330=4,3,150,150,32 0=32 1=3 4=1 5=1 6=288 7=32 9=1 7 | Convolution conv1 1 1 conv1/dw_conv1/dw/relu conv1_conv1/relu -23330=4,3,150,150,64 0=64 1=1 5=1 6=2048 9=1 8 | ConvolutionDepthWise conv2/dw 1 1 conv1_conv1/relu conv2/dw_conv2/dw/relu -23330=4,3,75,75,64 0=64 1=3 3=2 4=1 5=1 6=576 7=64 9=1 9 | Convolution conv2 1 1 conv2/dw_conv2/dw/relu conv2_conv2/relu -23330=4,3,75,75,128 0=128 1=1 5=1 6=8192 9=1 10 | ConvolutionDepthWise conv3/dw 1 1 conv2_conv2/relu conv3/dw_conv3/dw/relu -23330=4,3,75,75,128 0=128 1=3 4=1 5=1 6=1152 7=128 9=1 11 | Convolution conv3 1 1 conv3/dw_conv3/dw/relu conv3_conv3/relu -23330=4,3,75,75,128 0=128 1=1 5=1 6=16384 9=1 12 | ConvolutionDepthWise conv4/dw 1 1 conv3_conv3/relu conv4/dw_conv4/dw/relu -23330=4,3,38,38,128 0=128 1=3 3=2 4=1 5=1 6=1152 7=128 9=1 13 | Convolution conv4 1 1 conv4/dw_conv4/dw/relu conv4_conv4/relu -23330=4,3,38,38,256 0=256 1=1 5=1 6=32768 9=1 14 | ConvolutionDepthWise conv5/dw 1 1 conv4_conv4/relu conv5/dw_conv5/dw/relu -23330=4,3,38,38,256 0=256 1=3 4=1 5=1 6=2304 7=256 9=1 15 | Convolution conv5 1 1 conv5/dw_conv5/dw/relu conv5_conv5/relu -23330=4,3,38,38,256 0=256 1=1 5=1 6=65536 9=1 16 | ConvolutionDepthWise conv6/dw 1 1 conv5_conv5/relu conv6/dw_conv6/dw/relu -23330=4,3,19,19,256 0=256 1=3 3=2 4=1 5=1 6=2304 7=256 9=1 17 | Convolution conv6 1 1 conv6/dw_conv6/dw/relu conv6_conv6/relu -23330=4,3,19,19,512 0=512 1=1 5=1 6=131072 9=1 18 | ConvolutionDepthWise conv7/dw 1 1 conv6_conv6/relu conv7/dw_conv7/dw/relu -23330=4,3,19,19,512 0=512 1=3 4=1 5=1 6=4608 7=512 9=1 19 | Convolution conv7 1 1 conv7/dw_conv7/dw/relu conv7_conv7/relu -23330=4,3,19,19,512 0=512 1=1 5=1 6=262144 9=1 20 | ConvolutionDepthWise conv8/dw 1 1 conv7_conv7/relu conv8/dw_conv8/dw/relu -23330=4,3,19,19,512 0=512 1=3 4=1 5=1 6=4608 7=512 9=1 21 | Convolution conv8 1 1 conv8/dw_conv8/dw/relu conv8_conv8/relu -23330=4,3,19,19,512 0=512 1=1 5=1 6=262144 9=1 22 | ConvolutionDepthWise conv9/dw 1 1 conv8_conv8/relu conv9/dw_conv9/dw/relu -23330=4,3,19,19,512 0=512 1=3 4=1 5=1 6=4608 7=512 9=1 23 | Convolution conv9 1 1 conv9/dw_conv9/dw/relu conv9_conv9/relu -23330=4,3,19,19,512 0=512 1=1 5=1 6=262144 9=1 24 | ConvolutionDepthWise conv10/dw 1 1 conv9_conv9/relu conv10/dw_conv10/dw/relu -23330=4,3,19,19,512 0=512 1=3 4=1 5=1 6=4608 7=512 9=1 25 | Convolution conv10 1 1 conv10/dw_conv10/dw/relu conv10_conv10/relu -23330=4,3,19,19,512 0=512 1=1 5=1 6=262144 9=1 26 | ConvolutionDepthWise conv11/dw 1 1 conv10_conv10/relu conv11/dw_conv11/dw/relu -23330=4,3,19,19,512 0=512 1=3 4=1 5=1 6=4608 7=512 9=1 27 | Convolution conv11 1 1 conv11/dw_conv11/dw/relu conv11_conv11/relu -23330=4,3,19,19,512 0=512 1=1 5=1 6=262144 9=1 28 | Split splitncnn_1 1 4 conv11_conv11/relu conv11_conv11/relu_splitncnn_0 conv11_conv11/relu_splitncnn_1 conv11_conv11/relu_splitncnn_2 conv11_conv11/relu_splitncnn_3 -23330=16,3,19,19,512,3,19,19,512,3,19,19,512,3,19,19,512 29 | ConvolutionDepthWise conv12/dw 1 1 conv11_conv11/relu_splitncnn_3 conv12/dw_conv12/dw/relu -23330=4,3,10,10,512 0=512 1=3 3=2 4=1 5=1 6=4608 7=512 9=1 30 | Convolution conv12 1 1 conv12/dw_conv12/dw/relu conv12_conv12/relu -23330=4,3,10,10,1024 0=1024 1=1 5=1 6=524288 9=1 31 | ConvolutionDepthWise conv13/dw 1 1 conv12_conv12/relu conv13/dw_conv13/dw/relu -23330=4,3,10,10,1024 0=1024 1=3 4=1 5=1 6=9216 7=1024 9=1 32 | Convolution conv13 1 1 conv13/dw_conv13/dw/relu conv13_conv13/relu -23330=4,3,10,10,1024 0=1024 1=1 5=1 6=1048576 9=1 33 | Split splitncnn_2 1 4 conv13_conv13/relu conv13_conv13/relu_splitncnn_0 conv13_conv13/relu_splitncnn_1 conv13_conv13/relu_splitncnn_2 conv13_conv13/relu_splitncnn_3 -23330=16,3,10,10,1024,3,10,10,1024,3,10,10,1024,3,10,10,1024 34 | Convolution conv14_1 1 1 conv13_conv13/relu_splitncnn_3 conv14_1_conv14_1/relu -23330=4,3,10,10,256 0=256 1=1 5=1 6=262144 9=1 35 | Convolution conv14_2 1 1 conv14_1_conv14_1/relu conv14_2_conv14_2/relu -23330=4,3,5,5,512 0=512 1=3 3=2 4=1 5=1 6=1179648 9=1 36 | Split splitncnn_3 1 4 conv14_2_conv14_2/relu conv14_2_conv14_2/relu_splitncnn_0 conv14_2_conv14_2/relu_splitncnn_1 conv14_2_conv14_2/relu_splitncnn_2 conv14_2_conv14_2/relu_splitncnn_3 -23330=16,3,5,5,512,3,5,5,512,3,5,5,512,3,5,5,512 37 | Convolution conv15_1 1 1 conv14_2_conv14_2/relu_splitncnn_3 conv15_1_conv15_1/relu -23330=4,3,5,5,128 0=128 1=1 5=1 6=65536 9=1 38 | Convolution conv15_2 1 1 conv15_1_conv15_1/relu conv15_2_conv15_2/relu -23330=4,3,3,3,256 0=256 1=3 3=2 4=1 5=1 6=294912 9=1 39 | Split splitncnn_4 1 4 conv15_2_conv15_2/relu conv15_2_conv15_2/relu_splitncnn_0 conv15_2_conv15_2/relu_splitncnn_1 conv15_2_conv15_2/relu_splitncnn_2 conv15_2_conv15_2/relu_splitncnn_3 -23330=16,3,3,3,256,3,3,3,256,3,3,3,256,3,3,3,256 40 | Convolution conv16_1 1 1 conv15_2_conv15_2/relu_splitncnn_3 conv16_1_conv16_1/relu -23330=4,3,3,3,128 0=128 1=1 5=1 6=32768 9=1 41 | Convolution conv16_2 1 1 conv16_1_conv16_1/relu conv16_2_conv16_2/relu -23330=4,3,2,2,256 0=256 1=3 3=2 4=1 5=1 6=294912 9=1 42 | Split splitncnn_5 1 4 conv16_2_conv16_2/relu conv16_2_conv16_2/relu_splitncnn_0 conv16_2_conv16_2/relu_splitncnn_1 conv16_2_conv16_2/relu_splitncnn_2 conv16_2_conv16_2/relu_splitncnn_3 -23330=16,3,2,2,256,3,2,2,256,3,2,2,256,3,2,2,256 43 | Convolution conv17_1 1 1 conv16_2_conv16_2/relu_splitncnn_3 conv17_1_conv17_1/relu -23330=4,3,2,2,64 0=64 1=1 5=1 6=16384 9=1 44 | Convolution conv17_2 1 1 conv17_1_conv17_1/relu conv17_2_conv17_2/relu -23330=4,3,1,1,128 0=128 1=3 3=2 4=1 5=1 6=73728 9=1 45 | Split splitncnn_6 1 3 conv17_2_conv17_2/relu conv17_2_conv17_2/relu_splitncnn_0 conv17_2_conv17_2/relu_splitncnn_1 conv17_2_conv17_2/relu_splitncnn_2 -23330=12,3,1,1,128,3,1,1,128,3,1,1,128 46 | Convolution conv11_mbox_loc 1 1 conv11_conv11/relu_splitncnn_2 conv11_mbox_loc -23330=4,3,19,19,12 0=12 1=1 5=1 6=6144 47 | Permute conv11_mbox_loc_perm 1 1 conv11_mbox_loc conv11_mbox_loc_perm -23330=4,3,12,19,19 0=3 48 | Flatten conv11_mbox_loc_flat 1 1 conv11_mbox_loc_perm conv11_mbox_loc_flat -23330=4,1,4332,1,1 49 | Convolution conv11_mbox_conf 1 1 conv11_conv11/relu_splitncnn_1 conv11_mbox_conf -23330=4,3,19,19,63 0=63 1=1 5=1 6=32256 50 | Permute conv11_mbox_conf_perm 1 1 conv11_mbox_conf conv11_mbox_conf_perm -23330=4,3,63,19,19 0=3 51 | Flatten conv11_mbox_conf_flat 1 1 conv11_mbox_conf_perm conv11_mbox_conf_flat -23330=4,1,22743,1,1 52 | PriorBox conv11_mbox_priorbox 2 1 conv11_conv11/relu_splitncnn_0 data_splitncnn_5 conv11_mbox_priorbox -23330=4,2,4332,2,1 -23300=1,6.000000e+01 -23302=1,2.000000e+00 9=-233 10=-233 13=5.000000e-01 53 | Convolution conv13_mbox_loc 1 1 conv13_conv13/relu_splitncnn_2 conv13_mbox_loc -23330=4,3,10,10,24 0=24 1=1 5=1 6=24576 54 | Permute conv13_mbox_loc_perm 1 1 conv13_mbox_loc conv13_mbox_loc_perm -23330=4,3,24,10,10 0=3 55 | Flatten conv13_mbox_loc_flat 1 1 conv13_mbox_loc_perm conv13_mbox_loc_flat -23330=4,1,2400,1,1 56 | Convolution conv13_mbox_conf 1 1 conv13_conv13/relu_splitncnn_1 conv13_mbox_conf -23330=4,3,10,10,126 0=126 1=1 5=1 6=129024 57 | Permute conv13_mbox_conf_perm 1 1 conv13_mbox_conf conv13_mbox_conf_perm -23330=4,3,126,10,10 0=3 58 | Flatten conv13_mbox_conf_flat 1 1 conv13_mbox_conf_perm conv13_mbox_conf_flat -23330=4,1,12600,1,1 59 | PriorBox conv13_mbox_priorbox 2 1 conv13_conv13/relu_splitncnn_0 data_splitncnn_4 conv13_mbox_priorbox -23330=4,2,2400,2,1 -23300=1,1.050000e+02 -23301=1,1.500000e+02 -23302=2,2.000000e+00,3.000000e+00 9=-233 10=-233 13=5.000000e-01 60 | Convolution conv14_2_mbox_loc 1 1 conv14_2_conv14_2/relu_splitncnn_2 conv14_2_mbox_loc -23330=4,3,5,5,24 0=24 1=1 5=1 6=12288 61 | Permute conv14_2_mbox_loc_perm 1 1 conv14_2_mbox_loc conv14_2_mbox_loc_perm -23330=4,3,24,5,5 0=3 62 | Flatten conv14_2_mbox_loc_flat 1 1 conv14_2_mbox_loc_perm conv14_2_mbox_loc_flat -23330=4,1,600,1,1 63 | Convolution conv14_2_mbox_conf 1 1 conv14_2_conv14_2/relu_splitncnn_1 conv14_2_mbox_conf -23330=4,3,5,5,126 0=126 1=1 5=1 6=64512 64 | Permute conv14_2_mbox_conf_perm 1 1 conv14_2_mbox_conf conv14_2_mbox_conf_perm -23330=4,3,126,5,5 0=3 65 | Flatten conv14_2_mbox_conf_flat 1 1 conv14_2_mbox_conf_perm conv14_2_mbox_conf_flat -23330=4,1,3150,1,1 66 | PriorBox conv14_2_mbox_priorbox 2 1 conv14_2_conv14_2/relu_splitncnn_0 data_splitncnn_3 conv14_2_mbox_priorbox -23330=4,2,600,2,1 -23300=1,1.500000e+02 -23301=1,1.950000e+02 -23302=2,2.000000e+00,3.000000e+00 9=-233 10=-233 13=5.000000e-01 67 | Convolution conv15_2_mbox_loc 1 1 conv15_2_conv15_2/relu_splitncnn_2 conv15_2_mbox_loc -23330=4,3,3,3,24 0=24 1=1 5=1 6=6144 68 | Permute conv15_2_mbox_loc_perm 1 1 conv15_2_mbox_loc conv15_2_mbox_loc_perm -23330=4,3,24,3,3 0=3 69 | Flatten conv15_2_mbox_loc_flat 1 1 conv15_2_mbox_loc_perm conv15_2_mbox_loc_flat -23330=4,1,216,1,1 70 | Convolution conv15_2_mbox_conf 1 1 conv15_2_conv15_2/relu_splitncnn_1 conv15_2_mbox_conf -23330=4,3,3,3,126 0=126 1=1 5=1 6=32256 71 | Permute conv15_2_mbox_conf_perm 1 1 conv15_2_mbox_conf conv15_2_mbox_conf_perm -23330=4,3,126,3,3 0=3 72 | Flatten conv15_2_mbox_conf_flat 1 1 conv15_2_mbox_conf_perm conv15_2_mbox_conf_flat -23330=4,1,1134,1,1 73 | PriorBox conv15_2_mbox_priorbox 2 1 conv15_2_conv15_2/relu_splitncnn_0 data_splitncnn_2 conv15_2_mbox_priorbox -23330=4,2,216,2,1 -23300=1,1.950000e+02 -23301=1,2.400000e+02 -23302=2,2.000000e+00,3.000000e+00 9=-233 10=-233 13=5.000000e-01 74 | Convolution conv16_2_mbox_loc 1 1 conv16_2_conv16_2/relu_splitncnn_2 conv16_2_mbox_loc -23330=4,3,2,2,24 0=24 1=1 5=1 6=6144 75 | Permute conv16_2_mbox_loc_perm 1 1 conv16_2_mbox_loc conv16_2_mbox_loc_perm -23330=4,3,24,2,2 0=3 76 | Flatten conv16_2_mbox_loc_flat 1 1 conv16_2_mbox_loc_perm conv16_2_mbox_loc_flat -23330=4,1,96,1,1 77 | Convolution conv16_2_mbox_conf 1 1 conv16_2_conv16_2/relu_splitncnn_1 conv16_2_mbox_conf -23330=4,3,2,2,126 0=126 1=1 5=1 6=32256 78 | Permute conv16_2_mbox_conf_perm 1 1 conv16_2_mbox_conf conv16_2_mbox_conf_perm -23330=4,3,126,2,2 0=3 79 | Flatten conv16_2_mbox_conf_flat 1 1 conv16_2_mbox_conf_perm conv16_2_mbox_conf_flat -23330=4,1,504,1,1 80 | PriorBox conv16_2_mbox_priorbox 2 1 conv16_2_conv16_2/relu_splitncnn_0 data_splitncnn_1 conv16_2_mbox_priorbox -23330=4,2,96,2,1 -23300=1,2.400000e+02 -23301=1,2.850000e+02 -23302=2,2.000000e+00,3.000000e+00 9=-233 10=-233 13=5.000000e-01 81 | Convolution conv17_2_mbox_loc 1 1 conv17_2_conv17_2/relu_splitncnn_2 conv17_2_mbox_loc -23330=4,3,1,1,24 0=24 1=1 5=1 6=3072 82 | Permute conv17_2_mbox_loc_perm 1 1 conv17_2_mbox_loc conv17_2_mbox_loc_perm -23330=4,3,24,1,1 0=3 83 | Flatten conv17_2_mbox_loc_flat 1 1 conv17_2_mbox_loc_perm conv17_2_mbox_loc_flat -23330=4,1,24,1,1 84 | Convolution conv17_2_mbox_conf 1 1 conv17_2_conv17_2/relu_splitncnn_1 conv17_2_mbox_conf -23330=4,3,1,1,126 0=126 1=1 5=1 6=16128 85 | Permute conv17_2_mbox_conf_perm 1 1 conv17_2_mbox_conf conv17_2_mbox_conf_perm -23330=4,3,126,1,1 0=3 86 | Flatten conv17_2_mbox_conf_flat 1 1 conv17_2_mbox_conf_perm conv17_2_mbox_conf_flat -23330=4,1,126,1,1 87 | PriorBox conv17_2_mbox_priorbox 2 1 conv17_2_conv17_2/relu_splitncnn_0 data_splitncnn_0 conv17_2_mbox_priorbox -23330=4,2,24,2,1 -23300=1,2.850000e+02 -23301=1,3.000000e+02 -23302=2,2.000000e+00,3.000000e+00 9=-233 10=-233 13=5.000000e-01 88 | Concat mbox_loc 6 1 conv11_mbox_loc_flat conv13_mbox_loc_flat conv14_2_mbox_loc_flat conv15_2_mbox_loc_flat conv16_2_mbox_loc_flat conv17_2_mbox_loc_flat mbox_loc -23330=4,1,7668,1,1 89 | Concat mbox_conf 6 1 conv11_mbox_conf_flat conv13_mbox_conf_flat conv14_2_mbox_conf_flat conv15_2_mbox_conf_flat conv16_2_mbox_conf_flat conv17_2_mbox_conf_flat mbox_conf -23330=4,1,40257,1,1 90 | Concat mbox_priorbox 6 1 conv11_mbox_priorbox conv13_mbox_priorbox conv14_2_mbox_priorbox conv15_2_mbox_priorbox conv16_2_mbox_priorbox conv17_2_mbox_priorbox mbox_priorbox -23330=4,2,7668,2,1 0=1 91 | Reshape mbox_conf_reshape 1 1 mbox_conf mbox_conf_reshape -23330=4,2,21,1917,1 0=21 1=-1 92 | Softmax mbox_conf_softmax 1 1 mbox_conf_reshape mbox_conf_softmax -23330=4,2,21,1917,1 0=1 1=1 93 | Flatten mbox_conf_flatten 1 1 mbox_conf_softmax mbox_conf_flatten -23330=4,1,40257,1,1 94 | DetectionOutput detection_out 3 1 mbox_loc mbox_conf_flatten mbox_priorbox output 0=21 1=4.500000e-01 2=100 4=2.500000e-01 95 | -------------------------------------------------------------------------------- /params/mobilenet_v3.param: -------------------------------------------------------------------------------- 1 | 7767517 2 | 145 163 3 | Input data 0 1 data -23330=4,3,224,224,3 0=224 1=224 2=3 4 | Convolution 313 1 1 data 313 -23330=4,3,112,112,16 0=16 1=3 3=2 4=1 5=1 6=432 5 | Split splitncnn_0 1 2 313 313_splitncnn_0 313_splitncnn_1 -23330=8,3,112,112,16,3,112,112,16 6 | HardSigmoid 319 1 1 313_splitncnn_1 319 -23330=4,3,112,112,16 7 | BinaryOp 320 2 1 313_splitncnn_0 319 320 -23330=4,3,112,112,16 0=2 8 | Split splitncnn_1 1 2 320 320_splitncnn_0 320_splitncnn_1 -23330=8,3,112,112,16,3,112,112,16 9 | ConvolutionDepthWise 321 1 1 320_splitncnn_1 323 -23330=4,3,112,112,16 0=16 1=3 4=1 5=1 6=144 7=16 9=1 10 | Convolution 324 1 1 323 324 -23330=4,3,112,112,16 0=16 1=1 5=1 6=256 11 | BinaryOp 326 2 1 320_splitncnn_0 324 326 -23330=4,3,112,112,16 12 | Convolution 327 1 1 326 329 -23330=4,3,112,112,64 0=64 1=1 5=1 6=1024 9=1 13 | ConvolutionDepthWise 330 1 1 329 332 -23330=4,3,56,56,64 0=64 1=3 3=2 4=1 5=1 6=576 7=64 9=1 14 | Convolution 333 1 1 332 333 -23330=4,3,56,56,24 0=24 1=1 5=1 6=1536 15 | Split splitncnn_2 1 2 333 333_splitncnn_0 333_splitncnn_1 -23330=8,3,56,56,24,3,56,56,24 16 | Convolution 335 1 1 333_splitncnn_1 337 -23330=4,3,56,56,72 0=72 1=1 5=1 6=1728 9=1 17 | ConvolutionDepthWise 338 1 1 337 340 -23330=4,3,56,56,72 0=72 1=3 4=1 5=1 6=648 7=72 9=1 18 | Convolution 341 1 1 340 341 -23330=4,3,56,56,24 0=24 1=1 5=1 6=1728 19 | BinaryOp 343 2 1 333_splitncnn_0 341 343 -23330=4,3,56,56,24 20 | Convolution 344 1 1 343 346 -23330=4,3,56,56,72 0=72 1=1 5=1 6=1728 9=1 21 | ConvolutionDepthWise 347 1 1 346 347 -23330=4,3,28,28,72 0=72 1=5 3=2 4=2 5=1 6=1800 7=72 22 | Split splitncnn_3 1 2 347 347_splitncnn_0 347_splitncnn_1 -23330=8,3,28,28,72,3,28,28,72 23 | Pooling 355 1 1 347_splitncnn_1 359 -23330=4,1,72,1,1 0=1 4=1 24 | InnerProduct 360 1 1 359 361 -23330=4,1,18,1,1 0=18 1=1 2=1296 9=1 25 | InnerProduct 362 1 1 361 362 -23330=4,1,72,1,1 0=72 1=1 2=1296 26 | HardSigmoid 367 1 1 362 367 -23330=4,1,72,1,1 27 | BinaryOp 376 2 1 347_splitncnn_0 367 376 -23330=4,3,28,28,72 0=2 28 | ReLU 377 1 1 376 377 -23330=4,3,28,28,72 29 | Convolution 378 1 1 377 378 -23330=4,3,28,28,40 0=40 1=1 5=1 6=2880 30 | Split splitncnn_4 1 2 378 378_splitncnn_0 378_splitncnn_1 -23330=8,3,28,28,40,3,28,28,40 31 | Convolution 380 1 1 378_splitncnn_1 382 -23330=4,3,28,28,120 0=120 1=1 5=1 6=4800 9=1 32 | ConvolutionDepthWise 383 1 1 382 383 -23330=4,3,28,28,120 0=120 1=5 4=2 5=1 6=3000 7=120 33 | Split splitncnn_5 1 2 383 383_splitncnn_0 383_splitncnn_1 -23330=8,3,28,28,120,3,28,28,120 34 | Pooling 391 1 1 383_splitncnn_1 395 -23330=4,1,120,1,1 0=1 4=1 35 | InnerProduct 396 1 1 395 397 -23330=4,1,30,1,1 0=30 1=1 2=3600 9=1 36 | InnerProduct 398 1 1 397 398 -23330=4,1,120,1,1 0=120 1=1 2=3600 37 | HardSigmoid 403 1 1 398 403 -23330=4,1,120,1,1 38 | BinaryOp 412 2 1 383_splitncnn_0 403 412 -23330=4,3,28,28,120 0=2 39 | ReLU 413 1 1 412 413 -23330=4,3,28,28,120 40 | Convolution 414 1 1 413 414 -23330=4,3,28,28,40 0=40 1=1 5=1 6=4800 41 | BinaryOp 416 2 1 378_splitncnn_0 414 416 -23330=4,3,28,28,40 42 | Split splitncnn_6 1 2 416 416_splitncnn_0 416_splitncnn_1 -23330=8,3,28,28,40,3,28,28,40 43 | Convolution 417 1 1 416_splitncnn_1 419 -23330=4,3,28,28,120 0=120 1=1 5=1 6=4800 9=1 44 | ConvolutionDepthWise 420 1 1 419 420 -23330=4,3,28,28,120 0=120 1=5 4=2 5=1 6=3000 7=120 45 | Split splitncnn_7 1 2 420 420_splitncnn_0 420_splitncnn_1 -23330=8,3,28,28,120,3,28,28,120 46 | Pooling 428 1 1 420_splitncnn_1 432 -23330=4,1,120,1,1 0=1 4=1 47 | InnerProduct 433 1 1 432 434 -23330=4,1,30,1,1 0=30 1=1 2=3600 9=1 48 | InnerProduct 435 1 1 434 435 -23330=4,1,120,1,1 0=120 1=1 2=3600 49 | HardSigmoid 440 1 1 435 440 -23330=4,1,120,1,1 50 | BinaryOp 449 2 1 420_splitncnn_0 440 449 -23330=4,3,28,28,120 0=2 51 | ReLU 450 1 1 449 450 -23330=4,3,28,28,120 52 | Convolution 451 1 1 450 451 -23330=4,3,28,28,40 0=40 1=1 5=1 6=4800 53 | BinaryOp 453 2 1 416_splitncnn_0 451 453 -23330=4,3,28,28,40 54 | Convolution 454 1 1 453 454 -23330=4,3,28,28,240 0=240 1=1 5=1 6=9600 55 | HardSwish 461 1 1 454 461 -23330=4,3,28,28,240 56 | ConvolutionDepthWise 462 1 1 461 462 -23330=4,3,14,14,240 0=240 1=3 3=2 4=1 5=1 6=2160 7=240 57 | HardSwish 469 1 1 462 469 -23330=4,3,14,14,240 58 | Convolution 470 1 1 469 470 -23330=4,3,14,14,80 0=80 1=1 5=1 6=19200 59 | Split splitncnn_8 1 2 470 470_splitncnn_0 470_splitncnn_1 -23330=8,3,14,14,80,3,14,14,80 60 | Convolution 472 1 1 470_splitncnn_1 472 -23330=4,3,14,14,200 0=200 1=1 5=1 6=16000 61 | HardSwish 479 1 1 472 479 -23330=4,3,14,14,200 62 | ConvolutionDepthWise 480 1 1 479 480 -23330=4,3,14,14,200 0=200 1=3 4=1 5=1 6=1800 7=200 63 | HardSwish 487 1 1 480 487 -23330=4,3,14,14,200 64 | Convolution 488 1 1 487 488 -23330=4,3,14,14,80 0=80 1=1 5=1 6=16000 65 | BinaryOp 490 2 1 470_splitncnn_0 488 490 -23330=4,3,14,14,80 66 | Split splitncnn_9 1 2 490 490_splitncnn_0 490_splitncnn_1 -23330=8,3,14,14,80,3,14,14,80 67 | Convolution 491 1 1 490_splitncnn_1 491 -23330=4,3,14,14,184 0=184 1=1 5=1 6=14720 68 | HardSwish 498 1 1 491 498 -23330=4,3,14,14,184 69 | ConvolutionDepthWise 499 1 1 498 499 -23330=4,3,14,14,184 0=184 1=3 4=1 5=1 6=1656 7=184 70 | HardSwish 506 1 1 499 506 -23330=4,3,14,14,184 71 | Convolution 507 1 1 506 507 -23330=4,3,14,14,80 0=80 1=1 5=1 6=14720 72 | BinaryOp 509 2 1 490_splitncnn_0 507 509 -23330=4,3,14,14,80 73 | Split splitncnn_10 1 2 509 509_splitncnn_0 509_splitncnn_1 -23330=8,3,14,14,80,3,14,14,80 74 | Convolution 510 1 1 509_splitncnn_1 510 -23330=4,3,14,14,184 0=184 1=1 5=1 6=14720 75 | HardSwish 517 1 1 510 517 -23330=4,3,14,14,184 76 | ConvolutionDepthWise 518 1 1 517 518 -23330=4,3,14,14,184 0=184 1=3 4=1 5=1 6=1656 7=184 77 | HardSwish 525 1 1 518 525 -23330=4,3,14,14,184 78 | Convolution 526 1 1 525 526 -23330=4,3,14,14,80 0=80 1=1 5=1 6=14720 79 | BinaryOp 528 2 1 509_splitncnn_0 526 528 -23330=4,3,14,14,80 80 | Convolution 529 1 1 528 529 -23330=4,3,14,14,480 0=480 1=1 5=1 6=38400 81 | HardSwish 536 1 1 529 536 -23330=4,3,14,14,480 82 | ConvolutionDepthWise 537 1 1 536 537 -23330=4,3,14,14,480 0=480 1=3 4=1 5=1 6=4320 7=480 83 | Split splitncnn_11 1 2 537 537_splitncnn_0 537_splitncnn_1 -23330=8,3,14,14,480,3,14,14,480 84 | Pooling 545 1 1 537_splitncnn_1 549 -23330=4,1,480,1,1 0=1 4=1 85 | InnerProduct 550 1 1 549 551 -23330=4,1,120,1,1 0=120 1=1 2=57600 9=1 86 | InnerProduct 552 1 1 551 552 -23330=4,1,480,1,1 0=480 1=1 2=57600 87 | HardSigmoid 557 1 1 552 557 -23330=4,1,480,1,1 88 | BinaryOp 566 2 1 537_splitncnn_0 557 566 -23330=4,3,14,14,480 0=2 89 | HardSwish 572 1 1 566 572 -23330=4,3,14,14,480 90 | Convolution 573 1 1 572 573 -23330=4,3,14,14,112 0=112 1=1 5=1 6=53760 91 | Split splitncnn_12 1 2 573 573_splitncnn_0 573_splitncnn_1 -23330=8,3,14,14,112,3,14,14,112 92 | Convolution 575 1 1 573_splitncnn_1 575 -23330=4,3,14,14,672 0=672 1=1 5=1 6=75264 93 | HardSwish 582 1 1 575 582 -23330=4,3,14,14,672 94 | ConvolutionDepthWise 583 1 1 582 583 -23330=4,3,14,14,672 0=672 1=3 4=1 5=1 6=6048 7=672 95 | Split splitncnn_13 1 2 583 583_splitncnn_0 583_splitncnn_1 -23330=8,3,14,14,672,3,14,14,672 96 | Pooling 591 1 1 583_splitncnn_1 595 -23330=4,1,672,1,1 0=1 4=1 97 | InnerProduct 596 1 1 595 597 -23330=4,1,168,1,1 0=168 1=1 2=112896 9=1 98 | InnerProduct 598 1 1 597 598 -23330=4,1,672,1,1 0=672 1=1 2=112896 99 | HardSigmoid 603 1 1 598 603 -23330=4,1,672,1,1 100 | BinaryOp 612 2 1 583_splitncnn_0 603 612 -23330=4,3,14,14,672 0=2 101 | HardSwish 618 1 1 612 618 -23330=4,3,14,14,672 102 | Convolution 619 1 1 618 619 -23330=4,3,14,14,112 0=112 1=1 5=1 6=75264 103 | BinaryOp 621 2 1 573_splitncnn_0 619 621 -23330=4,3,14,14,112 104 | Convolution 622 1 1 621 622 -23330=4,3,14,14,672 0=672 1=1 5=1 6=75264 105 | HardSwish 629 1 1 622 629 -23330=4,3,14,14,672 106 | ConvolutionDepthWise 630 1 1 629 630 -23330=4,3,14,14,672 0=672 1=5 4=2 5=1 6=16800 7=672 107 | Split splitncnn_14 1 2 630 630_splitncnn_0 630_splitncnn_1 -23330=8,3,14,14,672,3,14,14,672 108 | Pooling 638 1 1 630_splitncnn_1 642 -23330=4,1,672,1,1 0=1 4=1 109 | InnerProduct 643 1 1 642 644 -23330=4,1,168,1,1 0=168 1=1 2=112896 9=1 110 | InnerProduct 645 1 1 644 645 -23330=4,1,672,1,1 0=672 1=1 2=112896 111 | HardSigmoid 650 1 1 645 650 -23330=4,1,672,1,1 112 | BinaryOp 659 2 1 630_splitncnn_0 650 659 -23330=4,3,14,14,672 0=2 113 | HardSwish 665 1 1 659 665 -23330=4,3,14,14,672 114 | Convolution 666 1 1 665 666 -23330=4,3,14,14,160 0=160 1=1 5=1 6=107520 115 | Convolution 668 1 1 666 668 -23330=4,3,14,14,672 0=672 1=1 5=1 6=107520 116 | HardSwish 675 1 1 668 675 -23330=4,3,14,14,672 117 | ConvolutionDepthWise 676 1 1 675 676 -23330=4,3,7,7,672 0=672 1=5 3=2 4=2 5=1 6=16800 7=672 118 | Split splitncnn_15 1 2 676 676_splitncnn_0 676_splitncnn_1 -23330=8,3,7,7,672,3,7,7,672 119 | Pooling 684 1 1 676_splitncnn_1 688 -23330=4,1,672,1,1 0=1 4=1 120 | InnerProduct 689 1 1 688 690 -23330=4,1,168,1,1 0=168 1=1 2=112896 9=1 121 | InnerProduct 691 1 1 690 691 -23330=4,1,672,1,1 0=672 1=1 2=112896 122 | HardSigmoid 696 1 1 691 696 -23330=4,1,672,1,1 123 | BinaryOp 705 2 1 676_splitncnn_0 696 705 -23330=4,3,7,7,672 0=2 124 | HardSwish 711 1 1 705 711 -23330=4,3,7,7,672 125 | Convolution 712 1 1 711 712 -23330=4,3,7,7,160 0=160 1=1 5=1 6=107520 126 | Split splitncnn_16 1 2 712 712_splitncnn_0 712_splitncnn_1 -23330=8,3,7,7,160,3,7,7,160 127 | Convolution 714 1 1 712_splitncnn_1 714 -23330=4,3,7,7,960 0=960 1=1 5=1 6=153600 128 | HardSwish 721 1 1 714 721 -23330=4,3,7,7,960 129 | ConvolutionDepthWise 722 1 1 721 722 -23330=4,3,7,7,960 0=960 1=5 4=2 5=1 6=24000 7=960 130 | Split splitncnn_17 1 2 722 722_splitncnn_0 722_splitncnn_1 -23330=8,3,7,7,960,3,7,7,960 131 | Pooling 730 1 1 722_splitncnn_1 734 -23330=4,1,960,1,1 0=1 4=1 132 | InnerProduct 735 1 1 734 736 -23330=4,1,240,1,1 0=240 1=1 2=230400 9=1 133 | InnerProduct 737 1 1 736 737 -23330=4,1,960,1,1 0=960 1=1 2=230400 134 | HardSigmoid 742 1 1 737 742 -23330=4,1,960,1,1 135 | BinaryOp 751 2 1 722_splitncnn_0 742 751 -23330=4,3,7,7,960 0=2 136 | HardSwish 757 1 1 751 757 -23330=4,3,7,7,960 137 | Convolution 758 1 1 757 758 -23330=4,3,7,7,160 0=160 1=1 5=1 6=153600 138 | BinaryOp 760 2 1 712_splitncnn_0 758 760 -23330=4,3,7,7,160 139 | Convolution 761 1 1 760 761 -23330=4,3,7,7,960 0=960 1=1 5=1 6=153600 140 | HardSwish 768 1 1 761 768 -23330=4,3,7,7,960 141 | Pooling 769 1 1 768 769 -23330=4,1,960,1,1 0=1 4=1 142 | HardSwish 775 1 1 769 775 -23330=4,1,960,1,1 143 | Reshape 783 1 1 775 783 -23330=4,1,960,1,1 0=-1 144 | InnerProduct 784 1 1 783 784 -23330=4,1,1280,1,1 0=1280 1=1 2=1228800 145 | HardSwish 790 1 1 784 790 -23330=4,1,1280,1,1 146 | InnerProduct 791 1 1 790 791 -23330=4,1,1000,1,1 0=1000 1=1 2=1280000 147 | Softmax prob 1 1 791 output -23330=4,1,1000,1,1 148 | --------------------------------------------------------------------------------