{"id":23224059,"url":"https://github.com/hanson-young/ncnnpy","last_synced_at":"2025-10-06T15:30:37.468Z","repository":{"id":108974423,"uuid":"199120985","full_name":"hanson-young/ncnnpy","owner":"hanson-young","description":"This project can easily test the ncnn model and even deploy ncnn projects on python to speed up","archived":false,"fork":false,"pushed_at":"2019-07-27T10:31:43.000Z","size":11977,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-16T02:22:09.079Z","etag":null,"topics":["mobilefacenet","mtcnn","ncnn","python","retinaface"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hanson-young.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-27T05:34:26.000Z","updated_at":"2024-12-28T15:39:20.000Z","dependencies_parsed_at":"2023-03-10T12:45:19.332Z","dependency_job_id":null,"html_url":"https://github.com/hanson-young/ncnnpy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanson-young%2Fncnnpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanson-young%2Fncnnpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanson-young%2Fncnnpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanson-young%2Fncnnpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hanson-young","download_url":"https://codeload.github.com/hanson-young/ncnnpy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235534414,"owners_count":19005469,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mobilefacenet","mtcnn","ncnn","python","retinaface"],"created_at":"2024-12-18T23:30:00.597Z","updated_at":"2025-10-06T15:30:28.739Z","avatar_url":"https://github.com/hanson-young.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ncnnpy\nThis project can easily test the ncnn model and even deploy ncnn projects on python to speed up.\nAt present, we have implemented face detection and recognition based on ncnn and boost.\nface detection has two implementation methods, getting max face by mtcnn and getting all faces by retinaface. \nface recognition by insightface mobilefacenet.In the future, model transformation and debugging will be implemented in it.\n\n\n\n\n### Use directly\nWe have compiled ncnn with avx2 and ncnnpy, you can download from Baidu Driver  \nhttps://pan.baidu.com/s/1JuhkH7qiuK1fCswckrXzcg code:hpvg\njust put ncnnpy.so to ./install and run\n```buildoutcfg\npython face_detector.py\npython face_recognition.py\n```\nRetinaface for detection all faces  \n![all%20faces.jpg](https://github.com/hanson-young/ncnnpy/blob/master/install/all%20faces.jpg)\n\nMTCNN for detection max face  \n![max%20face.jpg](https://github.com/hanson-young/ncnnpy/blob/master/install/max%20face.jpg)\n\n\n### Recompile\nif you want change code by yourself,you should recompile!  \nReview CMakeList.txt and change your python path \n```\nif (NOT PYTHON_INCLUDE_DIRS OR NOT PYTHON_LIBRARY)\n    SET(PYTHON_INCLUDE_DIRS \"/usr/include/python2.7\")\n    SET(PYTHON_LIBRARY \"/usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so\")\nendif()\n```\nReview ./cmake/boost-python.cmake and change your boost path \n```buildoutcfg\n    set(Boost_LIBRARY_DIRS /usr/local/lib)\n    set(BOOST_INCLUDEDIR /usr/include/boost)\n```\nThan start compling !\n```buildoutcfg\ngit clone https://github.com/hanson-young/ncnnpy.git\ncd ncnnpy \nmkdir build\nmkdir src/lib\n# copy libncnn.a to ./src/lib\ncd build \u0026\u0026 cmake ..\n\n# ncnnpy. so will be generated under this folder\ncp ncnnpy.so ./../install\ncd ../install\n# only python2.7\npython face_detector.py\npython face_recognition.py\n```\n\n\n\n\n- [x] face detection by mtcnn and retinaface\n- [x] face recognition by mobilefacenet\n- [x] python2.7 \n\n\n### TODO\n- [ ] benchmark \n- [ ] Intermediate output \n- [ ] python3.6 \n\n### Dependencies\nCurrently only Linux and python2.7 is supported, if you want to run it on Windows or Mac,\nI suggest you modify CMakeLists. txt to recompile the source code\n```buildoutcfg\n$ sudo apt-get install libboost-python-dev libopencv-dev\n```\n### License\nBSD 3 Clause\n\n### Acknowledgement\n- [ncnn](https://github.com/Tencent/ncnn)\n- [RetinaFace-Cpp](https://github.com/Charrin/RetinaFace-Cpp)\n- [insightface](https://github.com/deepinsight/insightface)\n- [mobileFacenet-ncnn](https://github.com/honghuCode/mobileFacenet-ncnn/tree/feature/mobilefacenet-mxnet2caffe)\n- [numpy-opencv-converter](https://github.com/spillai/numpy-opencv-converter)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanson-young%2Fncnnpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhanson-young%2Fncnnpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanson-young%2Fncnnpy/lists"}