├── .gitignore ├── .gitlab-ci.yml ├── .pylintrc ├── 3rdparty ├── catch.hpp ├── inireader.hpp ├── json │ ├── json-forwards.h │ └── json.h ├── jsoncpp.cpp ├── prebuild │ └── include │ │ ├── aarch64-linux-gnu │ │ ├── python2.7 │ │ │ └── pyconfig.h │ │ ├── python3.5m │ │ │ └── pyconfig.h │ │ ├── python3.6 │ │ └── python3.6m │ │ │ └── pyconfig.h │ │ ├── python2.7 │ │ ├── Python-ast.h │ │ ├── Python.h │ │ ├── abstract.h │ │ ├── asdl.h │ │ ├── ast.h │ │ ├── bitset.h │ │ ├── boolobject.h │ │ ├── bufferobject.h │ │ ├── bytearrayobject.h │ │ ├── bytes_methods.h │ │ ├── bytesobject.h │ │ ├── cStringIO.h │ │ ├── cellobject.h │ │ ├── ceval.h │ │ ├── classobject.h │ │ ├── cobject.h │ │ ├── code.h │ │ ├── codecs.h │ │ ├── compile.h │ │ ├── complexobject.h │ │ ├── datetime.h │ │ ├── descrobject.h │ │ ├── dictobject.h │ │ ├── dtoa.h │ │ ├── enumobject.h │ │ ├── errcode.h │ │ ├── eval.h │ │ ├── fileobject.h │ │ ├── floatobject.h │ │ ├── frameobject.h │ │ ├── funcobject.h │ │ ├── genobject.h │ │ ├── graminit.h │ │ ├── grammar.h │ │ ├── import.h │ │ ├── intobject.h │ │ ├── intrcheck.h │ │ ├── iterobject.h │ │ ├── listobject.h │ │ ├── longintrepr.h │ │ ├── longobject.h │ │ ├── marshal.h │ │ ├── memoryobject.h │ │ ├── metagrammar.h │ │ ├── methodobject.h │ │ ├── modsupport.h │ │ ├── moduleobject.h │ │ ├── node.h │ │ ├── numpy │ │ ├── object.h │ │ ├── objimpl.h │ │ ├── opcode.h │ │ ├── osdefs.h │ │ ├── parsetok.h │ │ ├── patchlevel.h │ │ ├── pgen.h │ │ ├── pgenheaders.h │ │ ├── py_curses.h │ │ ├── pyarena.h │ │ ├── pycapsule.h │ │ ├── pyconfig.h │ │ ├── pyctype.h │ │ ├── pydebug.h │ │ ├── pyerrors.h │ │ ├── pyexpat.h │ │ ├── pyfpe.h │ │ ├── pygetopt.h │ │ ├── pymacconfig.h │ │ ├── pymactoolbox.h │ │ ├── pymath.h │ │ ├── pymem.h │ │ ├── pyport.h │ │ ├── pystate.h │ │ ├── pystrcmp.h │ │ ├── pystrtod.h │ │ ├── pythonrun.h │ │ ├── pythread.h │ │ ├── rangeobject.h │ │ ├── setobject.h │ │ ├── sliceobject.h │ │ ├── stringobject.h │ │ ├── structmember.h │ │ ├── structseq.h │ │ ├── symtable.h │ │ ├── sysmodule.h │ │ ├── timefuncs.h │ │ ├── token.h │ │ ├── traceback.h │ │ ├── tupleobject.h │ │ ├── ucnhash.h │ │ ├── unicodeobject.h │ │ ├── warnings.h │ │ └── weakrefobject.h │ │ ├── python3.5 │ │ ├── python3.5m │ │ ├── Python-ast.h │ │ ├── Python.h │ │ ├── abstract.h │ │ ├── accu.h │ │ ├── asdl.h │ │ ├── ast.h │ │ ├── bitset.h │ │ ├── bltinmodule.h │ │ ├── boolobject.h │ │ ├── bytearrayobject.h │ │ ├── bytes_methods.h │ │ ├── bytesobject.h │ │ ├── cellobject.h │ │ ├── ceval.h │ │ ├── classobject.h │ │ ├── code.h │ │ ├── codecs.h │ │ ├── compile.h │ │ ├── complexobject.h │ │ ├── datetime.h │ │ ├── descrobject.h │ │ ├── dictobject.h │ │ ├── dtoa.h │ │ ├── dynamic_annotations.h │ │ ├── enumobject.h │ │ ├── errcode.h │ │ ├── eval.h │ │ ├── fileobject.h │ │ ├── fileutils.h │ │ ├── floatobject.h │ │ ├── frameobject.h │ │ ├── funcobject.h │ │ ├── genobject.h │ │ ├── graminit.h │ │ ├── grammar.h │ │ ├── import.h │ │ ├── intrcheck.h │ │ ├── iterobject.h │ │ ├── listobject.h │ │ ├── longintrepr.h │ │ ├── longobject.h │ │ ├── marshal.h │ │ ├── memoryobject.h │ │ ├── metagrammar.h │ │ ├── methodobject.h │ │ ├── modsupport.h │ │ ├── moduleobject.h │ │ ├── namespaceobject.h │ │ ├── node.h │ │ ├── numpy │ │ │ ├── __multiarray_api.h │ │ │ ├── __ufunc_api.h │ │ │ ├── _neighborhood_iterator_imp.h │ │ │ ├── _numpyconfig.h │ │ │ ├── arrayobject.h │ │ │ ├── arrayscalars.h │ │ │ ├── halffloat.h │ │ │ ├── multiarray_api.txt │ │ │ ├── ndarrayobject.h │ │ │ ├── ndarraytypes.h │ │ │ ├── noprefix.h │ │ │ ├── npy_1_7_deprecated_api.h │ │ │ ├── npy_3kcompat.h │ │ │ ├── npy_common.h │ │ │ ├── npy_cpu.h │ │ │ ├── npy_endian.h │ │ │ ├── npy_interrupt.h │ │ │ ├── npy_math.h │ │ │ ├── npy_no_deprecated_api.h │ │ │ ├── npy_os.h │ │ │ ├── numpyconfig.h │ │ │ ├── old_defines.h │ │ │ ├── oldnumeric.h │ │ │ ├── ufunc_api.txt │ │ │ ├── ufuncobject.h │ │ │ └── utils.h │ │ ├── object.h │ │ ├── objimpl.h │ │ ├── odictobject.h │ │ ├── opcode.h │ │ ├── osdefs.h │ │ ├── parsetok.h │ │ ├── patchlevel.h │ │ ├── pgen.h │ │ ├── pgenheaders.h │ │ ├── py_curses.h │ │ ├── pyarena.h │ │ ├── pyatomic.h │ │ ├── pycapsule.h │ │ ├── pyconfig.h │ │ ├── pyctype.h │ │ ├── pydebug.h │ │ ├── pyerrors.h │ │ ├── pyexpat.h │ │ ├── pyfpe.h │ │ ├── pygetopt.h │ │ ├── pyhash.h │ │ ├── pylifecycle.h │ │ ├── pymacconfig.h │ │ ├── pymacro.h │ │ ├── pymath.h │ │ ├── pymem.h │ │ ├── pyport.h │ │ ├── pystate.h │ │ ├── pystrcmp.h │ │ ├── pystrhex.h │ │ ├── pystrtod.h │ │ ├── pythonrun.h │ │ ├── pythread.h │ │ ├── pytime.h │ │ ├── rangeobject.h │ │ ├── setobject.h │ │ ├── sliceobject.h │ │ ├── structmember.h │ │ ├── structseq.h │ │ ├── symtable.h │ │ ├── sysmodule.h │ │ ├── token.h │ │ ├── traceback.h │ │ ├── tupleobject.h │ │ ├── typeslots.h │ │ ├── ucnhash.h │ │ ├── unicodeobject.h │ │ ├── warnings.h │ │ └── weakrefobject.h │ │ ├── python3.6 │ │ └── python3.6m │ │ ├── Python-ast.h │ │ ├── Python.h │ │ ├── abstract.h │ │ ├── accu.h │ │ ├── asdl.h │ │ ├── ast.h │ │ ├── bitset.h │ │ ├── bltinmodule.h │ │ ├── boolobject.h │ │ ├── bytearrayobject.h │ │ ├── bytes_methods.h │ │ ├── bytesobject.h │ │ ├── cellobject.h │ │ ├── ceval.h │ │ ├── classobject.h │ │ ├── code.h │ │ ├── codecs.h │ │ ├── compile.h │ │ ├── complexobject.h │ │ ├── datetime.h │ │ ├── descrobject.h │ │ ├── dictobject.h │ │ ├── dtoa.h │ │ ├── dynamic_annotations.h │ │ ├── enumobject.h │ │ ├── errcode.h │ │ ├── eval.h │ │ ├── fileobject.h │ │ ├── fileutils.h │ │ ├── floatobject.h │ │ ├── frameobject.h │ │ ├── funcobject.h │ │ ├── genobject.h │ │ ├── graminit.h │ │ ├── grammar.h │ │ ├── import.h │ │ ├── intrcheck.h │ │ ├── iterobject.h │ │ ├── listobject.h │ │ ├── longintrepr.h │ │ ├── longobject.h │ │ ├── marshal.h │ │ ├── memoryobject.h │ │ ├── metagrammar.h │ │ ├── methodobject.h │ │ ├── modsupport.h │ │ ├── moduleobject.h │ │ ├── namespaceobject.h │ │ ├── node.h │ │ ├── object.h │ │ ├── objimpl.h │ │ ├── odictobject.h │ │ ├── opcode.h │ │ ├── osdefs.h │ │ ├── osmodule.h │ │ ├── parsetok.h │ │ ├── patchlevel.h │ │ ├── pgen.h │ │ ├── pgenheaders.h │ │ ├── py_curses.h │ │ ├── pyarena.h │ │ ├── pyatomic.h │ │ ├── pycapsule.h │ │ ├── pyconfig.h │ │ ├── pyctype.h │ │ ├── pydebug.h │ │ ├── pydtrace.h │ │ ├── pyerrors.h │ │ ├── pyexpat.h │ │ ├── pyfpe.h │ │ ├── pygetopt.h │ │ ├── pyhash.h │ │ ├── pylifecycle.h │ │ ├── pymacconfig.h │ │ ├── pymacro.h │ │ ├── pymath.h │ │ ├── pymem.h │ │ ├── pyport.h │ │ ├── pystate.h │ │ ├── pystrcmp.h │ │ ├── pystrhex.h │ │ ├── pystrtod.h │ │ ├── pythonrun.h │ │ ├── pythread.h │ │ ├── pytime.h │ │ ├── rangeobject.h │ │ ├── setobject.h │ │ ├── sliceobject.h │ │ ├── structmember.h │ │ ├── structseq.h │ │ ├── symtable.h │ │ ├── sysmodule.h │ │ ├── token.h │ │ ├── traceback.h │ │ ├── tupleobject.h │ │ ├── typeslots.h │ │ ├── ucnhash.h │ │ ├── unicodeobject.h │ │ ├── warnings.h │ │ └── weakrefobject.h ├── pybind11 │ ├── CMakeLists.txt │ ├── include │ │ └── pybind11 │ │ │ ├── attr.h │ │ │ ├── buffer_info.h │ │ │ ├── cast.h │ │ │ ├── chrono.h │ │ │ ├── common.h │ │ │ ├── complex.h │ │ │ ├── detail │ │ │ ├── class.h │ │ │ ├── common.h │ │ │ ├── descr.h │ │ │ ├── init.h │ │ │ ├── internals.h │ │ │ └── typeid.h │ │ │ ├── eigen.h │ │ │ ├── embed.h │ │ │ ├── eval.h │ │ │ ├── functional.h │ │ │ ├── iostream.h │ │ │ ├── numpy.h │ │ │ ├── operators.h │ │ │ ├── options.h │ │ │ ├── pybind11.h │ │ │ ├── pytypes.h │ │ │ ├── stl.h │ │ │ └── stl_bind.h │ ├── pybind11 │ │ ├── __init__.py │ │ ├── __main__.py │ │ └── _version.py │ └── tools │ │ ├── FindCatch.cmake │ │ ├── FindEigen3.cmake │ │ ├── FindPythonLibsNew.cmake │ │ ├── check-style.sh │ │ ├── libsize.py │ │ ├── mkdoc.py │ │ ├── pybind11Config.cmake.in │ │ └── pybind11Tools.cmake ├── spdlog │ ├── async.h │ ├── async_logger.h │ ├── common.h │ ├── details │ │ ├── async_logger_impl.h │ │ ├── circular_q.h │ │ ├── console_globals.h │ │ ├── file_helper.h │ │ ├── fmt_helper.h │ │ ├── log_msg.h │ │ ├── logger_impl.h │ │ ├── mpmc_blocking_q.h │ │ ├── null_mutex.h │ │ ├── os.h │ │ ├── pattern_formatter.h │ │ ├── periodic_worker.h │ │ ├── registry.h │ │ └── thread_pool.h │ ├── fmt │ │ ├── bin_to_hex.h │ │ ├── bundled │ │ │ ├── LICENSE.rst │ │ │ ├── chrono.h │ │ │ ├── color.h │ │ │ ├── core.h │ │ │ ├── format-inl.h │ │ │ ├── format.h │ │ │ ├── locale.h │ │ │ ├── ostream.h │ │ │ ├── posix.h │ │ │ ├── printf.h │ │ │ ├── ranges.h │ │ │ └── time.h │ │ ├── fmt.h │ │ └── ostr.h │ ├── formatter.h │ ├── logger.h │ ├── sinks │ │ ├── android_sink.h │ │ ├── ansicolor_sink.h │ │ ├── base_sink.h │ │ ├── basic_file_sink.h │ │ ├── daily_file_sink.h │ │ ├── dist_sink.h │ │ ├── msvc_sink.h │ │ ├── null_sink.h │ │ ├── ostream_sink.h │ │ ├── rotating_file_sink.h │ │ ├── sink.h │ │ ├── stdout_color_sinks.h │ │ ├── stdout_sinks.h │ │ ├── syslog_sink.h │ │ ├── systemd_sink.h │ │ └── wincolor_sink.h │ ├── spdlog.h │ ├── tweakme.h │ └── version.h └── tabulate.hpp ├── CMakeLists.txt ├── CODEOWNERS ├── LICENSE ├── README.md ├── RELEASE.md ├── bin ├── soc │ └── test_splitted_tf_model └── x86 │ ├── get_bmodel │ ├── split_tf_model │ └── test_splitted_tf_model ├── build_unix.cmake ├── build_windows.cmake ├── cmake ├── BM1684_ARM_PCIE │ ├── FindBMDecode.cmake │ ├── FindBMSDK.cmake │ ├── FindFFMPEG.cmake │ └── ToolChain_aarch64_linux.cmake ├── BM1684_CMODEL │ └── FindBMSDK.cmake ├── BM1684_PCIE │ ├── FindBMDecode.cmake │ ├── FindBMSDK.cmake │ └── FindFFMPEG.cmake ├── BM1684_SOC │ ├── FindBMDecode.cmake │ ├── FindBMSDK.cmake │ ├── FindFFMPEG.cmake │ ├── FindOpenCV.cmake │ └── ToolChain_aarch64_linux.cmake ├── BMNNSDK2_BM1684_ARM_PCIE │ ├── FindBMDecode.cmake │ ├── FindBMSDK.cmake │ └── FindFFMPEG.cmake ├── BMNNSDK2_BM1684_PCIE │ ├── FindBMDecode.cmake │ ├── FindBMSDK.cmake │ └── FindFFMPEG.cmake ├── ToolChain_loongarch64_linux.cmake ├── ToolChain_mips64_linux.cmake └── ToolChain_sw64_linux.cmake ├── compile.sh ├── docker ├── Dockerfile ├── build_sail_docker.sh └── pip.conf ├── docs ├── .gitignore ├── CODING_STYLE_GUIDE.md ├── FAQ.md ├── Makefile ├── README.md ├── Sophon_Inference_en.pdf ├── Sophon_Inference_zh.pdf ├── images │ ├── BMNNSDK.png │ ├── BMNNSDK_INFO.png │ ├── SA.png │ ├── SC.png │ ├── SC5+.jpg │ ├── SC5H.jpg │ ├── SE.png │ ├── SE5.jpg │ ├── SG6-06-A22.jpg │ ├── SG6-10-B22.jpg │ ├── autodeploy.png │ ├── logo.png │ ├── sa3.png │ ├── sc3.png │ ├── se3.png │ ├── sm5.jpg │ ├── sophon_inference.png │ └── split.png ├── source_common │ └── api │ │ ├── sail_cpp.rst │ │ └── sail_python.rst ├── source_en │ ├── 0_get_start.rst │ ├── 1_demo.rst │ ├── 2_module.rst │ ├── conf.py │ ├── demo │ │ ├── 0_preface.rst │ │ ├── 1_resnet50.rst │ │ ├── 2_ssd.rst │ │ ├── 3_yolov3.rst │ │ ├── 4_mtcnn.rst │ │ ├── mtcnn_cases │ │ │ ├── cpp.rst │ │ │ ├── python.rst │ │ │ └── usage.rst │ │ ├── resnet_cases │ │ │ ├── cpp.rst │ │ │ ├── python.rst │ │ │ └── usage.rst │ │ ├── ssd_cases │ │ │ ├── cpp.rst │ │ │ ├── python.rst │ │ │ └── usage.rst │ │ └── yolov3_cases │ │ │ ├── cpp.rst │ │ │ ├── python.rst │ │ │ └── usage.rst │ ├── get_start │ │ ├── 0_products.rst │ │ ├── 1_introduction.rst │ │ ├── 2_crash_course.rst │ │ ├── 3_one_key_deploy.rst │ │ ├── courses │ │ │ ├── convert.rst │ │ │ ├── deploy.rst │ │ │ └── install.rst │ │ ├── intros │ │ │ ├── bmnnsdk.rst │ │ │ ├── deploy.rst │ │ │ ├── install.rst │ │ │ └── si.rst │ │ └── pros │ │ │ ├── sa.rst │ │ │ ├── sc.rst │ │ │ ├── se.rst │ │ │ └── sm.rst │ ├── index.rst │ └── module │ │ ├── sail.rst │ │ ├── sail_cpp.rst │ │ └── sail_python.rst └── source_zh │ ├── 0_get_start.rst │ ├── 1_demo.rst │ ├── 2_module.rst │ ├── conf.py │ ├── demo │ ├── 0_preface.rst │ ├── 1_resnet50.rst │ ├── 2_ssd.rst │ ├── 3_yolov3.rst │ ├── 4_mtcnn.rst │ ├── mtcnn_cases │ │ ├── cpp.rst │ │ ├── python.rst │ │ └── usage.rst │ ├── resnet_cases │ │ ├── cpp.rst │ │ ├── python.rst │ │ └── usage.rst │ ├── ssd_cases │ │ ├── cpp.rst │ │ ├── python.rst │ │ └── usage.rst │ └── yolov3_cases │ │ ├── cpp.rst │ │ ├── python.rst │ │ └── usage.rst │ ├── get_start │ ├── 0_hardware.rst │ ├── 1_software.rst │ ├── 2_crash_course.rst │ ├── 3_one_key_deploy.rst │ ├── courses │ │ ├── convert.rst │ │ ├── deploy.rst │ │ └── install.rst │ ├── hardware │ │ ├── sa.rst │ │ ├── sc.rst │ │ ├── se.rst │ │ └── sm.rst │ └── software │ │ ├── bmnnsdk.rst │ │ ├── deploy.rst │ │ ├── install.rst │ │ └── si.rst │ ├── index.rst │ └── module │ ├── sail.rst │ ├── sail_cpp.rst │ └── sail_python.rst ├── git_version ├── include ├── base64.h ├── cvwrapper.h ├── engine.h ├── engine_multi.h ├── graph.h ├── message_queue.hpp ├── tensor.h └── tools.h ├── modules ├── algokit │ ├── README.md │ ├── __init__.py │ ├── algo_cv │ │ ├── __init__.py │ │ ├── cls │ │ │ ├── __init__.py │ │ │ ├── general_classification.py │ │ │ ├── general_classification_mx.py │ │ │ ├── general_classification_pt.py │ │ │ └── general_classification_tf.py │ │ ├── det │ │ │ ├── __init__.py │ │ │ ├── detconfig.py │ │ │ ├── face_detection_mtcnn.py │ │ │ ├── face_detection_ssh.py │ │ │ ├── object_detection_fasterrcnn.py │ │ │ ├── object_detection_fasterrcnn_resnet50_tf.py │ │ │ ├── object_detection_mobilenetssd.py │ │ │ ├── object_detection_mobilenetyolov3.py │ │ │ ├── object_detection_yolov3.py │ │ │ └── object_detection_yolov3_mx.py │ │ └── seg │ │ │ ├── __init__.py │ │ │ └── semantic_segmentation_deeplabv3_mobilenetv2_tf.py │ ├── algo_nlp │ │ └── __init__.py │ ├── algo_speech │ │ └── __init__.py │ ├── algofactory │ │ ├── __init__.py │ │ ├── autodeploy_factory.py │ │ ├── basefactory.py │ │ ├── facedetection_factory.py │ │ ├── generalclassification_factory.py │ │ └── objectdetection_factory.py │ ├── engine │ │ ├── __init__.py │ │ ├── autodeployconfig │ │ │ ├── deeplabv3_mobilenetv2_tf.json │ │ │ ├── fasterrcnn_resnet50_tf.json │ │ │ └── yolov3_mx.json │ │ ├── base_engine.py │ │ ├── bm1682_engine.py │ │ ├── bm1684_engine.py │ │ ├── bm_engine.py │ │ └── engineconfig │ │ │ ├── fasterrcnn_vgg.json │ │ │ ├── googlenet.json │ │ │ ├── mobilenetssd.json │ │ │ ├── mobilenetv1.json │ │ │ ├── mobilenetv1_tf.json │ │ │ ├── mobilenetyolov3.json │ │ │ ├── mtcnn.json │ │ │ ├── resnet50.json │ │ │ ├── resnet50_pt.json │ │ │ ├── resnext50_mx.json │ │ │ ├── ssh.json │ │ │ ├── vgg16.json │ │ │ └── yolov3.json │ ├── kitconfig.py │ ├── libs │ │ ├── __init__.py │ │ └── extend_layer │ │ │ ├── __init__.py │ │ │ ├── base_layer.py │ │ │ ├── fasterrcnnproposal_layer.py │ │ │ └── sshproposal_layer.py │ └── utils │ │ ├── __init__.py │ │ ├── box_operation.py │ │ ├── extend_math.py │ │ ├── timer.py │ │ ├── utils.py │ │ └── visualization.py ├── auto_runner │ ├── README.md │ ├── __init__.py │ ├── api.py │ ├── check_tensorflow.py │ ├── common │ │ ├── __init__.py │ │ └── base_runner.py │ ├── external │ │ ├── __init__.py │ │ ├── mxnet_functions.py │ │ └── tensorflow_functions.py │ ├── performance_tensorflow.py │ └── runner │ │ ├── __init__.py │ │ ├── caffe_runner.py │ │ ├── mxnet_runner.py │ │ ├── pytorch_runner.py │ │ ├── tensorflow_runner.py │ │ └── tensorflow_runner_zip.py ├── auto_split │ ├── README.md │ ├── __init__.py │ ├── api.py │ ├── common │ │ ├── __init__.py │ │ ├── base_compiler.py │ │ ├── base_splitter.py │ │ └── graph.py │ ├── compiler │ │ ├── __init__.py │ │ ├── caffe_compiler.py │ │ ├── mxnet_compiler.py │ │ ├── pytorch_compiler.py │ │ └── tensorflow_compiler.py │ ├── external │ │ ├── __init__.py │ │ ├── caffe_functions.py │ │ ├── mxnet_functions.py │ │ ├── pytorch_functions.py │ │ └── tensorflow_functions.py │ ├── split_caffe.py │ ├── split_pytorch.py │ ├── split_tensorflow.py │ └── splitter │ │ ├── __init__.py │ │ ├── caffe_splitter.py │ │ ├── mxnet_splitter.py │ │ ├── pytorch_splitter.py │ │ └── tensorflow_splitter.py └── utils │ ├── README.md │ ├── __init__.py │ ├── bmodel_config.json │ ├── bmodel_converter.py │ ├── download_and_convert.py │ ├── dryrun.py │ ├── functions.py │ ├── perf.py │ └── version.py ├── python ├── arm_pcie │ ├── MANIFEST.in │ ├── setup.py │ ├── sophon │ │ ├── __init__.py │ │ ├── algokit │ │ ├── auto_runner │ │ └── utils │ └── sophon_arm_pcie_whl.sh ├── loongarch64 │ ├── MANIFEST.in │ ├── setup.py │ ├── sophon │ │ ├── __init__.py │ │ ├── algokit │ │ ├── auto_runner │ │ └── utils │ └── sophon_loongarch64_whl.sh ├── mips64 │ ├── MANIFEST.in │ ├── setup.py │ ├── sophon │ │ ├── __init__.py │ │ ├── algokit │ │ ├── auto_runner │ │ └── utils │ └── sophon_mips64_whl.sh ├── pcie │ ├── MANIFEST.in │ ├── install_sophon.sh │ ├── setup.py │ ├── sophon │ │ ├── __init__.py │ │ ├── algokit │ │ ├── auto_runner │ │ ├── auto_split │ │ └── utils │ └── sophon_pcie_whl.sh ├── setup_dev_python_path.sh ├── soc │ ├── arm │ │ ├── MANIFEST.in │ │ ├── setup_arm.py │ │ └── sophon │ │ │ ├── __init__.py │ │ │ ├── algokit │ │ │ ├── auto_runner │ │ │ └── utils │ ├── sophon_soc_whl.sh │ └── x86 │ │ ├── setup_x86.py │ │ └── sophon │ │ ├── __init__.py │ │ └── auto_split ├── sophon │ ├── __init__.py │ ├── algokit │ ├── auto_runner │ ├── auto_split │ └── utils ├── sw64 │ ├── MANIFEST.in │ ├── setup.py │ ├── sophon │ │ ├── __init__.py │ │ ├── algokit │ │ ├── auto_runner │ │ └── utils │ └── sophon_sw64_whl.sh └── winx64 │ ├── MANIFEST.in │ ├── install_sophon.bat │ ├── setup.py │ ├── sophon │ └── __init__.py │ └── sophon_pcie_whl.bat ├── release ├── README.md ├── install_sail.sh ├── qa_test │ ├── sc5_tests │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── auto_test.sh │ │ ├── cmake │ │ │ ├── arm │ │ │ │ ├── FindBMNNSDK2.cmake │ │ │ │ └── FindOpenCV.cmake │ │ │ └── x86 │ │ │ │ ├── FindBMNNSDK2.cmake │ │ │ │ └── FindOpenCV.cmake │ │ ├── cpp │ │ │ ├── cls_resnet │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── verify_files │ │ │ │ │ └── verify_resnet50.ini │ │ │ ├── det_mtcnn │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── verify_files │ │ │ │ │ └── verify_mtcnn.ini │ │ │ ├── det_ssd │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── verify_files │ │ │ │ │ ├── verify_ssd_0_fp32_image.ini │ │ │ │ │ ├── verify_ssd_0_fp32_video.ini │ │ │ │ │ ├── verify_ssd_0_fp32_video_arm.ini │ │ │ │ │ ├── verify_ssd_0_int8_image.ini │ │ │ │ │ ├── verify_ssd_0_int8_video.ini │ │ │ │ │ ├── verify_ssd_0_int8_video_arm.ini │ │ │ │ │ ├── verify_ssd_1_fp32_image.ini │ │ │ │ │ ├── verify_ssd_1_fp32_video.ini │ │ │ │ │ ├── verify_ssd_1_int8_image.ini │ │ │ │ │ ├── verify_ssd_1_int8_video.ini │ │ │ │ │ ├── verify_ssd_2_fp32_video.ini │ │ │ │ │ └── verify_ssd_2_int8_video.ini │ │ │ └── det_yolov3 │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── verify_files │ │ │ │ ├── verify_yolov3_fp32_0.ini │ │ │ │ ├── verify_yolov3_fp32_0_arm.ini │ │ │ │ ├── verify_yolov3_fp32_1.ini │ │ │ │ ├── verify_yolov3_int8_0.ini │ │ │ │ ├── verify_yolov3_int8_0_arm.ini │ │ │ │ └── verify_yolov3_int8_1.ini │ │ └── python │ │ │ ├── cls_resnet │ │ │ └── verify_files │ │ │ │ └── verify_resnet50.json │ │ │ ├── det_mtcnn │ │ │ └── verify_files │ │ │ │ └── verify_mtcnn.json │ │ │ ├── det_ssd │ │ │ └── verify_files │ │ │ │ ├── verify_ssd_0_fp32_image.json │ │ │ │ ├── verify_ssd_0_fp32_video.json │ │ │ │ ├── verify_ssd_0_fp32_video_arm.json │ │ │ │ ├── verify_ssd_0_int8_image.json │ │ │ │ ├── verify_ssd_0_int8_video.json │ │ │ │ ├── verify_ssd_0_int8_video_arm.json │ │ │ │ ├── verify_ssd_1_fp32_image.json │ │ │ │ ├── verify_ssd_1_fp32_video.json │ │ │ │ ├── verify_ssd_1_int8_image.json │ │ │ │ ├── verify_ssd_1_int8_video.json │ │ │ │ ├── verify_ssd_2_fp32_video.json │ │ │ │ └── verify_ssd_2_int8_video.json │ │ │ └── det_yolov3 │ │ │ └── verify_files │ │ │ ├── verify_yolov3_fp32.json │ │ │ ├── verify_yolov3_fp32_arm.json │ │ │ ├── verify_yolov3_int8.json │ │ │ └── verify_yolov3_int8_arm.json │ └── se5_tests │ │ ├── README.md │ │ ├── cls_resnet │ │ ├── README.md │ │ └── verify_files │ │ │ └── verify_resnet50.ini │ │ ├── det_ssd │ │ ├── README.md │ │ └── verify_files │ │ │ ├── verify_ssd_0_fp32_image.ini │ │ │ ├── verify_ssd_0_fp32_video.ini │ │ │ ├── verify_ssd_0_fp32_video_arm.ini │ │ │ ├── verify_ssd_0_int8_image.ini │ │ │ ├── verify_ssd_0_int8_video.ini │ │ │ ├── verify_ssd_0_int8_video_arm.ini │ │ │ ├── verify_ssd_1_fp32_image.ini │ │ │ ├── verify_ssd_1_fp32_video.ini │ │ │ ├── verify_ssd_1_int8_image.ini │ │ │ ├── verify_ssd_1_int8_video.ini │ │ │ ├── verify_ssd_2_fp32_video.ini │ │ │ └── verify_ssd_2_int8_video.ini │ │ └── scripts │ │ └── auto_test.sh └── release_case │ ├── cpp_cv_bmcv_sail │ ├── Makefile.arm │ └── README.md │ ├── cpp_cv_cv+bmcv_sail │ ├── Makefile.arm │ └── README.md │ ├── cpp_ffmpeg_bmcv_sail │ ├── Makefile.arm │ ├── Makefile.pcie │ └── README.md │ └── py_ffmpeg_bmcv_sail │ └── README.md ├── samples ├── CMakeLists.txt ├── cpp │ ├── README.md │ ├── cls_resnet │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── cls_resnet_0.cpp │ │ ├── cls_resnet_1.cpp │ │ ├── cls_resnet_2.cpp │ │ ├── cls_resnet_3.cpp │ │ ├── getopt_win.c │ │ ├── getopt_win.h │ │ ├── processor.cpp │ │ └── processor.h │ ├── det_mtcnn │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── det_mtcnn.cpp │ │ ├── getopt_win.c │ │ ├── getopt_win.h │ │ ├── processor.cpp │ │ └── processor.h │ ├── det_ssd │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── cvdecoder.cpp │ │ ├── cvdecoder.h │ │ ├── det_ssd_0.cpp │ │ ├── det_ssd_1.cpp │ │ ├── det_ssd_2.cpp │ │ ├── det_ssd_3.cpp │ │ ├── det_ssd_4.cpp │ │ ├── getopt_win.c │ │ ├── getopt_win.h │ │ ├── processor.cpp │ │ └── processor.h │ └── det_yolov3 │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── det_yolov3_0.cpp │ │ ├── det_yolov3_1.cpp │ │ ├── frame_provider.cpp │ │ ├── frame_provider.h │ │ ├── getopt_win.c │ │ ├── getopt_win.h │ │ ├── processor.cpp │ │ └── processor.h └── python │ ├── README.md │ ├── cls_resnet │ ├── README.md │ ├── cls_resnet_0.py │ ├── cls_resnet_1.py │ ├── cls_resnet_2.py │ ├── cls_resnet_3.py │ └── processor.py │ ├── det_mtcnn │ ├── README.md │ ├── det_mtcnn.py │ └── processor.py │ ├── det_ssd │ ├── README.md │ ├── det_ssd_0.py │ ├── det_ssd_1.py │ └── det_ssd_2.py │ ├── det_yolov3 │ ├── README.md │ └── det_yolov3.py │ ├── multiprocess_detection │ ├── README │ ├── after_2_tensor.jpg │ ├── capture │ │ ├── Capture (copy).py │ │ ├── Capture.py │ │ └── __init__.py │ ├── detection │ │ ├── Makefile │ │ ├── RetinaDetector.py │ │ ├── __init__.py │ │ ├── lw-edge.zip │ │ └── rcnn │ │ │ ├── PY_OP │ │ │ ├── __init__.py │ │ │ ├── cascade_refine.py │ │ │ └── rpn_fpn_ohem3.py │ │ │ ├── __init__.py │ │ │ ├── core │ │ │ ├── __init__.py │ │ │ ├── callback.py │ │ │ ├── loader.py │ │ │ ├── metric.py │ │ │ ├── module.py │ │ │ ├── module_bak.py │ │ │ └── tester.py │ │ │ ├── cython │ │ │ ├── .gitignore │ │ │ ├── __init__.py │ │ │ ├── anchors.pyx │ │ │ ├── bbox.pyx │ │ │ ├── cpu_nms.pyx │ │ │ ├── gpu_nms.hpp │ │ │ ├── gpu_nms.pyx │ │ │ ├── nms_kernel.cu │ │ │ └── setup.py │ │ │ ├── dataset │ │ │ ├── __init__.py │ │ │ ├── ds_utils.py │ │ │ ├── imdb.py │ │ │ └── retinaface.py │ │ │ ├── io │ │ │ ├── __init__.py │ │ │ ├── image.py │ │ │ ├── rcnn.py │ │ │ └── rpn.py │ │ │ ├── logger.py │ │ │ ├── processing │ │ │ ├── __init__.py │ │ │ ├── assign_levels.py │ │ │ ├── bbox_regression.py │ │ │ ├── bbox_transform.py │ │ │ ├── generate_anchor.py │ │ │ └── nms.py │ │ │ ├── pycocotools │ │ │ ├── UPSTREAM_REV │ │ │ ├── __init__.py │ │ │ ├── _mask.c │ │ │ ├── _mask.pyx │ │ │ ├── coco.py │ │ │ ├── cocoeval.py │ │ │ ├── mask.py │ │ │ ├── maskApi.c │ │ │ ├── maskApi.h │ │ │ └── setup.py │ │ │ ├── sample_config.py │ │ │ ├── symbol │ │ │ ├── __init__.py │ │ │ ├── pyramidbox.py │ │ │ ├── symbol_common.py │ │ │ ├── symbol_common.py.bak │ │ │ ├── symbol_mnet.py │ │ │ ├── symbol_mnet.py.bak │ │ │ ├── symbol_resnet.py │ │ │ └── symbol_ssh.py │ │ │ ├── tools │ │ │ ├── __init__.py │ │ │ ├── reeval.py │ │ │ ├── test_rcnn.py │ │ │ ├── test_rpn.py │ │ │ ├── train_rcnn.py │ │ │ └── train_rpn.py │ │ │ └── utils │ │ │ ├── __init__.py │ │ │ ├── combine_model.py │ │ │ ├── load_data.py │ │ │ ├── load_model.py │ │ │ └── save_model.py │ ├── models │ │ ├── __init__.py │ │ └── compilation_cssd_32.bmodel │ ├── pack.py │ ├── predict │ │ ├── Predict.py │ │ └── __init__.py │ ├── requirements.txt │ ├── server.py │ ├── setup.py │ ├── sort │ │ └── __init__.py │ ├── upload.py │ ├── utils │ │ └── __init__.py │ └── websocket │ │ ├── index.html │ │ ├── pull_frame.py │ │ ├── redis_websocket_srv.py │ │ └── utils │ │ ├── logger.py │ │ └── redis_client.py │ └── multiprocess_detection_yolox │ ├── README │ ├── capture │ ├── Capture.py │ └── __init__.py │ ├── detection │ └── YoloX.py │ ├── models │ ├── __init__.py │ └── yolox_s_4_int8.bmodel │ ├── pack.py │ ├── requirements.txt │ ├── server.py │ ├── setup.py │ ├── upload.py │ ├── utils │ └── __init__.py │ └── websocket │ ├── index.html │ ├── pull_frame.py │ ├── redis_websocket_srv.py │ └── utils │ ├── logger.py │ └── redis_client.py ├── src ├── CMakeLists.txt ├── base64.cpp ├── bind.cpp ├── cvwrapper.cpp ├── engine.cpp ├── engine_multi.cpp ├── graph.cpp ├── internal.h ├── sail.pyi ├── tensor.cpp └── tools.cpp ├── toolchain-x86_64-linux.cmake └── tools ├── README.md ├── ci_test ├── gitlab_runner_config.toml_pcie ├── gitlab_runner_config.toml_soc ├── prepare_soc_test.sh ├── test_all_pcie.sh └── test_all_soc.sh ├── docker_build_all.sh ├── download.py ├── download_and_convert.py ├── envset_buildserver.sh ├── get_latest_release.sh ├── init_deps.sh ├── install.sh ├── quantization_model ├── release_bm1684.bat ├── release_bm1684.sh └── run_regression_bm1684.sh /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | docs/build/ 3 | sophon.egg-info/ 4 | dist/ 5 | *.pyc 6 | *.py[cod] 7 | python/sail.cpython-35m-x86_64-linux-gnu.so 8 | python/sophon/sail.cpython-35m-x86_64-linux-gnu.so 9 | __pycache__/ 10 | tests/data/ 11 | *.swp 12 | *.so 13 | out/ 14 | .vscode/ 15 | release/qa_test/sa5_tests/ 16 | cmake-build-debug/ 17 | 18 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/aarch64-linux-gnu/python3.6: -------------------------------------------------------------------------------- 1 | python3.6m -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python2.7/ast.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_AST_H 2 | #define Py_AST_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | PyAPI_FUNC(mod_ty) PyAST_FromNode(const node *, PyCompilerFlags *flags, 8 | const char *, PyArena *); 9 | 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | #endif /* !Py_AST_H */ 14 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python2.7/bitset.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef Py_BITSET_H 3 | #define Py_BITSET_H 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* Bitset interface */ 9 | 10 | #define BYTE char 11 | 12 | typedef BYTE *bitset; 13 | 14 | bitset newbitset(int nbits); 15 | void delbitset(bitset bs); 16 | #define testbit(ss, ibit) (((ss)[BIT2BYTE(ibit)] & BIT2MASK(ibit)) != 0) 17 | int addbit(bitset bs, int ibit); /* Returns 0 if already set */ 18 | int samebitset(bitset bs1, bitset bs2, int nbits); 19 | void mergebitset(bitset bs1, bitset bs2, int nbits); 20 | 21 | #define BITSPERBYTE (8*sizeof(BYTE)) 22 | #define NBYTES(nbits) (((nbits) + BITSPERBYTE - 1) / BITSPERBYTE) 23 | 24 | #define BIT2BYTE(ibit) ((ibit) / BITSPERBYTE) 25 | #define BIT2SHIFT(ibit) ((ibit) % BITSPERBYTE) 26 | #define BIT2MASK(ibit) (1 << BIT2SHIFT(ibit)) 27 | #define BYTE2BIT(ibyte) ((ibyte) * BITSPERBYTE) 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | #endif /* !Py_BITSET_H */ 33 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python2.7/boolobject.h: -------------------------------------------------------------------------------- 1 | /* Boolean object interface */ 2 | 3 | #ifndef Py_BOOLOBJECT_H 4 | #define Py_BOOLOBJECT_H 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | 10 | typedef PyIntObject PyBoolObject; 11 | 12 | PyAPI_DATA(PyTypeObject) PyBool_Type; 13 | 14 | #define PyBool_Check(x) (Py_TYPE(x) == &PyBool_Type) 15 | 16 | /* Py_False and Py_True are the only two bools in existence. 17 | Don't forget to apply Py_INCREF() when returning either!!! */ 18 | 19 | /* Don't use these directly */ 20 | PyAPI_DATA(PyIntObject) _Py_ZeroStruct, _Py_TrueStruct; 21 | 22 | /* Use these macros */ 23 | #define Py_False ((PyObject *) &_Py_ZeroStruct) 24 | #define Py_True ((PyObject *) &_Py_TrueStruct) 25 | 26 | /* Macros for returning Py_True or Py_False, respectively */ 27 | #define Py_RETURN_TRUE return Py_INCREF(Py_True), Py_True 28 | #define Py_RETURN_FALSE return Py_INCREF(Py_False), Py_False 29 | 30 | /* Function to return a bool from a C long */ 31 | PyAPI_FUNC(PyObject *) PyBool_FromLong(long); 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | #endif /* !Py_BOOLOBJECT_H */ 37 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python2.7/bufferobject.h: -------------------------------------------------------------------------------- 1 | 2 | /* Buffer object interface */ 3 | 4 | /* Note: the object's structure is private */ 5 | 6 | #ifndef Py_BUFFEROBJECT_H 7 | #define Py_BUFFEROBJECT_H 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | 13 | PyAPI_DATA(PyTypeObject) PyBuffer_Type; 14 | 15 | #define PyBuffer_Check(op) (Py_TYPE(op) == &PyBuffer_Type) 16 | 17 | #define Py_END_OF_BUFFER (-1) 18 | 19 | PyAPI_FUNC(PyObject *) PyBuffer_FromObject(PyObject *base, 20 | Py_ssize_t offset, Py_ssize_t size); 21 | PyAPI_FUNC(PyObject *) PyBuffer_FromReadWriteObject(PyObject *base, 22 | Py_ssize_t offset, 23 | Py_ssize_t size); 24 | 25 | PyAPI_FUNC(PyObject *) PyBuffer_FromMemory(void *ptr, Py_ssize_t size); 26 | PyAPI_FUNC(PyObject *) PyBuffer_FromReadWriteMemory(void *ptr, Py_ssize_t size); 27 | 28 | PyAPI_FUNC(PyObject *) PyBuffer_New(Py_ssize_t size); 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | #endif /* !Py_BUFFEROBJECT_H */ 34 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python2.7/cellobject.h: -------------------------------------------------------------------------------- 1 | /* Cell object interface */ 2 | 3 | #ifndef Py_CELLOBJECT_H 4 | #define Py_CELLOBJECT_H 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | typedef struct { 10 | PyObject_HEAD 11 | PyObject *ob_ref; /* Content of the cell or NULL when empty */ 12 | } PyCellObject; 13 | 14 | PyAPI_DATA(PyTypeObject) PyCell_Type; 15 | 16 | #define PyCell_Check(op) (Py_TYPE(op) == &PyCell_Type) 17 | 18 | PyAPI_FUNC(PyObject *) PyCell_New(PyObject *); 19 | PyAPI_FUNC(PyObject *) PyCell_Get(PyObject *); 20 | PyAPI_FUNC(int) PyCell_Set(PyObject *, PyObject *); 21 | 22 | #define PyCell_GET(op) (((PyCellObject *)(op))->ob_ref) 23 | #define PyCell_SET(op, v) (((PyCellObject *)(op))->ob_ref = v) 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | #endif /* !Py_TUPLEOBJECT_H */ 29 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python2.7/compile.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef Py_COMPILE_H 3 | #define Py_COMPILE_H 4 | 5 | #include "code.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | /* Public interface */ 12 | struct _node; /* Declare the existence of this type */ 13 | PyAPI_FUNC(PyCodeObject *) PyNode_Compile(struct _node *, const char *); 14 | 15 | /* Future feature support */ 16 | 17 | typedef struct { 18 | int ff_features; /* flags set by future statements */ 19 | int ff_lineno; /* line number of last future statement */ 20 | } PyFutureFeatures; 21 | 22 | #define FUTURE_NESTED_SCOPES "nested_scopes" 23 | #define FUTURE_GENERATORS "generators" 24 | #define FUTURE_DIVISION "division" 25 | #define FUTURE_ABSOLUTE_IMPORT "absolute_import" 26 | #define FUTURE_WITH_STATEMENT "with_statement" 27 | #define FUTURE_PRINT_FUNCTION "print_function" 28 | #define FUTURE_UNICODE_LITERALS "unicode_literals" 29 | 30 | 31 | struct _mod; /* Declare the existence of this type */ 32 | PyAPI_FUNC(PyCodeObject *) PyAST_Compile(struct _mod *, const char *, 33 | PyCompilerFlags *, PyArena *); 34 | PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromAST(struct _mod *, const char *); 35 | 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | #endif /* !Py_COMPILE_H */ 41 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python2.7/dtoa.h: -------------------------------------------------------------------------------- 1 | #ifndef PY_NO_SHORT_FLOAT_REPR 2 | #ifdef __cplusplus 3 | extern "C" { 4 | #endif 5 | 6 | PyAPI_FUNC(double) _Py_dg_strtod(const char *str, char **ptr); 7 | PyAPI_FUNC(char *) _Py_dg_dtoa(double d, int mode, int ndigits, 8 | int *decpt, int *sign, char **rve); 9 | PyAPI_FUNC(void) _Py_dg_freedtoa(char *s); 10 | 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | #endif 16 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python2.7/enumobject.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_ENUMOBJECT_H 2 | #define Py_ENUMOBJECT_H 3 | 4 | /* Enumerate Object */ 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | PyAPI_DATA(PyTypeObject) PyEnum_Type; 11 | PyAPI_DATA(PyTypeObject) PyReversed_Type; 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | #endif /* !Py_ENUMOBJECT_H */ 18 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python2.7/eval.h: -------------------------------------------------------------------------------- 1 | 2 | /* Interface to execute compiled code */ 3 | 4 | #ifndef Py_EVAL_H 5 | #define Py_EVAL_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | PyAPI_FUNC(PyObject *) PyEval_EvalCode(PyCodeObject *, PyObject *, PyObject *); 11 | 12 | PyAPI_FUNC(PyObject *) PyEval_EvalCodeEx(PyCodeObject *co, 13 | PyObject *globals, 14 | PyObject *locals, 15 | PyObject **args, int argc, 16 | PyObject **kwds, int kwdc, 17 | PyObject **defs, int defc, 18 | PyObject *closure); 19 | 20 | PyAPI_FUNC(PyObject *) _PyEval_CallTracing(PyObject *func, PyObject *args); 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | #endif /* !Py_EVAL_H */ 26 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python2.7/genobject.h: -------------------------------------------------------------------------------- 1 | 2 | /* Generator object interface */ 3 | 4 | #ifndef Py_GENOBJECT_H 5 | #define Py_GENOBJECT_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | struct _frame; /* Avoid including frameobject.h */ 11 | 12 | typedef struct { 13 | PyObject_HEAD 14 | /* The gi_ prefix is intended to remind of generator-iterator. */ 15 | 16 | /* Note: gi_frame can be NULL if the generator is "finished" */ 17 | struct _frame *gi_frame; 18 | 19 | /* True if generator is being executed. */ 20 | int gi_running; 21 | 22 | /* The code object backing the generator */ 23 | PyObject *gi_code; 24 | 25 | /* List of weak reference. */ 26 | PyObject *gi_weakreflist; 27 | } PyGenObject; 28 | 29 | PyAPI_DATA(PyTypeObject) PyGen_Type; 30 | 31 | #define PyGen_Check(op) PyObject_TypeCheck(op, &PyGen_Type) 32 | #define PyGen_CheckExact(op) (Py_TYPE(op) == &PyGen_Type) 33 | 34 | PyAPI_FUNC(PyObject *) PyGen_New(struct _frame *); 35 | PyAPI_FUNC(int) PyGen_NeedsFinalizing(PyGenObject *); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | #endif /* !Py_GENOBJECT_H */ 41 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python2.7/intrcheck.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef Py_INTRCHECK_H 3 | #define Py_INTRCHECK_H 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | PyAPI_FUNC(int) PyOS_InterruptOccurred(void); 9 | PyAPI_FUNC(void) PyOS_InitInterrupts(void); 10 | PyAPI_FUNC(void) PyOS_AfterFork(void); 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | #endif /* !Py_INTRCHECK_H */ 16 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python2.7/iterobject.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_ITEROBJECT_H 2 | #define Py_ITEROBJECT_H 3 | /* Iterators (the basic kind, over a sequence) */ 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | PyAPI_DATA(PyTypeObject) PySeqIter_Type; 9 | 10 | #define PySeqIter_Check(op) (Py_TYPE(op) == &PySeqIter_Type) 11 | 12 | PyAPI_FUNC(PyObject *) PySeqIter_New(PyObject *); 13 | 14 | PyAPI_DATA(PyTypeObject) PyCallIter_Type; 15 | 16 | #define PyCallIter_Check(op) (Py_TYPE(op) == &PyCallIter_Type) 17 | 18 | PyAPI_FUNC(PyObject *) PyCallIter_New(PyObject *, PyObject *); 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | #endif /* !Py_ITEROBJECT_H */ 23 | 24 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python2.7/marshal.h: -------------------------------------------------------------------------------- 1 | 2 | /* Interface for marshal.c */ 3 | 4 | #ifndef Py_MARSHAL_H 5 | #define Py_MARSHAL_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | #define Py_MARSHAL_VERSION 2 11 | 12 | PyAPI_FUNC(void) PyMarshal_WriteLongToFile(long, FILE *, int); 13 | PyAPI_FUNC(void) PyMarshal_WriteObjectToFile(PyObject *, FILE *, int); 14 | PyAPI_FUNC(PyObject *) PyMarshal_WriteObjectToString(PyObject *, int); 15 | 16 | PyAPI_FUNC(long) PyMarshal_ReadLongFromFile(FILE *); 17 | PyAPI_FUNC(int) PyMarshal_ReadShortFromFile(FILE *); 18 | PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromFile(FILE *); 19 | PyAPI_FUNC(PyObject *) PyMarshal_ReadLastObjectFromFile(FILE *); 20 | PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromString(char *, Py_ssize_t); 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | #endif /* !Py_MARSHAL_H */ 26 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python2.7/metagrammar.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_METAGRAMMAR_H 2 | #define Py_METAGRAMMAR_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | 8 | #define MSTART 256 9 | #define RULE 257 10 | #define RHS 258 11 | #define ALT 259 12 | #define ITEM 260 13 | #define ATOM 261 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | #endif /* !Py_METAGRAMMAR_H */ 19 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python2.7/moduleobject.h: -------------------------------------------------------------------------------- 1 | 2 | /* Module object interface */ 3 | 4 | #ifndef Py_MODULEOBJECT_H 5 | #define Py_MODULEOBJECT_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | PyAPI_DATA(PyTypeObject) PyModule_Type; 11 | 12 | #define PyModule_Check(op) PyObject_TypeCheck(op, &PyModule_Type) 13 | #define PyModule_CheckExact(op) (Py_TYPE(op) == &PyModule_Type) 14 | 15 | PyAPI_FUNC(PyObject *) PyModule_New(const char *); 16 | PyAPI_FUNC(PyObject *) PyModule_GetDict(PyObject *); 17 | PyAPI_FUNC(char *) PyModule_GetName(PyObject *); 18 | PyAPI_FUNC(char *) PyModule_GetFilename(PyObject *); 19 | PyAPI_FUNC(void) _PyModule_Clear(PyObject *); 20 | 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | #endif /* !Py_MODULEOBJECT_H */ 25 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python2.7/node.h: -------------------------------------------------------------------------------- 1 | 2 | /* Parse tree node interface */ 3 | 4 | #ifndef Py_NODE_H 5 | #define Py_NODE_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | typedef struct _node { 11 | short n_type; 12 | char *n_str; 13 | int n_lineno; 14 | int n_col_offset; 15 | int n_nchildren; 16 | struct _node *n_child; 17 | } node; 18 | 19 | PyAPI_FUNC(node *) PyNode_New(int type); 20 | PyAPI_FUNC(int) PyNode_AddChild(node *n, int type, 21 | char *str, int lineno, int col_offset); 22 | PyAPI_FUNC(void) PyNode_Free(node *n); 23 | PyAPI_FUNC(Py_ssize_t) _PyNode_SizeOf(node *n); 24 | 25 | /* Node access functions */ 26 | #define NCH(n) ((n)->n_nchildren) 27 | 28 | #define CHILD(n, i) (&(n)->n_child[i]) 29 | #define RCHILD(n, i) (CHILD(n, NCH(n) + i)) 30 | #define TYPE(n) ((n)->n_type) 31 | #define STR(n) ((n)->n_str) 32 | 33 | /* Assert that the type of a node is what we expect */ 34 | #define REQ(n, type) assert(TYPE(n) == (type)) 35 | 36 | PyAPI_FUNC(void) PyNode_ListTree(node *); 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | #endif /* !Py_NODE_H */ 42 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python2.7/numpy: -------------------------------------------------------------------------------- 1 | ../../lib/python2.7/dist-packages/numpy/core/include/numpy -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python2.7/pgen.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_PGEN_H 2 | #define Py_PGEN_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | 8 | /* Parser generator interface */ 9 | 10 | extern grammar *meta_grammar(void); 11 | 12 | struct _node; 13 | extern grammar *pgen(struct _node *); 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | #endif /* !Py_PGEN_H */ 19 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python2.7/pygetopt.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef Py_PYGETOPT_H 3 | #define Py_PYGETOPT_H 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | PyAPI_DATA(int) _PyOS_opterr; 9 | PyAPI_DATA(int) _PyOS_optind; 10 | PyAPI_DATA(char *) _PyOS_optarg; 11 | 12 | PyAPI_FUNC(void) _PyOS_ResetGetOpt(void); 13 | PyAPI_FUNC(int) _PyOS_GetOpt(int argc, char **argv, char *optstring); 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | #endif /* !Py_PYGETOPT_H */ 19 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python2.7/pystrcmp.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_STRCMP_H 2 | #define Py_STRCMP_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | PyAPI_FUNC(int) PyOS_mystrnicmp(const char *, const char *, Py_ssize_t); 9 | PyAPI_FUNC(int) PyOS_mystricmp(const char *, const char *); 10 | 11 | #if defined(MS_WINDOWS) || defined(PYOS_OS2) 12 | #define PyOS_strnicmp strnicmp 13 | #define PyOS_stricmp stricmp 14 | #else 15 | #define PyOS_strnicmp PyOS_mystrnicmp 16 | #define PyOS_stricmp PyOS_mystricmp 17 | #endif 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | #endif /* !Py_STRCMP_H */ 24 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python2.7/rangeobject.h: -------------------------------------------------------------------------------- 1 | 2 | /* Range object interface */ 3 | 4 | #ifndef Py_RANGEOBJECT_H 5 | #define Py_RANGEOBJECT_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | /* This is about the type 'xrange', not the built-in function range(), which 11 | returns regular lists. */ 12 | 13 | /* 14 | A range object represents an integer range. This is an immutable object; 15 | a range cannot change its value after creation. 16 | 17 | Range objects behave like the corresponding tuple objects except that 18 | they are represented by a start, stop, and step datamembers. 19 | */ 20 | 21 | PyAPI_DATA(PyTypeObject) PyRange_Type; 22 | 23 | #define PyRange_Check(op) (Py_TYPE(op) == &PyRange_Type) 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | #endif /* !Py_RANGEOBJECT_H */ 29 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python2.7/structseq.h: -------------------------------------------------------------------------------- 1 | 2 | /* Tuple object interface */ 3 | 4 | #ifndef Py_STRUCTSEQ_H 5 | #define Py_STRUCTSEQ_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | typedef struct PyStructSequence_Field { 11 | char *name; 12 | char *doc; 13 | } PyStructSequence_Field; 14 | 15 | typedef struct PyStructSequence_Desc { 16 | char *name; 17 | char *doc; 18 | struct PyStructSequence_Field *fields; 19 | int n_in_sequence; 20 | } PyStructSequence_Desc; 21 | 22 | extern char* PyStructSequence_UnnamedField; 23 | 24 | PyAPI_FUNC(void) PyStructSequence_InitType(PyTypeObject *type, 25 | PyStructSequence_Desc *desc); 26 | 27 | PyAPI_FUNC(PyObject *) PyStructSequence_New(PyTypeObject* type); 28 | 29 | typedef struct { 30 | PyObject_VAR_HEAD 31 | PyObject *ob_item[1]; 32 | } PyStructSequence; 33 | 34 | /* Macro, *only* to be used to fill in brand new objects */ 35 | #define PyStructSequence_SET_ITEM(op, i, v) \ 36 | (((PyStructSequence *)(op))->ob_item[i] = v) 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | #endif /* !Py_STRUCTSEQ_H */ 42 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python2.7/sysmodule.h: -------------------------------------------------------------------------------- 1 | 2 | /* System module interface */ 3 | 4 | #ifndef Py_SYSMODULE_H 5 | #define Py_SYSMODULE_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | PyAPI_FUNC(PyObject *) PySys_GetObject(char *); 11 | PyAPI_FUNC(int) PySys_SetObject(char *, PyObject *); 12 | PyAPI_FUNC(FILE *) PySys_GetFile(char *, FILE *); 13 | PyAPI_FUNC(void) PySys_SetArgv(int, char **); 14 | PyAPI_FUNC(void) PySys_SetArgvEx(int, char **, int); 15 | PyAPI_FUNC(void) PySys_SetPath(char *); 16 | 17 | PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...) 18 | Py_GCC_ATTRIBUTE((format(printf, 1, 2))); 19 | PyAPI_FUNC(void) PySys_WriteStderr(const char *format, ...) 20 | Py_GCC_ATTRIBUTE((format(printf, 1, 2))); 21 | 22 | PyAPI_FUNC(void) PySys_ResetWarnOptions(void); 23 | PyAPI_FUNC(void) PySys_AddWarnOption(char *); 24 | PyAPI_FUNC(int) PySys_HasWarnOptions(void); 25 | 26 | PyAPI_FUNC(size_t) _PySys_GetSizeOf(PyObject *); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | #endif /* !Py_SYSMODULE_H */ 32 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python2.7/timefuncs.h: -------------------------------------------------------------------------------- 1 | /* timefuncs.h 2 | */ 3 | 4 | /* Utility function related to timemodule.c. */ 5 | 6 | #ifndef TIMEFUNCS_H 7 | #define TIMEFUNCS_H 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | 13 | /* Cast double x to time_t, but raise ValueError if x is too large 14 | * to fit in a time_t. ValueError is set on return iff the return 15 | * value is (time_t)-1 and PyErr_Occurred(). 16 | */ 17 | PyAPI_FUNC(time_t) _PyTime_DoubleToTimet(double x); 18 | 19 | /* Get the current time since the epoch in seconds */ 20 | PyAPI_FUNC(double) _PyTime_FloatTime(void); 21 | 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | #endif /* TIMEFUNCS_H */ 27 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python2.7/traceback.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef Py_TRACEBACK_H 3 | #define Py_TRACEBACK_H 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | struct _frame; 9 | 10 | /* Traceback interface */ 11 | 12 | typedef struct _traceback { 13 | PyObject_HEAD 14 | struct _traceback *tb_next; 15 | struct _frame *tb_frame; 16 | int tb_lasti; 17 | int tb_lineno; 18 | } PyTracebackObject; 19 | 20 | PyAPI_FUNC(int) PyTraceBack_Here(struct _frame *); 21 | PyAPI_FUNC(int) PyTraceBack_Print(PyObject *, PyObject *); 22 | PyAPI_FUNC(int) _Py_DisplaySourceLine(PyObject *, const char *, int, int); 23 | 24 | /* Reveal traceback type so we can typecheck traceback objects */ 25 | PyAPI_DATA(PyTypeObject) PyTraceBack_Type; 26 | #define PyTraceBack_Check(v) (Py_TYPE(v) == &PyTraceBack_Type) 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | #endif /* !Py_TRACEBACK_H */ 32 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python2.7/ucnhash.h: -------------------------------------------------------------------------------- 1 | /* Unicode name database interface */ 2 | 3 | #ifndef Py_UCNHASH_H 4 | #define Py_UCNHASH_H 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | /* revised ucnhash CAPI interface (exported through a "wrapper") */ 10 | 11 | #define PyUnicodeData_CAPSULE_NAME "unicodedata.ucnhash_CAPI" 12 | 13 | typedef struct { 14 | 15 | /* Size of this struct */ 16 | int size; 17 | 18 | /* Get name for a given character code. Returns non-zero if 19 | success, zero if not. Does not set Python exceptions. 20 | If self is NULL, data come from the default version of the database. 21 | If it is not NULL, it should be a unicodedata.ucd_X_Y_Z object */ 22 | int (*getname)(PyObject *self, Py_UCS4 code, char* buffer, int buflen); 23 | 24 | /* Get character code for a given name. Same error handling 25 | as for getname. */ 26 | int (*getcode)(PyObject *self, const char* name, int namelen, Py_UCS4* code); 27 | 28 | } _PyUnicode_Name_CAPI; 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | #endif /* !Py_UCNHASH_H */ 34 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python2.7/warnings.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_WARNINGS_H 2 | #define Py_WARNINGS_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | PyAPI_FUNC(void) _PyWarnings_Init(void); 8 | 9 | PyAPI_FUNC(int) PyErr_WarnEx(PyObject *, const char *, Py_ssize_t); 10 | PyAPI_FUNC(int) PyErr_WarnExplicit(PyObject *, const char *, const char *, int, 11 | const char *, PyObject *); 12 | 13 | #define PyErr_WarnPy3k(msg, stacklevel) \ 14 | (Py_Py3kWarningFlag ? PyErr_WarnEx(PyExc_DeprecationWarning, msg, stacklevel) : 0) 15 | 16 | /* DEPRECATED: Use PyErr_WarnEx() instead. */ 17 | #define PyErr_Warn(category, msg) PyErr_WarnEx(category, msg, 1) 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | #endif /* !Py_WARNINGS_H */ 23 | 24 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.5: -------------------------------------------------------------------------------- 1 | python3.5m -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.5m/accu.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_LIMITED_API 2 | #ifndef Py_ACCU_H 3 | #define Py_ACCU_H 4 | 5 | /*** This is a private API for use by the interpreter and the stdlib. 6 | *** Its definition may be changed or removed at any moment. 7 | ***/ 8 | 9 | /* 10 | * A two-level accumulator of unicode objects that avoids both the overhead 11 | * of keeping a huge number of small separate objects, and the quadratic 12 | * behaviour of using a naive repeated concatenation scheme. 13 | */ 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | #undef small /* defined by some Windows headers */ 20 | 21 | typedef struct { 22 | PyObject *large; /* A list of previously accumulated large strings */ 23 | PyObject *small; /* Pending small strings */ 24 | } _PyAccu; 25 | 26 | PyAPI_FUNC(int) _PyAccu_Init(_PyAccu *acc); 27 | PyAPI_FUNC(int) _PyAccu_Accumulate(_PyAccu *acc, PyObject *unicode); 28 | PyAPI_FUNC(PyObject *) _PyAccu_FinishAsList(_PyAccu *acc); 29 | PyAPI_FUNC(PyObject *) _PyAccu_Finish(_PyAccu *acc); 30 | PyAPI_FUNC(void) _PyAccu_Destroy(_PyAccu *acc); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif /* Py_ACCU_H */ 37 | #endif /* Py_LIMITED_API */ 38 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.5m/ast.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_AST_H 2 | #define Py_AST_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | PyAPI_FUNC(int) PyAST_Validate(mod_ty); 8 | PyAPI_FUNC(mod_ty) PyAST_FromNode( 9 | const node *n, 10 | PyCompilerFlags *flags, 11 | const char *filename, /* decoded from the filesystem encoding */ 12 | PyArena *arena); 13 | PyAPI_FUNC(mod_ty) PyAST_FromNodeObject( 14 | const node *n, 15 | PyCompilerFlags *flags, 16 | PyObject *filename, 17 | PyArena *arena); 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | #endif /* !Py_AST_H */ 23 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.5m/bitset.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef Py_BITSET_H 3 | #define Py_BITSET_H 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* Bitset interface */ 9 | 10 | #define BYTE char 11 | 12 | typedef BYTE *bitset; 13 | 14 | bitset newbitset(int nbits); 15 | void delbitset(bitset bs); 16 | #define testbit(ss, ibit) (((ss)[BIT2BYTE(ibit)] & BIT2MASK(ibit)) != 0) 17 | int addbit(bitset bs, int ibit); /* Returns 0 if already set */ 18 | int samebitset(bitset bs1, bitset bs2, int nbits); 19 | void mergebitset(bitset bs1, bitset bs2, int nbits); 20 | 21 | #define BITSPERBYTE (8*sizeof(BYTE)) 22 | #define NBYTES(nbits) (((nbits) + BITSPERBYTE - 1) / BITSPERBYTE) 23 | 24 | #define BIT2BYTE(ibit) ((ibit) / BITSPERBYTE) 25 | #define BIT2SHIFT(ibit) ((ibit) % BITSPERBYTE) 26 | #define BIT2MASK(ibit) (1 << BIT2SHIFT(ibit)) 27 | #define BYTE2BIT(ibyte) ((ibyte) * BITSPERBYTE) 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | #endif /* !Py_BITSET_H */ 33 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.5m/bltinmodule.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_BLTINMODULE_H 2 | #define Py_BLTINMODULE_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | PyAPI_DATA(PyTypeObject) PyFilter_Type; 8 | PyAPI_DATA(PyTypeObject) PyMap_Type; 9 | PyAPI_DATA(PyTypeObject) PyZip_Type; 10 | 11 | #ifdef __cplusplus 12 | } 13 | #endif 14 | #endif /* !Py_BLTINMODULE_H */ 15 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.5m/boolobject.h: -------------------------------------------------------------------------------- 1 | /* Boolean object interface */ 2 | 3 | #ifndef Py_BOOLOBJECT_H 4 | #define Py_BOOLOBJECT_H 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | 10 | PyAPI_DATA(PyTypeObject) PyBool_Type; 11 | 12 | #define PyBool_Check(x) (Py_TYPE(x) == &PyBool_Type) 13 | 14 | /* Py_False and Py_True are the only two bools in existence. 15 | Don't forget to apply Py_INCREF() when returning either!!! */ 16 | 17 | /* Don't use these directly */ 18 | PyAPI_DATA(struct _longobject) _Py_FalseStruct, _Py_TrueStruct; 19 | 20 | /* Use these macros */ 21 | #define Py_False ((PyObject *) &_Py_FalseStruct) 22 | #define Py_True ((PyObject *) &_Py_TrueStruct) 23 | 24 | /* Macros for returning Py_True or Py_False, respectively */ 25 | #define Py_RETURN_TRUE return Py_INCREF(Py_True), Py_True 26 | #define Py_RETURN_FALSE return Py_INCREF(Py_False), Py_False 27 | 28 | /* Function to return a bool from a C long */ 29 | PyAPI_FUNC(PyObject *) PyBool_FromLong(long); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | #endif /* !Py_BOOLOBJECT_H */ 35 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.5m/cellobject.h: -------------------------------------------------------------------------------- 1 | /* Cell object interface */ 2 | #ifndef Py_LIMITED_API 3 | #ifndef Py_CELLOBJECT_H 4 | #define Py_CELLOBJECT_H 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | typedef struct { 10 | PyObject_HEAD 11 | PyObject *ob_ref; /* Content of the cell or NULL when empty */ 12 | } PyCellObject; 13 | 14 | PyAPI_DATA(PyTypeObject) PyCell_Type; 15 | 16 | #define PyCell_Check(op) (Py_TYPE(op) == &PyCell_Type) 17 | 18 | PyAPI_FUNC(PyObject *) PyCell_New(PyObject *); 19 | PyAPI_FUNC(PyObject *) PyCell_Get(PyObject *); 20 | PyAPI_FUNC(int) PyCell_Set(PyObject *, PyObject *); 21 | 22 | #define PyCell_GET(op) (((PyCellObject *)(op))->ob_ref) 23 | #define PyCell_SET(op, v) (((PyCellObject *)(op))->ob_ref = v) 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | #endif /* !Py_TUPLEOBJECT_H */ 29 | #endif /* Py_LIMITED_API */ 30 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.5m/dtoa.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_LIMITED_API 2 | #ifndef PY_NO_SHORT_FLOAT_REPR 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | PyAPI_FUNC(double) _Py_dg_strtod(const char *str, char **ptr); 8 | PyAPI_FUNC(char *) _Py_dg_dtoa(double d, int mode, int ndigits, 9 | int *decpt, int *sign, char **rve); 10 | PyAPI_FUNC(void) _Py_dg_freedtoa(char *s); 11 | PyAPI_FUNC(double) _Py_dg_stdnan(int sign); 12 | PyAPI_FUNC(double) _Py_dg_infinity(int sign); 13 | 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | #endif 19 | #endif 20 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.5m/enumobject.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_ENUMOBJECT_H 2 | #define Py_ENUMOBJECT_H 3 | 4 | /* Enumerate Object */ 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | PyAPI_DATA(PyTypeObject) PyEnum_Type; 11 | PyAPI_DATA(PyTypeObject) PyReversed_Type; 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | #endif /* !Py_ENUMOBJECT_H */ 18 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.5m/eval.h: -------------------------------------------------------------------------------- 1 | 2 | /* Interface to execute compiled code */ 3 | 4 | #ifndef Py_EVAL_H 5 | #define Py_EVAL_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | PyAPI_FUNC(PyObject *) PyEval_EvalCode(PyObject *, PyObject *, PyObject *); 11 | 12 | PyAPI_FUNC(PyObject *) PyEval_EvalCodeEx(PyObject *co, 13 | PyObject *globals, 14 | PyObject *locals, 15 | PyObject **args, int argc, 16 | PyObject **kwds, int kwdc, 17 | PyObject **defs, int defc, 18 | PyObject *kwdefs, PyObject *closure); 19 | 20 | #ifndef Py_LIMITED_API 21 | PyAPI_FUNC(PyObject *) _PyEval_CallTracing(PyObject *func, PyObject *args); 22 | #endif 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | #endif /* !Py_EVAL_H */ 28 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.5m/intrcheck.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef Py_INTRCHECK_H 3 | #define Py_INTRCHECK_H 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | PyAPI_FUNC(int) PyOS_InterruptOccurred(void); 9 | PyAPI_FUNC(void) PyOS_InitInterrupts(void); 10 | PyAPI_FUNC(void) PyOS_AfterFork(void); 11 | PyAPI_FUNC(int) _PyOS_IsMainThread(void); 12 | 13 | #ifdef MS_WINDOWS 14 | /* windows.h is not included by Python.h so use void* instead of HANDLE */ 15 | PyAPI_FUNC(void*) _PyOS_SigintEvent(void); 16 | #endif 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | #endif /* !Py_INTRCHECK_H */ 22 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.5m/iterobject.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_ITEROBJECT_H 2 | #define Py_ITEROBJECT_H 3 | /* Iterators (the basic kind, over a sequence) */ 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | PyAPI_DATA(PyTypeObject) PySeqIter_Type; 9 | PyAPI_DATA(PyTypeObject) PyCallIter_Type; 10 | PyAPI_DATA(PyTypeObject) PyCmpWrapper_Type; 11 | 12 | #define PySeqIter_Check(op) (Py_TYPE(op) == &PySeqIter_Type) 13 | 14 | PyAPI_FUNC(PyObject *) PySeqIter_New(PyObject *); 15 | 16 | 17 | #define PyCallIter_Check(op) (Py_TYPE(op) == &PyCallIter_Type) 18 | 19 | PyAPI_FUNC(PyObject *) PyCallIter_New(PyObject *, PyObject *); 20 | 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | #endif /* !Py_ITEROBJECT_H */ 25 | 26 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.5m/marshal.h: -------------------------------------------------------------------------------- 1 | 2 | /* Interface for marshal.c */ 3 | 4 | #ifndef Py_MARSHAL_H 5 | #define Py_MARSHAL_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | #define Py_MARSHAL_VERSION 4 11 | 12 | PyAPI_FUNC(void) PyMarshal_WriteLongToFile(long, FILE *, int); 13 | PyAPI_FUNC(void) PyMarshal_WriteObjectToFile(PyObject *, FILE *, int); 14 | PyAPI_FUNC(PyObject *) PyMarshal_WriteObjectToString(PyObject *, int); 15 | 16 | #ifndef Py_LIMITED_API 17 | PyAPI_FUNC(long) PyMarshal_ReadLongFromFile(FILE *); 18 | PyAPI_FUNC(int) PyMarshal_ReadShortFromFile(FILE *); 19 | PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromFile(FILE *); 20 | PyAPI_FUNC(PyObject *) PyMarshal_ReadLastObjectFromFile(FILE *); 21 | #endif 22 | PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromString(const char *, 23 | Py_ssize_t); 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | #endif /* !Py_MARSHAL_H */ 29 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.5m/metagrammar.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_METAGRAMMAR_H 2 | #define Py_METAGRAMMAR_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | 8 | #define MSTART 256 9 | #define RULE 257 10 | #define RHS 258 11 | #define ALT 259 12 | #define ITEM 260 13 | #define ATOM 261 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | #endif /* !Py_METAGRAMMAR_H */ 19 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.5m/namespaceobject.h: -------------------------------------------------------------------------------- 1 | 2 | /* simple namespace object interface */ 3 | 4 | #ifndef NAMESPACEOBJECT_H 5 | #define NAMESPACEOBJECT_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | PyAPI_DATA(PyTypeObject) _PyNamespace_Type; 11 | 12 | PyAPI_FUNC(PyObject *) _PyNamespace_New(PyObject *kwds); 13 | 14 | #ifdef __cplusplus 15 | } 16 | #endif 17 | #endif /* !NAMESPACEOBJECT_H */ 18 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.5m/node.h: -------------------------------------------------------------------------------- 1 | 2 | /* Parse tree node interface */ 3 | 4 | #ifndef Py_NODE_H 5 | #define Py_NODE_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | typedef struct _node { 11 | short n_type; 12 | char *n_str; 13 | int n_lineno; 14 | int n_col_offset; 15 | int n_nchildren; 16 | struct _node *n_child; 17 | } node; 18 | 19 | PyAPI_FUNC(node *) PyNode_New(int type); 20 | PyAPI_FUNC(int) PyNode_AddChild(node *n, int type, 21 | char *str, int lineno, int col_offset); 22 | PyAPI_FUNC(void) PyNode_Free(node *n); 23 | #ifndef Py_LIMITED_API 24 | PyAPI_FUNC(Py_ssize_t) _PyNode_SizeOf(node *n); 25 | #endif 26 | 27 | /* Node access functions */ 28 | #define NCH(n) ((n)->n_nchildren) 29 | 30 | #define CHILD(n, i) (&(n)->n_child[i]) 31 | #define RCHILD(n, i) (CHILD(n, NCH(n) + i)) 32 | #define TYPE(n) ((n)->n_type) 33 | #define STR(n) ((n)->n_str) 34 | #define LINENO(n) ((n)->n_lineno) 35 | 36 | /* Assert that the type of a node is what we expect */ 37 | #define REQ(n, type) assert(TYPE(n) == (type)) 38 | 39 | PyAPI_FUNC(void) PyNode_ListTree(node *); 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | #endif /* !Py_NODE_H */ 45 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.5m/numpy/_numpyconfig.h: -------------------------------------------------------------------------------- 1 | #define NPY_HAVE_ENDIAN_H 1 2 | #define NPY_SIZEOF_SHORT SIZEOF_SHORT 3 | #define NPY_SIZEOF_INT SIZEOF_INT 4 | #define NPY_SIZEOF_LONG SIZEOF_LONG 5 | #define NPY_SIZEOF_FLOAT 4 6 | #define NPY_SIZEOF_COMPLEX_FLOAT 8 7 | #define NPY_SIZEOF_DOUBLE 8 8 | #define NPY_SIZEOF_COMPLEX_DOUBLE 16 9 | #define NPY_SIZEOF_LONGDOUBLE 16 10 | #define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32 11 | #define NPY_SIZEOF_PY_INTPTR_T 8 12 | #define NPY_SIZEOF_OFF_T 8 13 | #define NPY_SIZEOF_PY_LONG_LONG 8 14 | #define NPY_SIZEOF_LONGLONG 8 15 | #define NPY_NO_SMP 0 16 | #define NPY_HAVE_DECL_ISNAN 17 | #define NPY_HAVE_DECL_ISINF 18 | #define NPY_HAVE_DECL_ISFINITE 19 | #define NPY_HAVE_DECL_SIGNBIT 20 | #define NPY_USE_C99_COMPLEX 1 21 | #define NPY_HAVE_COMPLEX_DOUBLE 1 22 | #define NPY_HAVE_COMPLEX_FLOAT 1 23 | #define NPY_HAVE_COMPLEX_LONG_DOUBLE 1 24 | #define NPY_RELAXED_STRIDES_CHECKING 1 25 | #define NPY_USE_C99_FORMATS 1 26 | #define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden"))) 27 | #define NPY_ABI_VERSION 0x01000009 28 | #define NPY_API_VERSION 0x0000000A 29 | 30 | #ifndef __STDC_FORMAT_MACROS 31 | #define __STDC_FORMAT_MACROS 1 32 | #endif 33 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.5m/numpy/arrayobject.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_ARRAYOBJECT_H 2 | #define Py_ARRAYOBJECT_H 3 | 4 | #include "ndarrayobject.h" 5 | #include "npy_interrupt.h" 6 | 7 | #ifdef NPY_NO_PREFIX 8 | #include "noprefix.h" 9 | #endif 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.5m/numpy/npy_no_deprecated_api.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This include file is provided for inclusion in Cython *.pyd files where 3 | * one would like to define the NPY_NO_DEPRECATED_API macro. It can be 4 | * included by 5 | * 6 | * cdef extern from "npy_no_deprecated_api.h": pass 7 | * 8 | */ 9 | #ifndef NPY_NO_DEPRECATED_API 10 | 11 | /* put this check here since there may be multiple includes in C extensions. */ 12 | #if defined(NDARRAYTYPES_H) || defined(_NPY_DEPRECATED_API_H) || \ 13 | defined(OLD_DEFINES_H) 14 | #error "npy_no_deprecated_api.h" must be first among numpy includes. 15 | #else 16 | #define NPY_NO_DEPRECATED_API NPY_API_VERSION 17 | #endif 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.5m/numpy/npy_os.h: -------------------------------------------------------------------------------- 1 | #ifndef _NPY_OS_H_ 2 | #define _NPY_OS_H_ 3 | 4 | #if defined(linux) || defined(__linux) || defined(__linux__) 5 | #define NPY_OS_LINUX 6 | #elif defined(__FreeBSD__) || defined(__NetBSD__) || \ 7 | defined(__OpenBSD__) || defined(__DragonFly__) 8 | #define NPY_OS_BSD 9 | #ifdef __FreeBSD__ 10 | #define NPY_OS_FREEBSD 11 | #elif defined(__NetBSD__) 12 | #define NPY_OS_NETBSD 13 | #elif defined(__OpenBSD__) 14 | #define NPY_OS_OPENBSD 15 | #elif defined(__DragonFly__) 16 | #define NPY_OS_DRAGONFLY 17 | #endif 18 | #elif defined(sun) || defined(__sun) 19 | #define NPY_OS_SOLARIS 20 | #elif defined(__CYGWIN__) 21 | #define NPY_OS_CYGWIN 22 | #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) 23 | #define NPY_OS_WIN32 24 | #elif defined(__APPLE__) 25 | #define NPY_OS_DARWIN 26 | #else 27 | #define NPY_OS_UNKNOWN 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.5m/numpy/oldnumeric.h: -------------------------------------------------------------------------------- 1 | #include "arrayobject.h" 2 | 3 | #ifndef PYPY_VERSION 4 | #ifndef REFCOUNT 5 | # define REFCOUNT NPY_REFCOUNT 6 | # define MAX_ELSIZE 16 7 | #endif 8 | #endif 9 | 10 | #define PyArray_UNSIGNED_TYPES 11 | #define PyArray_SBYTE NPY_BYTE 12 | #define PyArray_CopyArray PyArray_CopyInto 13 | #define _PyArray_multiply_list PyArray_MultiplyIntList 14 | #define PyArray_ISSPACESAVER(m) NPY_FALSE 15 | #define PyScalarArray_Check PyArray_CheckScalar 16 | 17 | #define CONTIGUOUS NPY_CONTIGUOUS 18 | #define OWN_DIMENSIONS 0 19 | #define OWN_STRIDES 0 20 | #define OWN_DATA NPY_OWNDATA 21 | #define SAVESPACE 0 22 | #define SAVESPACEBIT 0 23 | 24 | #undef import_array 25 | #define import_array() { if (_import_array() < 0) {PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import"); } } 26 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.5m/numpy/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef __NUMPY_UTILS_HEADER__ 2 | #define __NUMPY_UTILS_HEADER__ 3 | 4 | #ifndef __COMP_NPY_UNUSED 5 | #if defined(__GNUC__) 6 | #define __COMP_NPY_UNUSED __attribute__ ((__unused__)) 7 | # elif defined(__ICC) 8 | #define __COMP_NPY_UNUSED __attribute__ ((__unused__)) 9 | #else 10 | #define __COMP_NPY_UNUSED 11 | #endif 12 | #endif 13 | 14 | /* Use this to tag a variable as not used. It will remove unused variable 15 | * warning on support platforms (see __COM_NPY_UNUSED) and mangle the variable 16 | * to avoid accidental use */ 17 | #define NPY_UNUSED(x) (__NPY_UNUSED_TAGGED ## x) __COMP_NPY_UNUSED 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.5m/osdefs.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_OSDEFS_H 2 | #define Py_OSDEFS_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | 8 | /* Operating system dependencies */ 9 | 10 | #ifdef MS_WINDOWS 11 | #define SEP L'\\' 12 | #define ALTSEP L'/' 13 | #define MAXPATHLEN 256 14 | #define DELIM L';' 15 | #endif 16 | 17 | /* Filename separator */ 18 | #ifndef SEP 19 | #define SEP L'/' 20 | #endif 21 | 22 | /* Max pathname length */ 23 | #ifdef __hpux 24 | #include 25 | #include 26 | #ifndef PATH_MAX 27 | #define PATH_MAX MAXPATHLEN 28 | #endif 29 | #endif 30 | 31 | #ifndef MAXPATHLEN 32 | #if defined(PATH_MAX) && PATH_MAX > 1024 33 | #define MAXPATHLEN PATH_MAX 34 | #else 35 | #define MAXPATHLEN 1024 36 | #endif 37 | #endif 38 | 39 | /* Search path entry delimiter */ 40 | #ifndef DELIM 41 | #define DELIM L':' 42 | #endif 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | #endif /* !Py_OSDEFS_H */ 48 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.5m/pgen.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_PGEN_H 2 | #define Py_PGEN_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | 8 | /* Parser generator interface */ 9 | 10 | extern grammar *meta_grammar(void); 11 | 12 | struct _node; 13 | extern grammar *pgen(struct _node *); 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | #endif /* !Py_PGEN_H */ 19 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.5m/pygetopt.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef Py_PYGETOPT_H 3 | #define Py_PYGETOPT_H 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #ifndef Py_LIMITED_API 9 | PyAPI_DATA(int) _PyOS_opterr; 10 | PyAPI_DATA(int) _PyOS_optind; 11 | PyAPI_DATA(wchar_t *) _PyOS_optarg; 12 | 13 | PyAPI_FUNC(void) _PyOS_ResetGetOpt(void); 14 | #endif 15 | 16 | PyAPI_FUNC(int) _PyOS_GetOpt(int argc, wchar_t **argv, wchar_t *optstring); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | #endif /* !Py_PYGETOPT_H */ 22 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.5m/pystrcmp.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_STRCMP_H 2 | #define Py_STRCMP_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | PyAPI_FUNC(int) PyOS_mystrnicmp(const char *, const char *, Py_ssize_t); 9 | PyAPI_FUNC(int) PyOS_mystricmp(const char *, const char *); 10 | 11 | #ifdef MS_WINDOWS 12 | #define PyOS_strnicmp strnicmp 13 | #define PyOS_stricmp stricmp 14 | #else 15 | #define PyOS_strnicmp PyOS_mystrnicmp 16 | #define PyOS_stricmp PyOS_mystricmp 17 | #endif 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | #endif /* !Py_STRCMP_H */ 24 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.5m/pystrhex.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_STRHEX_H 2 | #define Py_STRHEX_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* Returns a str() containing the hex representation of argbuf. */ 9 | PyAPI_FUNC(PyObject*) _Py_strhex(const char* argbuf, const Py_ssize_t arglen); 10 | /* Returns a bytes() containing the ASCII hex representation of argbuf. */ 11 | PyAPI_FUNC(PyObject*) _Py_strhex_bytes(const char* argbuf, const Py_ssize_t arglen); 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | #endif /* !Py_STRHEX_H */ 18 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.5m/rangeobject.h: -------------------------------------------------------------------------------- 1 | 2 | /* Range object interface */ 3 | 4 | #ifndef Py_RANGEOBJECT_H 5 | #define Py_RANGEOBJECT_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | /* 11 | A range object represents an integer range. This is an immutable object; 12 | a range cannot change its value after creation. 13 | 14 | Range objects behave like the corresponding tuple objects except that 15 | they are represented by a start, stop, and step datamembers. 16 | */ 17 | 18 | PyAPI_DATA(PyTypeObject) PyRange_Type; 19 | PyAPI_DATA(PyTypeObject) PyRangeIter_Type; 20 | PyAPI_DATA(PyTypeObject) PyLongRangeIter_Type; 21 | 22 | #define PyRange_Check(op) (Py_TYPE(op) == &PyRange_Type) 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | #endif /* !Py_RANGEOBJECT_H */ 28 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.5m/ucnhash.h: -------------------------------------------------------------------------------- 1 | /* Unicode name database interface */ 2 | #ifndef Py_LIMITED_API 3 | #ifndef Py_UCNHASH_H 4 | #define Py_UCNHASH_H 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | /* revised ucnhash CAPI interface (exported through a "wrapper") */ 10 | 11 | #define PyUnicodeData_CAPSULE_NAME "unicodedata.ucnhash_CAPI" 12 | 13 | typedef struct { 14 | 15 | /* Size of this struct */ 16 | int size; 17 | 18 | /* Get name for a given character code. Returns non-zero if 19 | success, zero if not. Does not set Python exceptions. 20 | If self is NULL, data come from the default version of the database. 21 | If it is not NULL, it should be a unicodedata.ucd_X_Y_Z object */ 22 | int (*getname)(PyObject *self, Py_UCS4 code, char* buffer, int buflen, 23 | int with_alias_and_seq); 24 | 25 | /* Get character code for a given name. Same error handling 26 | as for getname. */ 27 | int (*getcode)(PyObject *self, const char* name, int namelen, Py_UCS4* code, 28 | int with_named_seq); 29 | 30 | } _PyUnicode_Name_CAPI; 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | #endif /* !Py_UCNHASH_H */ 36 | #endif /* !Py_LIMITED_API */ 37 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.6: -------------------------------------------------------------------------------- 1 | python3.6m -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.6m/accu.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_LIMITED_API 2 | #ifndef Py_ACCU_H 3 | #define Py_ACCU_H 4 | 5 | /*** This is a private API for use by the interpreter and the stdlib. 6 | *** Its definition may be changed or removed at any moment. 7 | ***/ 8 | 9 | /* 10 | * A two-level accumulator of unicode objects that avoids both the overhead 11 | * of keeping a huge number of small separate objects, and the quadratic 12 | * behaviour of using a naive repeated concatenation scheme. 13 | */ 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | #undef small /* defined by some Windows headers */ 20 | 21 | typedef struct { 22 | PyObject *large; /* A list of previously accumulated large strings */ 23 | PyObject *small; /* Pending small strings */ 24 | } _PyAccu; 25 | 26 | PyAPI_FUNC(int) _PyAccu_Init(_PyAccu *acc); 27 | PyAPI_FUNC(int) _PyAccu_Accumulate(_PyAccu *acc, PyObject *unicode); 28 | PyAPI_FUNC(PyObject *) _PyAccu_FinishAsList(_PyAccu *acc); 29 | PyAPI_FUNC(PyObject *) _PyAccu_Finish(_PyAccu *acc); 30 | PyAPI_FUNC(void) _PyAccu_Destroy(_PyAccu *acc); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif /* Py_ACCU_H */ 37 | #endif /* Py_LIMITED_API */ 38 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.6m/ast.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_AST_H 2 | #define Py_AST_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | PyAPI_FUNC(int) PyAST_Validate(mod_ty); 8 | PyAPI_FUNC(mod_ty) PyAST_FromNode( 9 | const node *n, 10 | PyCompilerFlags *flags, 11 | const char *filename, /* decoded from the filesystem encoding */ 12 | PyArena *arena); 13 | PyAPI_FUNC(mod_ty) PyAST_FromNodeObject( 14 | const node *n, 15 | PyCompilerFlags *flags, 16 | PyObject *filename, 17 | PyArena *arena); 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | #endif /* !Py_AST_H */ 23 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.6m/bitset.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef Py_BITSET_H 3 | #define Py_BITSET_H 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* Bitset interface */ 9 | 10 | #define BYTE char 11 | 12 | typedef BYTE *bitset; 13 | 14 | bitset newbitset(int nbits); 15 | void delbitset(bitset bs); 16 | #define testbit(ss, ibit) (((ss)[BIT2BYTE(ibit)] & BIT2MASK(ibit)) != 0) 17 | int addbit(bitset bs, int ibit); /* Returns 0 if already set */ 18 | int samebitset(bitset bs1, bitset bs2, int nbits); 19 | void mergebitset(bitset bs1, bitset bs2, int nbits); 20 | 21 | #define BITSPERBYTE (8*sizeof(BYTE)) 22 | #define NBYTES(nbits) (((nbits) + BITSPERBYTE - 1) / BITSPERBYTE) 23 | 24 | #define BIT2BYTE(ibit) ((ibit) / BITSPERBYTE) 25 | #define BIT2SHIFT(ibit) ((ibit) % BITSPERBYTE) 26 | #define BIT2MASK(ibit) (1 << BIT2SHIFT(ibit)) 27 | #define BYTE2BIT(ibyte) ((ibyte) * BITSPERBYTE) 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | #endif /* !Py_BITSET_H */ 33 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.6m/bltinmodule.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_BLTINMODULE_H 2 | #define Py_BLTINMODULE_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | PyAPI_DATA(PyTypeObject) PyFilter_Type; 8 | PyAPI_DATA(PyTypeObject) PyMap_Type; 9 | PyAPI_DATA(PyTypeObject) PyZip_Type; 10 | 11 | #ifdef __cplusplus 12 | } 13 | #endif 14 | #endif /* !Py_BLTINMODULE_H */ 15 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.6m/boolobject.h: -------------------------------------------------------------------------------- 1 | /* Boolean object interface */ 2 | 3 | #ifndef Py_BOOLOBJECT_H 4 | #define Py_BOOLOBJECT_H 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | 10 | PyAPI_DATA(PyTypeObject) PyBool_Type; 11 | 12 | #define PyBool_Check(x) (Py_TYPE(x) == &PyBool_Type) 13 | 14 | /* Py_False and Py_True are the only two bools in existence. 15 | Don't forget to apply Py_INCREF() when returning either!!! */ 16 | 17 | /* Don't use these directly */ 18 | PyAPI_DATA(struct _longobject) _Py_FalseStruct, _Py_TrueStruct; 19 | 20 | /* Use these macros */ 21 | #define Py_False ((PyObject *) &_Py_FalseStruct) 22 | #define Py_True ((PyObject *) &_Py_TrueStruct) 23 | 24 | /* Macros for returning Py_True or Py_False, respectively */ 25 | #define Py_RETURN_TRUE return Py_INCREF(Py_True), Py_True 26 | #define Py_RETURN_FALSE return Py_INCREF(Py_False), Py_False 27 | 28 | /* Function to return a bool from a C long */ 29 | PyAPI_FUNC(PyObject *) PyBool_FromLong(long); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | #endif /* !Py_BOOLOBJECT_H */ 35 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.6m/cellobject.h: -------------------------------------------------------------------------------- 1 | /* Cell object interface */ 2 | #ifndef Py_LIMITED_API 3 | #ifndef Py_CELLOBJECT_H 4 | #define Py_CELLOBJECT_H 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | typedef struct { 10 | PyObject_HEAD 11 | PyObject *ob_ref; /* Content of the cell or NULL when empty */ 12 | } PyCellObject; 13 | 14 | PyAPI_DATA(PyTypeObject) PyCell_Type; 15 | 16 | #define PyCell_Check(op) (Py_TYPE(op) == &PyCell_Type) 17 | 18 | PyAPI_FUNC(PyObject *) PyCell_New(PyObject *); 19 | PyAPI_FUNC(PyObject *) PyCell_Get(PyObject *); 20 | PyAPI_FUNC(int) PyCell_Set(PyObject *, PyObject *); 21 | 22 | #define PyCell_GET(op) (((PyCellObject *)(op))->ob_ref) 23 | #define PyCell_SET(op, v) (((PyCellObject *)(op))->ob_ref = v) 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | #endif /* !Py_TUPLEOBJECT_H */ 29 | #endif /* Py_LIMITED_API */ 30 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.6m/dtoa.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_LIMITED_API 2 | #ifndef PY_NO_SHORT_FLOAT_REPR 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | PyAPI_FUNC(double) _Py_dg_strtod(const char *str, char **ptr); 8 | PyAPI_FUNC(char *) _Py_dg_dtoa(double d, int mode, int ndigits, 9 | int *decpt, int *sign, char **rve); 10 | PyAPI_FUNC(void) _Py_dg_freedtoa(char *s); 11 | PyAPI_FUNC(double) _Py_dg_stdnan(int sign); 12 | PyAPI_FUNC(double) _Py_dg_infinity(int sign); 13 | 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | #endif 19 | #endif 20 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.6m/enumobject.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_ENUMOBJECT_H 2 | #define Py_ENUMOBJECT_H 3 | 4 | /* Enumerate Object */ 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | PyAPI_DATA(PyTypeObject) PyEnum_Type; 11 | PyAPI_DATA(PyTypeObject) PyReversed_Type; 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | #endif /* !Py_ENUMOBJECT_H */ 18 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.6m/eval.h: -------------------------------------------------------------------------------- 1 | 2 | /* Interface to execute compiled code */ 3 | 4 | #ifndef Py_EVAL_H 5 | #define Py_EVAL_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | PyAPI_FUNC(PyObject *) PyEval_EvalCode(PyObject *, PyObject *, PyObject *); 11 | 12 | PyAPI_FUNC(PyObject *) PyEval_EvalCodeEx(PyObject *co, 13 | PyObject *globals, 14 | PyObject *locals, 15 | PyObject **args, int argc, 16 | PyObject **kwds, int kwdc, 17 | PyObject **defs, int defc, 18 | PyObject *kwdefs, PyObject *closure); 19 | 20 | #ifndef Py_LIMITED_API 21 | PyAPI_FUNC(PyObject *) _PyEval_CallTracing(PyObject *func, PyObject *args); 22 | #endif 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | #endif /* !Py_EVAL_H */ 28 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.6m/intrcheck.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef Py_INTRCHECK_H 3 | #define Py_INTRCHECK_H 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | PyAPI_FUNC(int) PyOS_InterruptOccurred(void); 9 | PyAPI_FUNC(void) PyOS_InitInterrupts(void); 10 | PyAPI_FUNC(void) PyOS_AfterFork(void); 11 | 12 | #ifndef Py_LIMITED_API 13 | PyAPI_FUNC(int) _PyOS_IsMainThread(void); 14 | 15 | #ifdef MS_WINDOWS 16 | /* windows.h is not included by Python.h so use void* instead of HANDLE */ 17 | PyAPI_FUNC(void*) _PyOS_SigintEvent(void); 18 | #endif 19 | #endif /* !Py_LIMITED_API */ 20 | 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | #endif /* !Py_INTRCHECK_H */ 25 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.6m/iterobject.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_ITEROBJECT_H 2 | #define Py_ITEROBJECT_H 3 | /* Iterators (the basic kind, over a sequence) */ 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | PyAPI_DATA(PyTypeObject) PySeqIter_Type; 9 | PyAPI_DATA(PyTypeObject) PyCallIter_Type; 10 | PyAPI_DATA(PyTypeObject) PyCmpWrapper_Type; 11 | 12 | #define PySeqIter_Check(op) (Py_TYPE(op) == &PySeqIter_Type) 13 | 14 | PyAPI_FUNC(PyObject *) PySeqIter_New(PyObject *); 15 | 16 | 17 | #define PyCallIter_Check(op) (Py_TYPE(op) == &PyCallIter_Type) 18 | 19 | PyAPI_FUNC(PyObject *) PyCallIter_New(PyObject *, PyObject *); 20 | 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | #endif /* !Py_ITEROBJECT_H */ 25 | 26 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.6m/marshal.h: -------------------------------------------------------------------------------- 1 | 2 | /* Interface for marshal.c */ 3 | 4 | #ifndef Py_MARSHAL_H 5 | #define Py_MARSHAL_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | #define Py_MARSHAL_VERSION 4 11 | 12 | PyAPI_FUNC(void) PyMarshal_WriteLongToFile(long, FILE *, int); 13 | PyAPI_FUNC(void) PyMarshal_WriteObjectToFile(PyObject *, FILE *, int); 14 | PyAPI_FUNC(PyObject *) PyMarshal_WriteObjectToString(PyObject *, int); 15 | 16 | #ifndef Py_LIMITED_API 17 | PyAPI_FUNC(long) PyMarshal_ReadLongFromFile(FILE *); 18 | PyAPI_FUNC(int) PyMarshal_ReadShortFromFile(FILE *); 19 | PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromFile(FILE *); 20 | PyAPI_FUNC(PyObject *) PyMarshal_ReadLastObjectFromFile(FILE *); 21 | #endif 22 | PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromString(const char *, 23 | Py_ssize_t); 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | #endif /* !Py_MARSHAL_H */ 29 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.6m/metagrammar.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_METAGRAMMAR_H 2 | #define Py_METAGRAMMAR_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | 8 | #define MSTART 256 9 | #define RULE 257 10 | #define RHS 258 11 | #define ALT 259 12 | #define ITEM 260 13 | #define ATOM 261 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | #endif /* !Py_METAGRAMMAR_H */ 19 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.6m/namespaceobject.h: -------------------------------------------------------------------------------- 1 | 2 | /* simple namespace object interface */ 3 | 4 | #ifndef NAMESPACEOBJECT_H 5 | #define NAMESPACEOBJECT_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | #ifndef Py_LIMITED_API 11 | PyAPI_DATA(PyTypeObject) _PyNamespace_Type; 12 | 13 | PyAPI_FUNC(PyObject *) _PyNamespace_New(PyObject *kwds); 14 | #endif /* !Py_LIMITED_API */ 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | #endif /* !NAMESPACEOBJECT_H */ 20 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.6m/node.h: -------------------------------------------------------------------------------- 1 | 2 | /* Parse tree node interface */ 3 | 4 | #ifndef Py_NODE_H 5 | #define Py_NODE_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | typedef struct _node { 11 | short n_type; 12 | char *n_str; 13 | int n_lineno; 14 | int n_col_offset; 15 | int n_nchildren; 16 | struct _node *n_child; 17 | } node; 18 | 19 | PyAPI_FUNC(node *) PyNode_New(int type); 20 | PyAPI_FUNC(int) PyNode_AddChild(node *n, int type, 21 | char *str, int lineno, int col_offset); 22 | PyAPI_FUNC(void) PyNode_Free(node *n); 23 | #ifndef Py_LIMITED_API 24 | PyAPI_FUNC(Py_ssize_t) _PyNode_SizeOf(node *n); 25 | #endif 26 | 27 | /* Node access functions */ 28 | #define NCH(n) ((n)->n_nchildren) 29 | 30 | #define CHILD(n, i) (&(n)->n_child[i]) 31 | #define RCHILD(n, i) (CHILD(n, NCH(n) + i)) 32 | #define TYPE(n) ((n)->n_type) 33 | #define STR(n) ((n)->n_str) 34 | #define LINENO(n) ((n)->n_lineno) 35 | 36 | /* Assert that the type of a node is what we expect */ 37 | #define REQ(n, type) assert(TYPE(n) == (type)) 38 | 39 | PyAPI_FUNC(void) PyNode_ListTree(node *); 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | #endif /* !Py_NODE_H */ 45 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.6m/osdefs.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_OSDEFS_H 2 | #define Py_OSDEFS_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | 8 | /* Operating system dependencies */ 9 | 10 | #ifdef MS_WINDOWS 11 | #define SEP L'\\' 12 | #define ALTSEP L'/' 13 | #define MAXPATHLEN 256 14 | #define DELIM L';' 15 | #endif 16 | 17 | /* Filename separator */ 18 | #ifndef SEP 19 | #define SEP L'/' 20 | #endif 21 | 22 | /* Max pathname length */ 23 | #ifdef __hpux 24 | #include 25 | #include 26 | #ifndef PATH_MAX 27 | #define PATH_MAX MAXPATHLEN 28 | #endif 29 | #endif 30 | 31 | #ifndef MAXPATHLEN 32 | #if defined(PATH_MAX) && PATH_MAX > 1024 33 | #define MAXPATHLEN PATH_MAX 34 | #else 35 | #define MAXPATHLEN 1024 36 | #endif 37 | #endif 38 | 39 | /* Search path entry delimiter */ 40 | #ifndef DELIM 41 | #define DELIM L':' 42 | #endif 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | #endif /* !Py_OSDEFS_H */ 48 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.6m/osmodule.h: -------------------------------------------------------------------------------- 1 | 2 | /* os module interface */ 3 | 4 | #ifndef Py_OSMODULE_H 5 | #define Py_OSMODULE_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000 11 | PyAPI_FUNC(PyObject *) PyOS_FSPath(PyObject *path); 12 | #endif 13 | 14 | #ifdef __cplusplus 15 | } 16 | #endif 17 | #endif /* !Py_OSMODULE_H */ 18 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.6m/pgen.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_PGEN_H 2 | #define Py_PGEN_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | 8 | /* Parser generator interface */ 9 | 10 | extern grammar *meta_grammar(void); 11 | 12 | struct _node; 13 | extern grammar *pgen(struct _node *); 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | #endif /* !Py_PGEN_H */ 19 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.6m/pygetopt.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef Py_PYGETOPT_H 3 | #define Py_PYGETOPT_H 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #ifndef Py_LIMITED_API 9 | PyAPI_DATA(int) _PyOS_opterr; 10 | PyAPI_DATA(int) _PyOS_optind; 11 | PyAPI_DATA(wchar_t *) _PyOS_optarg; 12 | 13 | PyAPI_FUNC(void) _PyOS_ResetGetOpt(void); 14 | 15 | PyAPI_FUNC(int) _PyOS_GetOpt(int argc, wchar_t **argv, wchar_t *optstring); 16 | #endif /* !Py_LIMITED_API */ 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | #endif /* !Py_PYGETOPT_H */ 22 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.6m/pystrcmp.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_STRCMP_H 2 | #define Py_STRCMP_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | PyAPI_FUNC(int) PyOS_mystrnicmp(const char *, const char *, Py_ssize_t); 9 | PyAPI_FUNC(int) PyOS_mystricmp(const char *, const char *); 10 | 11 | #ifdef MS_WINDOWS 12 | #define PyOS_strnicmp strnicmp 13 | #define PyOS_stricmp stricmp 14 | #else 15 | #define PyOS_strnicmp PyOS_mystrnicmp 16 | #define PyOS_stricmp PyOS_mystricmp 17 | #endif 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | #endif /* !Py_STRCMP_H */ 24 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.6m/pystrhex.h: -------------------------------------------------------------------------------- 1 | #ifndef Py_STRHEX_H 2 | #define Py_STRHEX_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #ifndef Py_LIMITED_API 9 | /* Returns a str() containing the hex representation of argbuf. */ 10 | PyAPI_FUNC(PyObject*) _Py_strhex(const char* argbuf, const Py_ssize_t arglen); 11 | /* Returns a bytes() containing the ASCII hex representation of argbuf. */ 12 | PyAPI_FUNC(PyObject*) _Py_strhex_bytes(const char* argbuf, const Py_ssize_t arglen); 13 | #endif /* !Py_LIMITED_API */ 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | 19 | #endif /* !Py_STRHEX_H */ 20 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.6m/rangeobject.h: -------------------------------------------------------------------------------- 1 | 2 | /* Range object interface */ 3 | 4 | #ifndef Py_RANGEOBJECT_H 5 | #define Py_RANGEOBJECT_H 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | /* 11 | A range object represents an integer range. This is an immutable object; 12 | a range cannot change its value after creation. 13 | 14 | Range objects behave like the corresponding tuple objects except that 15 | they are represented by a start, stop, and step datamembers. 16 | */ 17 | 18 | PyAPI_DATA(PyTypeObject) PyRange_Type; 19 | PyAPI_DATA(PyTypeObject) PyRangeIter_Type; 20 | PyAPI_DATA(PyTypeObject) PyLongRangeIter_Type; 21 | 22 | #define PyRange_Check(op) (Py_TYPE(op) == &PyRange_Type) 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | #endif /* !Py_RANGEOBJECT_H */ 28 | -------------------------------------------------------------------------------- /3rdparty/prebuild/include/python3.6m/ucnhash.h: -------------------------------------------------------------------------------- 1 | /* Unicode name database interface */ 2 | #ifndef Py_LIMITED_API 3 | #ifndef Py_UCNHASH_H 4 | #define Py_UCNHASH_H 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | /* revised ucnhash CAPI interface (exported through a "wrapper") */ 10 | 11 | #define PyUnicodeData_CAPSULE_NAME "unicodedata.ucnhash_CAPI" 12 | 13 | typedef struct { 14 | 15 | /* Size of this struct */ 16 | int size; 17 | 18 | /* Get name for a given character code. Returns non-zero if 19 | success, zero if not. Does not set Python exceptions. 20 | If self is NULL, data come from the default version of the database. 21 | If it is not NULL, it should be a unicodedata.ucd_X_Y_Z object */ 22 | int (*getname)(PyObject *self, Py_UCS4 code, char* buffer, int buflen, 23 | int with_alias_and_seq); 24 | 25 | /* Get character code for a given name. Same error handling 26 | as for getname. */ 27 | int (*getcode)(PyObject *self, const char* name, int namelen, Py_UCS4* code, 28 | int with_named_seq); 29 | 30 | } _PyUnicode_Name_CAPI; 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | #endif /* !Py_UCNHASH_H */ 36 | #endif /* !Py_LIMITED_API */ 37 | -------------------------------------------------------------------------------- /3rdparty/pybind11/include/pybind11/common.h: -------------------------------------------------------------------------------- 1 | #include "detail/common.h" 2 | #warning "Including 'common.h' is deprecated. It will be removed in v3.0. Use 'pybind11.h'." 3 | -------------------------------------------------------------------------------- /3rdparty/pybind11/pybind11/__init__.py: -------------------------------------------------------------------------------- 1 | from ._version import version_info, __version__ # noqa: F401 imported but unused 2 | 3 | 4 | def get_include(user=False): 5 | from distutils.dist import Distribution 6 | import os 7 | import sys 8 | 9 | # Are we running in a virtual environment? 10 | virtualenv = hasattr(sys, 'real_prefix') or \ 11 | sys.prefix != getattr(sys, "base_prefix", sys.prefix) 12 | 13 | if virtualenv: 14 | return os.path.join(sys.prefix, 'include', 'site', 15 | 'python' + sys.version[:3]) 16 | else: 17 | dist = Distribution({'name': 'pybind11'}) 18 | dist.parse_config_files() 19 | 20 | dist_cobj = dist.get_command_obj('install', create=True) 21 | 22 | # Search for packages in user's home directory? 23 | if user: 24 | dist_cobj.user = user 25 | dist_cobj.prefix = "" 26 | dist_cobj.finalize_options() 27 | 28 | return os.path.dirname(dist_cobj.install_headers) 29 | -------------------------------------------------------------------------------- /3rdparty/pybind11/pybind11/__main__.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | 3 | import argparse 4 | import sys 5 | import sysconfig 6 | 7 | from . import get_include 8 | 9 | 10 | def print_includes(): 11 | dirs = [sysconfig.get_path('include'), 12 | sysconfig.get_path('platinclude'), 13 | get_include(), 14 | get_include(True)] 15 | 16 | # Make unique but preserve order 17 | unique_dirs = [] 18 | for d in dirs: 19 | if d not in unique_dirs: 20 | unique_dirs.append(d) 21 | 22 | print(' '.join('-I' + d for d in unique_dirs)) 23 | 24 | 25 | def main(): 26 | parser = argparse.ArgumentParser(prog='python -m pybind11') 27 | parser.add_argument('--includes', action='store_true', 28 | help='Include flags for both pybind11 and Python headers.') 29 | args = parser.parse_args() 30 | if not sys.argv[1:]: 31 | parser.print_help() 32 | if args.includes: 33 | print_includes() 34 | 35 | 36 | if __name__ == '__main__': 37 | main() 38 | -------------------------------------------------------------------------------- /3rdparty/pybind11/pybind11/_version.py: -------------------------------------------------------------------------------- 1 | version_info = (2, 3, 'dev0') 2 | __version__ = '.'.join(map(str, version_info)) 3 | -------------------------------------------------------------------------------- /3rdparty/pybind11/tools/libsize.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function, division 2 | import os 3 | import sys 4 | 5 | # Internal build script for generating debugging test .so size. 6 | # Usage: 7 | # python libsize.py file.so save.txt -- displays the size of file.so and, if save.txt exists, compares it to the 8 | # size in it, then overwrites save.txt with the new size for future runs. 9 | 10 | if len(sys.argv) != 3: 11 | sys.exit("Invalid arguments: usage: python libsize.py file.so save.txt") 12 | 13 | lib = sys.argv[1] 14 | save = sys.argv[2] 15 | 16 | if not os.path.exists(lib): 17 | sys.exit("Error: requested file ({}) does not exist".format(lib)) 18 | 19 | libsize = os.path.getsize(lib) 20 | 21 | print("------", os.path.basename(lib), "file size:", libsize, end='') 22 | 23 | if os.path.exists(save): 24 | with open(save) as sf: 25 | oldsize = int(sf.readline()) 26 | 27 | if oldsize > 0: 28 | change = libsize - oldsize 29 | if change == 0: 30 | print(" (no change)") 31 | else: 32 | print(" (change of {:+} bytes = {:+.2%})".format(change, change / oldsize)) 33 | else: 34 | print() 35 | 36 | with open(save, 'w') as sf: 37 | sf.write(str(libsize)) 38 | 39 | -------------------------------------------------------------------------------- /3rdparty/spdlog/details/null_mutex.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2015 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #include 9 | // null, no cost dummy "mutex" and dummy "atomic" int 10 | 11 | namespace spdlog { 12 | namespace details { 13 | struct null_mutex 14 | { 15 | void lock() {} 16 | void unlock() {} 17 | bool try_lock() 18 | { 19 | return true; 20 | } 21 | }; 22 | 23 | struct null_atomic_int 24 | { 25 | int value; 26 | null_atomic_int() = default; 27 | 28 | explicit null_atomic_int(int val) 29 | : value(val) 30 | { 31 | } 32 | 33 | int load(std::memory_order) const 34 | { 35 | return value; 36 | } 37 | 38 | void store(int val) 39 | { 40 | value = val; 41 | } 42 | }; 43 | 44 | } // namespace details 45 | } // namespace spdlog 46 | -------------------------------------------------------------------------------- /3rdparty/spdlog/fmt/fmt.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016-2018 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | // 9 | // Include a bundled header-only copy of fmtlib or an external one. 10 | // By default spdlog include its own copy. 11 | // 12 | 13 | #if !defined(SPDLOG_FMT_EXTERNAL) 14 | #ifndef FMT_HEADER_ONLY 15 | #define FMT_HEADER_ONLY 16 | #endif 17 | #ifndef FMT_USE_WINDOWS_H 18 | #define FMT_USE_WINDOWS_H 0 19 | #endif 20 | #include "bundled/core.h" 21 | #include "bundled/format.h" 22 | #else // external fmtlib 23 | #include 24 | #include 25 | #endif 26 | -------------------------------------------------------------------------------- /3rdparty/spdlog/fmt/ostr.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | // 8 | // include bundled or external copy of fmtlib's ostream support 9 | // 10 | #if !defined(SPDLOG_FMT_EXTERNAL) 11 | #ifndef FMT_HEADER_ONLY 12 | #define FMT_HEADER_ONLY 13 | #endif 14 | #include "bundled/ostream.h" 15 | #include "fmt.h" 16 | #else 17 | #include 18 | #endif 19 | -------------------------------------------------------------------------------- /3rdparty/spdlog/formatter.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2015 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #include "fmt/fmt.h" 9 | #include "details/log_msg.h" 10 | 11 | namespace spdlog { 12 | 13 | class formatter 14 | { 15 | public: 16 | virtual ~formatter() = default; 17 | virtual void format(const details::log_msg &msg, fmt::memory_buffer &dest) = 0; 18 | virtual std::unique_ptr clone() const = 0; 19 | }; 20 | } // namespace spdlog 21 | -------------------------------------------------------------------------------- /3rdparty/spdlog/sinks/msvc_sink.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Alexander Dalshov. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #ifndef SPDLOG_H 9 | #include "../spdlog.h" 10 | #endif 11 | 12 | #if defined(_WIN32) 13 | 14 | #include "../details/null_mutex.h" 15 | #include "base_sink.h" 16 | 17 | #include 18 | 19 | #include 20 | #include 21 | 22 | namespace spdlog { 23 | namespace sinks { 24 | /* 25 | * MSVC sink (logging using OutputDebugStringA) 26 | */ 27 | template 28 | class msvc_sink : public base_sink 29 | { 30 | public: 31 | explicit msvc_sink() {} 32 | 33 | protected: 34 | void sink_it_(const details::log_msg &msg) override 35 | { 36 | 37 | fmt::memory_buffer formatted; 38 | sink::formatter_->format(msg, formatted); 39 | OutputDebugStringA(fmt::to_string(formatted).c_str()); 40 | } 41 | 42 | void flush_() override {} 43 | }; 44 | 45 | using msvc_sink_mt = msvc_sink; 46 | using msvc_sink_st = msvc_sink; 47 | 48 | using windebug_sink_mt = msvc_sink_mt; 49 | using windebug_sink_st = msvc_sink_st; 50 | 51 | } // namespace sinks 52 | } // namespace spdlog 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /3rdparty/spdlog/version.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2015 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #define SPDLOG_VER_MAJOR 1 9 | #define SPDLOG_VER_MINOR 3 10 | #define SPDLOG_VER_PATCH 1 11 | 12 | #define SPDLOG_VERSION (SPDLOG_VER_MAJOR * 10000 + SPDLOG_VER_MINOR * 100 + SPDLOG_VER_PATCH) 13 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.2) 2 | project(sophon-inference) 3 | 4 | #debug 5 | #set(BUILD_TYPE mips64) 6 | #set(SDK_TYPE allinone) 7 | if (WIN32) 8 | include(build_windows.cmake) 9 | else() 10 | include(build_unix.cmake) 11 | endif() 12 | 13 | 14 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | Module Name Position Owner 2 | 3 | SAIL: include/ src/ @tong.liu 4 | BMCVWrapper: include/ src/ @mike.wu 5 | AutoSplit: modules/auto_split @zhenpeng.xiao 6 | AutoRunner: modules/auto_runner @zhenpeng.xiao 7 | AlgoKit: modules/algokit @haipeng.wan 8 | Utils: modules/utils @juntao.tong 9 | Samples: samples/ @lian.he 10 | Tests: tests/ @lian.he 11 | Tools: tools/ @juntao.tong 12 | Docker: docker/ @tong.liu 13 | Docs: docs/ @zhenpeng.xiao 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright [2019] [Bitmain Inc] 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /RELEASE.md: -------------------------------------------------------------------------------- 1 | ## Rlease 1.1.3 2 | 3 | ### Major Features and Improvements 4 | * Deploy on either SC3 or SE3; 5 | * Replace some third-party libs to head only ones. 6 | * Use new apis of BMNNSDK v1.1.3; 7 | * Add samples for MXNnet and PyTorch models; 8 | * Update documents by sphinx and abandon cpp document by doxygen; 9 | 10 | ## Rlease 1.1.2 11 | 12 | ### Major Features 13 | * Deploy on SC3; 14 | * Integrate video decoder, image processing, NN inference, postprocessing; 15 | * Provide both C++ and Python APIs, write inference application with short code; 16 | * Automatically manage memory of tensors; 17 | * Automatically split models from Tensorflow and Mxnet for BM1682; 18 | * Provide algokit(a python algorithm toolkit) to deploy deep learning applications; 19 | -------------------------------------------------------------------------------- /bin/soc/test_splitted_tf_model: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$1" == "" ];then 4 | echo "usage : ./test_splitted_tf_model -m input tfmodel path" 5 | echo " -s input submodel path" 6 | exit 1 7 | fi 8 | 9 | while getopts "m:s:" opt; do 10 | case $opt in 11 | m) 12 | echo "tfmodel_path is $OPTARG" 13 | tfmodel_path=$OPTARG 14 | ;; 15 | s) 16 | echo "submodel_path is $OPTARG" 17 | submodel_path=$OPTARG 18 | ;; 19 | \?) 20 | echo "usage : ./test_splitted_tf_model -m input tfmodel path" 21 | echo " -s input submodel path" 22 | exit 1;; 23 | esac 24 | done 25 | 26 | 27 | python3 -m sophon.auto_runner.check_tensorflow --tfmodel_path ${tfmodel_path} --submodel_path ${submodel_path} 28 | 29 | -------------------------------------------------------------------------------- /bin/x86/test_splitted_tf_model: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$1" == "" ];then 4 | echo "usage : ./test_splitted_tf_model -m input tfmodel path" 5 | echo " -s input submodel path" 6 | echo " -c 0 or 1, if using cmodel" 7 | exit 1 8 | fi 9 | 10 | while getopts "m:s:c:" opt; do 11 | case $opt in 12 | m) 13 | echo "tfmodel_path is $OPTARG" 14 | tfmodel_path=$OPTARG 15 | ;; 16 | s) 17 | echo "submodel_path is $OPTARG" 18 | submodel_path=$OPTARG 19 | ;; 20 | c) 21 | echo "use_cmodel is $OPTARG" 22 | use_cmodel=$OPTARG 23 | ;; 24 | \?) 25 | echo "usage : ./test_splitted_tf_model -m input tfmodel path" 26 | echo " -s input submodel path" 27 | echo " -c 0 or 1, if using cmodel" 28 | exit 1;; 29 | esac 30 | done 31 | 32 | if [ "$use_cmodel" == "" ];then 33 | use_cmodel="0" 34 | fi 35 | 36 | 37 | python3 -m sophon.auto_runner.check_tensorflow --tfmodel_path ${tfmodel_path} --submodel_path ${submodel_path} --use_cmodel ${use_cmodel} 38 | 39 | -------------------------------------------------------------------------------- /cmake/BM1684_ARM_PCIE/FindBMDecode.cmake: -------------------------------------------------------------------------------- 1 | message(STATUS "Finding Bitmain Decode") 2 | 3 | set(BMDECODE_COMPONENTS 4 | bmvideo 5 | bmjpuapi 6 | bmjpulite) 7 | 8 | set(BMDECODE_INCLUDE_DIRS ${BMDECODER_DIR}/include/decode) 9 | 10 | foreach(ITEM ${BMDECODE_COMPONENTS}) 11 | list(APPEND BMDECODE_LIBRARIES "${BMDECODER_DIR}/libs/arm_pcie/decode/lib${ITEM}.so") 12 | endforeach() 13 | 14 | if(BMDECODE_INCLUDE_DIRS AND BMDECODE_LIBRARIES) 15 | set(BMDECODE_FOUND TRUE) 16 | message(STATUS "Bitmain DECODE found") 17 | else(BMDECODE_INCLUDE_DIRS AND BMDECODE_LIBRARIES) 18 | message(STATUS "Bitmain DECODE not found") 19 | endif(BMDECODE_INCLUDE_DIRS AND BMDECODE_LIBRARIES) 20 | -------------------------------------------------------------------------------- /cmake/BM1684_ARM_PCIE/FindFFMPEG.cmake: -------------------------------------------------------------------------------- 1 | message(STATUS "Finding Bitmain FFMPEG") 2 | 3 | set(FFMPEG_COMPONENTS 4 | swresample 5 | swscale 6 | avformat 7 | avutil 8 | avdevice 9 | avfilter 10 | avcodec) 11 | 12 | set(FFMPEG_INCLUDE_DIRS ${BMDECODER_DIR}/include/ffmpeg) 13 | 14 | foreach(ITEM ${FFMPEG_COMPONENTS}) 15 | list(APPEND FFMPEG_LIBRARIES "${BMDECODER_DIR}/libs/arm_pcie/ffmpeg/lib${ITEM}.so") 16 | endforeach() 17 | 18 | if(FFMPEG_INCLUDE_DIRS AND FFMPEG_LIBRARIES) 19 | set(FFMPEG_FOUND TRUE) 20 | message(STATUS "Bitmain FFMPEG found") 21 | else(FFMPEG_INCLUDE_DIRS AND FFMPEG_LIBRARIES) 22 | message(STATUS "Bitmain FFMPEG not found") 23 | endif(FFMPEG_INCLUDE_DIRS AND FFMPEG_LIBRARIES) 24 | -------------------------------------------------------------------------------- /cmake/BM1684_ARM_PCIE/ToolChain_aarch64_linux.cmake: -------------------------------------------------------------------------------- 1 | # set system name and processor type 2 | set(CMAKE_SYSTEM_NAME Linux) 3 | set(CMAKE_SYSTEM_PROCESSOR aarch64) 4 | 5 | # set cross compiler 6 | set(CROSS_COMPILE aarch64-linux-gnu-) 7 | set(CMAKE_C_COMPILER ${CROSS_COMPILE}gcc) 8 | set(CMAKE_CXX_COMPILER ${CROSS_COMPILE}g++) 9 | 10 | # search for programs in the build host dir 11 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | # search lib and header in the target dir 13 | set(CMAKE_FIND_ROOT_PATH_LIBRARY ONLY) 14 | set(CMAKE_FIND_ROOT_PATH_INCLUDE ONLY) 15 | -------------------------------------------------------------------------------- /cmake/BM1684_PCIE/FindBMDecode.cmake: -------------------------------------------------------------------------------- 1 | message(STATUS "Finding Bitmain Decode") 2 | 3 | set(BMDECODE_COMPONENTS 4 | bmvideo 5 | bmjpuapi 6 | bmjpulite) 7 | 8 | set(BMDECODE_INCLUDE_DIRS ${BMDECODER_DIR}/include/decode) 9 | 10 | foreach(ITEM ${BMDECODE_COMPONENTS}) 11 | list(APPEND BMDECODE_LIBRARIES "${BMDECODER_DIR}/libs/pcie/decode/lib${ITEM}.so") 12 | endforeach() 13 | 14 | if(BMDECODE_INCLUDE_DIRS AND BMDECODE_LIBRARIES) 15 | set(BMDECODE_FOUND TRUE) 16 | message(STATUS "Bitmain DECODE found") 17 | else(BMDECODE_INCLUDE_DIRS AND BMDECODE_LIBRARIES) 18 | message(STATUS "Bitmain DECODE not found") 19 | endif(BMDECODE_INCLUDE_DIRS AND BMDECODE_LIBRARIES) 20 | -------------------------------------------------------------------------------- /cmake/BM1684_PCIE/FindFFMPEG.cmake: -------------------------------------------------------------------------------- 1 | message(STATUS "Finding Bitmain FFMPEG") 2 | 3 | set(FFMPEG_COMPONENTS 4 | swresample 5 | swscale 6 | avformat 7 | avutil 8 | avdevice 9 | avfilter 10 | avcodec) 11 | 12 | set(FFMPEG_INCLUDE_DIRS ${BMDECODER_DIR}/include/ffmpeg) 13 | 14 | foreach(ITEM ${FFMPEG_COMPONENTS}) 15 | list(APPEND FFMPEG_LIBRARIES "${BMDECODER_DIR}/libs/pcie/ffmpeg/lib${ITEM}.so") 16 | endforeach() 17 | 18 | if(FFMPEG_INCLUDE_DIRS AND FFMPEG_LIBRARIES) 19 | set(FFMPEG_FOUND TRUE) 20 | message(STATUS "Bitmain FFMPEG found") 21 | else(FFMPEG_INCLUDE_DIRS AND FFMPEG_LIBRARIES) 22 | message(STATUS "Bitmain FFMPEG not found") 23 | endif(FFMPEG_INCLUDE_DIRS AND FFMPEG_LIBRARIES) 24 | -------------------------------------------------------------------------------- /cmake/BM1684_SOC/FindBMDecode.cmake: -------------------------------------------------------------------------------- 1 | message(STATUS "Finding Bitmain Decode") 2 | 3 | set(BMDECODE_COMPONENTS 4 | bmvideo 5 | bmjpuapi 6 | bmjpulite) 7 | 8 | set(BMDECODE_INCLUDE_DIRS 9 | ${BMDECODER_DIR}/decode/include) 10 | 11 | foreach(ITEM ${BMDECODE_COMPONENTS}) 12 | list(APPEND BMDECODE_LIBRARIES "${BMDECODER_DIR}/decode/lib/lib${ITEM}.so") 13 | endforeach() 14 | 15 | if(BMDECODE_INCLUDE_DIRS AND BMDECODE_LIBRARIES) 16 | set(BMDECODE_FOUND TRUE) 17 | message(STATUS "Bitmain Decode found") 18 | else(BMDECODE_INCLUDE_DIRS AND BMDECODE_LIBRARIES) 19 | message(STATUS "Bitmain Decode not found") 20 | endif(BMDECODE_INCLUDE_DIRS AND BMDECODE_LIBRARIES) 21 | -------------------------------------------------------------------------------- /cmake/BM1684_SOC/FindFFMPEG.cmake: -------------------------------------------------------------------------------- 1 | message(STATUS "Finding Bitmain FFMPEG") 2 | 3 | set(FFMPEG_COMPONENTS 4 | swresample 5 | swscale 6 | avformat 7 | avutil 8 | avdevice 9 | avfilter 10 | avcodec) 11 | 12 | set(FFMPEG_INCLUDE_DIRS 13 | ${BMDECODER_DIR}/ffmpeg/usr/local/include) 14 | 15 | foreach(ITEM ${FFMPEG_COMPONENTS}) 16 | list(APPEND FFMPEG_LIBRARIES "${BMDECODER_DIR}/ffmpeg/usr/local/lib/lib${ITEM}.so") 17 | endforeach() 18 | 19 | if(FFMPEG_INCLUDE_DIRS AND FFMPEG_LIBRARIES) 20 | set(FFMPEG_FOUND TRUE) 21 | message(STATUS "Bitmain FFMPEG found") 22 | else(FFMPEG_INCLUDE_DIRS AND FFMPEG_LIBRARIES) 23 | message(STATUS "Bitmain FFMPEG not found") 24 | endif(FFMPEG_INCLUDE_DIRS AND FFMPEG_LIBRARIES) 25 | -------------------------------------------------------------------------------- /cmake/BM1684_SOC/FindOpenCV.cmake: -------------------------------------------------------------------------------- 1 | message(STATUS "Finding Bitmain OpenCV") 2 | set(OpenCV_PATH ${SOC_BM1684}/opencv) 3 | set(OpenCV_COMPONENTS 4 | opencv_calib3d 5 | opencv_core 6 | opencv_dnn 7 | opencv_features2d 8 | opencv_flann 9 | opencv_gapi 10 | opencv_highgui 11 | opencv_imgcodecs 12 | opencv_imgproc 13 | opencv_ml 14 | opencv_objdetect 15 | opencv_photo 16 | opencv_stitching 17 | opencv_video 18 | opencv_videoio) 19 | set(OpenCV_INCLUDE_DIRS 20 | "${OpenCV_PATH}/include/opencv4") 21 | foreach(ITEM ${OpenCV_COMPONENTS}) 22 | list(APPEND OpenCV_LIBRARIES "${OpenCV_PATH}/lib/lib${ITEM}.so") 23 | endforeach() 24 | message(${OpenCV_LIBRARIES}) 25 | if(OpenCV_INCLUDE_DIRS AND OpenCV_LIBRARIES) 26 | set(OpenCV_FOUND TRUE) 27 | message(STATUS "Bitmain OpenCV found") 28 | else(OpenCV_INCLUDE_DIRS AND OpenCV_LIBRARIES) 29 | message(STATUS "Bitmain OpenCV not found") 30 | endif(OpenCV_INCLUDE_DIRS AND OpenCV_LIBRARIES) 31 | -------------------------------------------------------------------------------- /cmake/BM1684_SOC/ToolChain_aarch64_linux.cmake: -------------------------------------------------------------------------------- 1 | # set system name and processor type 2 | set(CMAKE_SYSTEM_NAME Linux) 3 | set(CMAKE_SYSTEM_PROCESSOR aarch64) 4 | 5 | # set cross compiler 6 | set(CROSS_COMPILE aarch64-linux-gnu-) 7 | set(CMAKE_C_COMPILER ${CROSS_COMPILE}gcc) 8 | set(CMAKE_CXX_COMPILER ${CROSS_COMPILE}g++) 9 | 10 | # set target env 11 | # set(CMAKE_FIND_ROOT_PATH "/data/release/toolchains/gcc/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu") 12 | 13 | # search for programs in the build host dir 14 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 15 | # search lib and header in the target dir 16 | set(CMAKE_FIND_ROOT_PATH_LIBRARY ONLY) 17 | set(CMAKE_FIND_ROOT_PATH_INCLUDE ONLY) 18 | -------------------------------------------------------------------------------- /cmake/BMNNSDK2_BM1684_ARM_PCIE/FindBMDecode.cmake: -------------------------------------------------------------------------------- 1 | message(STATUS "Finding Bitmain Decode") 2 | 3 | set(BMDECODE_COMPONENTS 4 | bmvideo 5 | bmjpuapi 6 | bmjpulite) 7 | 8 | set(BMDECODE_INCLUDE_DIRS 9 | ${BMDECODER_DIR}/include/decode) 10 | 11 | foreach(ITEM ${BMDECODE_COMPONENTS}) 12 | list(APPEND BMDECODE_LIBRARIES "${BMNNSDK2_PATH}/lib/decode/arm_pcie/lib${ITEM}.so") 13 | endforeach() 14 | 15 | if(BMDECODE_INCLUDE_DIRS AND BMDECODE_LIBRARIES) 16 | set(BMDECODE_FOUND TRUE) 17 | message(STATUS "Bitmain DECODE found") 18 | else(BMDECODE_INCLUDE_DIRS AND BMDECODE_LIBRARIES) 19 | message(STATUS "Bitmain DECODE not found") 20 | endif(BMDECODE_INCLUDE_DIRS AND BMDECODE_LIBRARIES) 21 | -------------------------------------------------------------------------------- /cmake/BMNNSDK2_BM1684_ARM_PCIE/FindFFMPEG.cmake: -------------------------------------------------------------------------------- 1 | message(STATUS "Finding Bitmain FFMPEG") 2 | 3 | set(FFMPEG_COMPONENTS 4 | swresample 5 | swscale 6 | avformat 7 | avutil 8 | avdevice 9 | avfilter 10 | avcodec) 11 | 12 | set(FFMPEG_INCLUDE_DIRS 13 | ${BMNNSDK2_PATH}/include/ffmpeg) 14 | 15 | foreach(ITEM ${FFMPEG_COMPONENTS}) 16 | list(APPEND FFMPEG_LIBRARIES "${BMNNSDK2_PATH}/lib/ffmpeg/arm_pcie/lib${ITEM}.so") 17 | endforeach() 18 | 19 | if(FFMPEG_INCLUDE_DIRS AND FFMPEG_LIBRARIES) 20 | set(FFMPEG_FOUND TRUE) 21 | message(STATUS "Bitmain FFMPEG found") 22 | else(FFMPEG_INCLUDE_DIRS AND FFMPEG_LIBRARIES) 23 | message(STATUS "Bitmain FFMPEG not found") 24 | endif(FFMPEG_INCLUDE_DIRS AND FFMPEG_LIBRARIES) 25 | -------------------------------------------------------------------------------- /cmake/BMNNSDK2_BM1684_PCIE/FindBMDecode.cmake: -------------------------------------------------------------------------------- 1 | message(STATUS "Finding Bitmain Decode") 2 | 3 | set(BMDECODE_COMPONENTS 4 | bmvideo 5 | bmjpuapi 6 | bmjpulite) 7 | 8 | set(BMDECODE_INCLUDE_DIRS 9 | ${BMDECODER_DIR}/include/decode) 10 | 11 | foreach(ITEM ${BMDECODE_COMPONENTS}) 12 | list(APPEND BMDECODE_LIBRARIES "${BMNNSDK2_PATH}/lib/decode/x86/lib${ITEM}.so") 13 | endforeach() 14 | 15 | if(BMDECODE_INCLUDE_DIRS AND BMDECODE_LIBRARIES) 16 | set(BMDECODE_FOUND TRUE) 17 | message(STATUS "Bitmain DECODE found") 18 | else(BMDECODE_INCLUDE_DIRS AND BMDECODE_LIBRARIES) 19 | message(STATUS "Bitmain DECODE not found") 20 | endif(BMDECODE_INCLUDE_DIRS AND BMDECODE_LIBRARIES) 21 | -------------------------------------------------------------------------------- /cmake/BMNNSDK2_BM1684_PCIE/FindFFMPEG.cmake: -------------------------------------------------------------------------------- 1 | message(STATUS "Finding Bitmain FFMPEG") 2 | 3 | set(FFMPEG_COMPONENTS 4 | swresample 5 | swscale 6 | avformat 7 | avutil 8 | avdevice 9 | avfilter 10 | avcodec) 11 | 12 | set(FFMPEG_INCLUDE_DIRS 13 | ${BMNNSDK2_PATH}/include/ffmpeg) 14 | 15 | foreach(ITEM ${FFMPEG_COMPONENTS}) 16 | list(APPEND FFMPEG_LIBRARIES "${BMNNSDK2_PATH}/lib/ffmpeg/x86/lib${ITEM}.so") 17 | endforeach() 18 | 19 | if(FFMPEG_INCLUDE_DIRS AND FFMPEG_LIBRARIES) 20 | set(FFMPEG_FOUND TRUE) 21 | message(STATUS "Bitmain FFMPEG found") 22 | else(FFMPEG_INCLUDE_DIRS AND FFMPEG_LIBRARIES) 23 | message(STATUS "Bitmain FFMPEG not found") 24 | endif(FFMPEG_INCLUDE_DIRS AND FFMPEG_LIBRARIES) 25 | -------------------------------------------------------------------------------- /cmake/ToolChain_loongarch64_linux.cmake: -------------------------------------------------------------------------------- 1 | # set system name and processor type 2 | set(CMAKE_SYSTEM_NAME Linux) 3 | set(CMAKE_SYSTEM_PROCESSOR loongarch64) 4 | 5 | # set cross compiler 6 | set(CROSS_COMPILE loongarch64-linux-gnu-) 7 | set(CMAKE_C_COMPILER ${CROSS_COMPILE}gcc) 8 | set(CMAKE_CXX_COMPILER ${CROSS_COMPILE}g++) 9 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -Wno-error=deprecated-declarations -ffunction-sections -fdata-sections -ffp-contract=off -fPIC -Wno-unused-function -funwind-tables -rdynamic -fno-short-enums" CACHE STRING "cflags") 10 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions -funwind-tables -rdynamic -fno-short-enums -Wall -Werror -Wno-error=deprecated-declarations -ffunction-sections -fdata-sections -fno-strict-aliasing -ffp-contract=off -std=c++11 -Wno-unused-function -Wno-format-truncation -fPIC -Wno-stringop-truncation" CACHE STRING "c++flags") 11 | 12 | # search for programs in the build host dir 13 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 14 | # search lib and header in the target dir 15 | set(CMAKE_FIND_ROOT_PATH_LIBRARY ONLY) 16 | set(CMAKE_FIND_ROOT_PATH_INCLUDE ONLY) -------------------------------------------------------------------------------- /cmake/ToolChain_mips64_linux.cmake: -------------------------------------------------------------------------------- 1 | # set system name and processor type 2 | set(CMAKE_SYSTEM_NAME Linux) 3 | set(CMAKE_SYSTEM_PROCESSOR mips64) 4 | 5 | # set cross compiler 6 | set(CROSS_COMPILE mips-linux-gnu-) 7 | set(CMAKE_C_COMPILER ${CROSS_COMPILE}gcc) 8 | set(CMAKE_CXX_COMPILER ${CROSS_COMPILE}g++) 9 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wa,-mips64r2 -mabi=64 -march=gs464e" CACHE STRING "cflags") 10 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mips64r2 -mabi=64 -march=gs464e" CACHE STRING "c++flags") 11 | 12 | # search for programs in the build host dir 13 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 14 | # search lib and header in the target dir 15 | set(CMAKE_FIND_ROOT_PATH_LIBRARY ONLY) 16 | set(CMAKE_FIND_ROOT_PATH_INCLUDE ONLY) 17 | -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | ARG DEBIAN_FRONTEND=nointeractive 3 | ENV TZ=Asia/Shanghai 4 | 5 | RUN apt-get update 6 | RUN apt-get install -y \ 7 | cmake \ 8 | libtool \ 9 | wget \ 10 | git \ 11 | vim \ 12 | tree \ 13 | libssl-dev \ 14 | pkg-config libopencv-dev libncurses5-dev 15 | RUN apt-get install -y python3 python3-pip 16 | RUN apt-get install -y \ 17 | tzdata \ 18 | libgflags-dev libhdf5-serial-dev libhdf5-dev \ 19 | libsnappy-dev libatlas-base-dev 20 | RUN apt-get install -y openssh-client openssh-server 21 | RUN apt-get install -y openjdk-8-jdk 22 | 23 | RUN echo "Asia/Shanghai" > /etc/timezone 24 | ENV PATH /workspace/bm_prebuilt_toolchains/x86-64-core-i7--glibc--stable/bin:$PATH 25 | ENV PATH /workspace/bm_prebuilt_toolchains/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin:$PATH 26 | ENV PATH /workspace/bm_prebuilt_toolchains/mips-loongson-gcc7.3-linux-gnu/2019.06-29/bin:$PATH 27 | ENV PATH /usr/sw/swgcc830_cross_tools-bb623bc9a/usr/bin:$PATH 28 | ENV PATH /workspace/bm_prebuilt_toolchains/loongarch64-linux-gnu-2021-04-22-vector/bin:$PATH 29 | 30 | WORKDIR /workspace 31 | -------------------------------------------------------------------------------- /docker/build_sail_docker.sh: -------------------------------------------------------------------------------- 1 | docker build -t sail:dev -f ./Dockerfile . 2 | -------------------------------------------------------------------------------- /docker/pip.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | index-url = https://pypi.tuna.tsinghua.edu.cn/simple 3 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | *.log 3 | -------------------------------------------------------------------------------- /docs/Sophon_Inference_en.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/docs/Sophon_Inference_en.pdf -------------------------------------------------------------------------------- /docs/Sophon_Inference_zh.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/docs/Sophon_Inference_zh.pdf -------------------------------------------------------------------------------- /docs/images/BMNNSDK.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/docs/images/BMNNSDK.png -------------------------------------------------------------------------------- /docs/images/BMNNSDK_INFO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/docs/images/BMNNSDK_INFO.png -------------------------------------------------------------------------------- /docs/images/SA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/docs/images/SA.png -------------------------------------------------------------------------------- /docs/images/SC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/docs/images/SC.png -------------------------------------------------------------------------------- /docs/images/SC5+.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/docs/images/SC5+.jpg -------------------------------------------------------------------------------- /docs/images/SC5H.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/docs/images/SC5H.jpg -------------------------------------------------------------------------------- /docs/images/SE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/docs/images/SE.png -------------------------------------------------------------------------------- /docs/images/SE5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/docs/images/SE5.jpg -------------------------------------------------------------------------------- /docs/images/SG6-06-A22.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/docs/images/SG6-06-A22.jpg -------------------------------------------------------------------------------- /docs/images/SG6-10-B22.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/docs/images/SG6-10-B22.jpg -------------------------------------------------------------------------------- /docs/images/autodeploy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/docs/images/autodeploy.png -------------------------------------------------------------------------------- /docs/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/docs/images/logo.png -------------------------------------------------------------------------------- /docs/images/sa3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/docs/images/sa3.png -------------------------------------------------------------------------------- /docs/images/sc3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/docs/images/sc3.png -------------------------------------------------------------------------------- /docs/images/se3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/docs/images/se3.png -------------------------------------------------------------------------------- /docs/images/sm5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/docs/images/sm5.jpg -------------------------------------------------------------------------------- /docs/images/sophon_inference.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/docs/images/sophon_inference.png -------------------------------------------------------------------------------- /docs/images/split.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/docs/images/split.png -------------------------------------------------------------------------------- /docs/source_en/0_get_start.rst: -------------------------------------------------------------------------------- 1 | Getting Started 2 | --------------- 3 | .. toctree:: 4 | :glob: 5 | 6 | get_start/0_products 7 | get_start/1_introduction 8 | get_start/2_crash_course 9 | get_start/3_one_key_deploy- 10 | -------------------------------------------------------------------------------- /docs/source_en/1_demo.rst: -------------------------------------------------------------------------------- 1 | Practical Demos 2 | --------------- 3 | 4 | .. toctree:: 5 | :glob: 6 | 7 | demo/0_preface 8 | demo/1_resnet50 9 | demo/2_ssd 10 | demo/3_yolov3 11 | demo/4_mtcnn -------------------------------------------------------------------------------- /docs/source_en/2_module.rst: -------------------------------------------------------------------------------- 1 | API Reference 2 | ------------- 3 | .. toctree:: 4 | :glob: 5 | 6 | module/sail 7 | module/sail_cpp 8 | module/sail_python -------------------------------------------------------------------------------- /docs/source_en/demo/4_mtcnn.rst: -------------------------------------------------------------------------------- 1 | Detection with MTCNN 2 | ==================== 3 | 4 | In this Demo, we use mtcnn to detect faces in images. 5 | The bmodel used in this demo are already converted from official yolov3, to fp32 data type. 6 | 7 | +----+-------+---------+--------------+-----------+-------+---------+--------------+------------+-------------+ 8 | | ID | Input | Decoder | Preprocessor | Data Type | Model | Mode | Model Number | TPU Number | Multi-Thread| 9 | +====+=======+=========+==============+===========+=======+=========+==============+============+=============+ 10 | | 0 | image | opencv | opencv | fp32 | MTCNN | dynamic | 1 | 1 | N | 11 | +----+-------+---------+--------------+-----------+-------+---------+--------------+------------+-------------+ 12 | 13 | 14 | .. toctree:: 15 | :glob: 16 | 17 | mtcnn_cases/usage 18 | mtcnn_cases/cpp 19 | mtcnn_cases/python 20 | -------------------------------------------------------------------------------- /docs/source_en/demo/mtcnn_cases/usage.rst: -------------------------------------------------------------------------------- 1 | Usage 2 | _____ 3 | 4 | 5 | Get model and data 6 | ^^^^^^^^^^^^^^^^^^ 7 | 8 | To run this demo, we need a fp32 bmodel of mtcnn. 9 | We also need a face image to be detected. 10 | We can get them through the script "download.py". 11 | 12 | .. code-block:: shell 13 | 14 | python3 download.py mtcnn_fp32.bmodel 15 | python3 download.py face.jpg 16 | 17 | Run C++ cases 18 | ^^^^^^^^^^^^^ 19 | 20 | For case 0: 21 | 22 | .. code-block:: shell 23 | 24 | ./det_mtcnn --bmodel ./mtcnn_fp32.bmodel --input ./face.jpg 25 | 26 | 27 | Run python cases 28 | ^^^^^^^^^^^^^^^^ 29 | 30 | For case 0: 31 | 32 | .. code-block:: shell 33 | 34 | python3 ./det_mtcnn.py --bmodel ./mtcnn_fp32.bmodel --input ./face.jpg 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/source_en/get_start/0_products.rst: -------------------------------------------------------------------------------- 1 | Sophon TPU Choices 2 | ================== 3 | 4 | We developed four kinds of products based on our original chips. 5 | For detailed information, please refer to https://sophon.ai 6 | 7 | .. toctree:: 8 | :glob: 9 | 10 | pros/sc 11 | pros/se 12 | pros/sa 13 | pros/sm 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/source_en/get_start/1_introduction.rst: -------------------------------------------------------------------------------- 1 | Sophon Software Stack 2 | ===================== 3 | 4 | In response to the series of TPU products mentioned in the previous section, 5 | Bitmain independently developed a set of suitable software tools: 6 | Bitmain Neural Network Software Development Kit(BMNNSDK). 7 | 8 | The softwares for using Sophon TPUs are all included in BMNNSDK. 9 | Sophon Inference, which supplies a bunch of high level APIs, 10 | is a upper module in BMNNSDK to help user deploying their models on Sophon TPUs rapidly. 11 | 12 | In this section, we first show you the pipeline of deploying deep learning models on Sophon TPUs. 13 | Then, we introduce the base concepts of BMNNSDK and Sophon Inference. 14 | Last is the installation and some reminds. 15 | 16 | 17 | .. toctree:: 18 | :glob: 19 | 20 | intros/deploy 21 | intros/bmnnsdk 22 | intros/si 23 | intros/install 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /docs/source_en/get_start/2_crash_course.rst: -------------------------------------------------------------------------------- 1 | Crash Course 2 | ============ 3 | 4 | In this course, we will help you deploy a tensorflow frozen model of mobilenet on Sophon SC5. 5 | Before starting the course, you should prepare a personal computer with a Sophon SC5 being plugined in its PCIE slot, 6 | and the BMNNSDK, Bitmain Neural Network Software Development Kit. 7 | 8 | There are three steps in this course. 9 | First, we should install the driver, bmnett and the python module of sophon-inference. The three modules are all contained in BMNNSDK. 10 | Then, we are going to convert a mobilent which is trained from tensorflow to a bmodel using bmnett. 11 | Finally, we will deploy the converted bmodel on Sophon SC5 by sophon-inference. 12 | 13 | .. toctree:: 14 | :glob: 15 | 16 | courses/install 17 | courses/convert 18 | courses/deploy 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/source_en/get_start/3_one_key_deploy.rst: -------------------------------------------------------------------------------- 1 | One-Key Deployment 2 | ================== 3 | 4 | to be added... 5 | -------------------------------------------------------------------------------- /docs/source_en/get_start/courses/deploy.rst: -------------------------------------------------------------------------------- 1 | deploy bmodel on Sophon SC5 using sail 2 | ______________________________________ 3 | 4 | .. code-block:: python 5 | 6 | #!/usr/bin/env python3 7 | 8 | import cv2 9 | import numpy as np 10 | import sophon.sail as sail 11 | 12 | bmodel = sail.Engine("bmodel/compilation.bmodel", 0, sail.IOMode.SYSIO) # initialize an Engine instance using bmodel. 13 | graph_name = bmodel.get_graph_names()[0] # graph_name is just the net_name in conversion step. 14 | input_tensor_name = bmodel.get_input_names(graph_name)[0] 15 | # why transpose? 16 | # bmodel will always be NCHW layout, 17 | # so, if original tensorflow frozen model is formatted as NHWC, 18 | input_data = {input_tensor_name: np.expand_dims(cv2.resize(cv2.imread("cls.jpg"), (224,224)), 0)} 19 | outputs = bmodel.process(graph_name, input_data) # do inference 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /docs/source_en/get_start/intros/si.rst: -------------------------------------------------------------------------------- 1 | Sophon Inference 2 | ________________ 3 | 4 | .. image:: ../../../images/sophon_inference.png 5 | 6 | 7 | Sophon Inference currently mainly includes the SAIL(Sophon Artificial Intelligent Library) module in the above figure. 8 | We provide python/c++ interfaces and sample programs, and users can choose the appropriate calling method according to their needs. 9 | 10 | **SAIL** 11 | :BMRuntime, BMCV, BMDecoder and BMLib in BMNNSDK are encapsulated. C++/python interfaces are provided. And can be used to 12 | 13 | a).Drive the TPU to reason the compiled deep learning model (bmodel); 14 | 15 | b).Use Sophon TPU for image and video processing. 16 | 17 | Online English doc: https://sophon-ai-algo.github.io/sophon-inference-doc_en/ 18 | 19 | Online Chinese doc: https://sophon-ai-algo.github.io/sophon-inference-doc_zh/ 20 | -------------------------------------------------------------------------------- /docs/source_en/get_start/pros/sa.rst: -------------------------------------------------------------------------------- 1 | Sophon SA serials 2 | _________________ 3 | .. image:: ../../../images/sa3.png 4 | :scale: 50% 5 | :align: center 6 | 7 | -------------------------------------------------------------------------------- /docs/source_en/get_start/pros/sc.rst: -------------------------------------------------------------------------------- 1 | Sophon SC serials 2 | _________________ 3 | .. image:: ../../../images/sc3.png 4 | :scale: 50% 5 | :align: center 6 | 7 | -------------------------------------------------------------------------------- /docs/source_en/get_start/pros/se.rst: -------------------------------------------------------------------------------- 1 | Sophon SE serials 2 | _________________ 3 | .. image:: ../../../images/se3.png 4 | :scale: 50% 5 | :align: center 6 | 7 | -------------------------------------------------------------------------------- /docs/source_en/get_start/pros/sm.rst: -------------------------------------------------------------------------------- 1 | Sophon SM serials 2 | _________________ 3 | -------------------------------------------------------------------------------- /docs/source_en/module/sail_cpp.rst: -------------------------------------------------------------------------------- 1 | ../../source_common/api/sail_cpp.rst -------------------------------------------------------------------------------- /docs/source_en/module/sail_python.rst: -------------------------------------------------------------------------------- 1 | ../../source_common/api/sail_python.rst -------------------------------------------------------------------------------- /docs/source_zh/0_get_start.rst: -------------------------------------------------------------------------------- 1 | 快速入门 2 | -------- 3 | .. toctree:: 4 | :glob: 5 | 6 | get_start/0_hardware 7 | get_start/1_software 8 | get_start/2_crash_course 9 | get_start/3_one_key_deploy- 10 | -------------------------------------------------------------------------------- /docs/source_zh/1_demo.rst: -------------------------------------------------------------------------------- 1 | 示例程序 2 | -------- 3 | 4 | .. toctree:: 5 | :glob: 6 | 7 | demo/0_preface 8 | demo/1_resnet50 9 | demo/2_ssd 10 | demo/3_yolov3 11 | demo/4_mtcnn 12 | -------------------------------------------------------------------------------- /docs/source_zh/2_module.rst: -------------------------------------------------------------------------------- 1 | API 参考 2 | -------- 3 | .. toctree:: 4 | :glob: 5 | 6 | module/sail 7 | module/sail_cpp 8 | module/sail_python 9 | -------------------------------------------------------------------------------- /docs/source_zh/demo/4_mtcnn.rst: -------------------------------------------------------------------------------- 1 | 使用MTCNN进行人脸检测 2 | ===================== 3 | 4 | 在本节中,我们使用 mtcnn 做人脸检测。 5 | 6 | 7 | +----+-------+---------+--------------+-----------+-------+---------+--------------+------------+-------------+ 8 | | ID | Input | Decoder | Preprocessor | Data Type | Model | Mode | Model Number | TPU Number | Multi-Thread| 9 | +====+=======+=========+==============+===========+=======+=========+==============+============+=============+ 10 | | 0 | image | opencv | opencv | fp32 | MTCNN | dynamic | 1 | 1 | N | 11 | +----+-------+---------+--------------+-----------+-------+---------+--------------+------------+-------------+ 12 | 13 | 14 | .. toctree:: 15 | :glob: 16 | 17 | mtcnn_cases/usage 18 | mtcnn_cases/cpp 19 | mtcnn_cases/python 20 | -------------------------------------------------------------------------------- /docs/source_zh/demo/mtcnn_cases/usage.rst: -------------------------------------------------------------------------------- 1 | 运行demo 2 | ________ 3 | 4 | 5 | 获取bmodel和图片 6 | ^^^^^^^^^^^^^^^^ 7 | 8 | 若您已经按照前述说明执行/workspace/examples/sail/sc5_tests/auto_test.sh,则相应的模型文件及测试图片应当已经下载完毕。 9 | 如果没有这些文件,使用 "download.py" 下载所需的模型和数据. 10 | 11 | .. code-block:: shell 12 | 13 | python3 download.py mtcnn_fp32.bmodel --save_path ./data 14 | python3 download.py face.jpg --save_path ./data 15 | 16 | 运行C++程序 17 | ^^^^^^^^^^^ 18 | 19 | 请确保您已经按照前述说明执行/workspace/examples/sail/sc5_tests/auto_test.sh,该脚本将编译c++程序生成可执行文件。 20 | 21 | For case 0: 22 | 23 | .. code-block:: shell 24 | 25 | ./build/bin/det_mtcnn \ 26 | --bmodel ./data/mtcnn_fp32_191115.bmodel \ 27 | --input ./data/face.jpg 28 | 29 | 30 | 运行python程序 31 | ^^^^^^^^^^^^^^ 32 | 33 | For case 0: 34 | 35 | .. code-block:: shell 36 | 37 | python3 ./python/det_mtcnn/det_mtcnn.py \ 38 | --bmodel ./data/mtcnn_fp32_191115.bmodel \ 39 | --input ./data/face.jpg -------------------------------------------------------------------------------- /docs/source_zh/demo/yolov3_cases/python.rst: -------------------------------------------------------------------------------- 1 | Python代码解析 2 | ______________ 3 | 4 | Case 0: 使用 opencv 做解码和数据预处理 5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 6 | 7 | 如下,我们使用了一个 while 循环来模拟真实的目标检测业务: 8 | 9 | .. code-block:: python 10 | 11 | # ... 12 | # using opencv cap get video frame 13 | while cap.isOpened(): 14 | 15 | # ... 16 | # get one frame 17 | ret, img = cap.read() 18 | 19 | # ... 20 | # preforward 21 | data = preprocess(img, detected_size) 22 | 23 | # ... 24 | # set input data from host memory 25 | input_data = {input_name: np.array([data], dtype=np.float32)} 26 | 27 | # ... 28 | # forward 29 | output = net.process(graph_name, input_data) 30 | 31 | # ... 32 | # postforward include NMS 33 | bboxes, classes, probs = postprocess(output, img, detected_size, threshold) 34 | 35 | # ... 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /docs/source_zh/get_start/0_hardware.rst: -------------------------------------------------------------------------------- 1 | 算丰硬件产品概览 2 | ================ 3 | 4 | 5 | 我们提供了4种基于自研 AI 芯片的 TPU 产品。 6 | 如果希望了解详细内容,可参考网站: https://www.sophgo.com 7 | 8 | .. toctree:: 9 | :glob: 10 | 11 | hardware/sc 12 | hardware/se 13 | hardware/sa 14 | hardware/sm 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/source_zh/get_start/1_software.rst: -------------------------------------------------------------------------------- 1 | 算丰软件产品概览 2 | ================ 3 | 4 | 针对上一小节中提到的一系列算丰系列TPU产品, 5 | 算能科技自主研发了一套与之匹配的软件工具: 6 | Bitmain Neural Network Software Development Kit(BMNNSDK)。 7 | 8 | 使用算丰TPU产品所需的软件栈完全包含在 BMNNSDK 中。 9 | Sophon Inference 是 BMNNSDK 中的一个上层模块, 10 | 提供了一系列的高级 API 以帮助用户快速部署模型。 11 | 12 | 在本小节中,我们首先总体讲述基于算丰TPU产品的深度学习模型部署的流程。 13 | 然后,我们分别介绍 BMNNSDK 以及 Sophon Inference 的基本概念。 14 | 最后,我们介绍 BMNNSDK 和 Sophon Inference 的安装使用以及相关注意事项。 15 | 16 | 17 | .. toctree:: 18 | :glob: 19 | 20 | software/deploy 21 | software/bmnnsdk 22 | software/si 23 | software/install 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /docs/source_zh/get_start/2_crash_course.rst: -------------------------------------------------------------------------------- 1 | 小试牛刀:模型部署 2 | ================= 3 | 4 | 在本章中,我们将帮助你快速地将一个由 tensorflow 训练生成的 mobilenet 部署到 Sophon SC5 加速卡上。 5 | 在这之前,你需要准备一台安装了 Sophon SC5 加速卡的个人电脑,操作系统建议为 Ubuntu16.04。 6 | 另外,你还需要一份 BMNNSDK 的软件包。软件包可以在官网下载(https://sophon.cn/drive/index.html)或者联系售前以及FAE获取。 7 | 8 | 本教程包含三个步骤。 9 | 首先,你需要安装驱动、bmnett、和sophon-inference。 10 | 这三个模块都在 BMNNSDK 软件包中。 11 | 然后,我们使用 bmnett 工具将 mobilenet 转换成 bmodel。 12 | 最后,我们使用 sophon-inference 把 bmodel 运行起来, 13 | 对一张图片进行分类。 14 | 15 | .. toctree:: 16 | :glob: 17 | 18 | courses/install 19 | courses/convert 20 | courses/deploy 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /docs/source_zh/get_start/3_one_key_deploy.rst: -------------------------------------------------------------------------------- 1 | One-Key Deployment 2 | ================== 3 | 4 | to be added... 5 | -------------------------------------------------------------------------------- /docs/source_zh/get_start/courses/convert.rst: -------------------------------------------------------------------------------- 1 | 使用 bmnett 将 mobilenet 编译为 bmodel 2 | ______________________________________ 3 | 4 | 我们已经在官网上传了一份 tensorflow mobilenet 的模型,直接下载即可: 5 | 6 | .. code-block:: shell 7 | 8 | wget \ 9 | https://sophon-file.sophon.cn/sophon-prod-s3/model/19/05/28/mobilenetv1_tf.tar.gz 10 | tar -zxvf mobilenetv1_tf.tar.gz 11 | 12 | 13 | 然后,使用下面的脚本将模型编译为 bmodel: 14 | 15 | .. code-block:: python 16 | 17 | #!/usr/bin/env python3 18 | import bmnett 19 | 20 | model_path = "mobilenetv1.pb" # path of tensorflow frozen model to be converted. 21 | outdir = "bmodel/" # path of the generated bmodel. 22 | target = "BM1684" # targeted TPU platform, BM1684 or BM1682. 23 | input_names = ["input"] # input operation names. 24 | output_names = ["MobilenetV1/Predictions/Reshape_1"] # output operation names. 25 | shapes = [(1, 224, 224, 3)] # input shapes. 26 | net_name = "mobilenetv1" # name of the generated bmodel. 27 | 28 | bmnett.compile(model_path, outdir, target, \ 29 | input_names, output_names, shapes=shapes, net_name=net_name) 30 | 31 | 32 | 运行结束之后,在上面脚本指定的${outdir}目录下,会生成 compilation.bmodel. 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /docs/source_zh/get_start/courses/deploy.rst: -------------------------------------------------------------------------------- 1 | 使用SAIL驱动TPU加载bmodel并进行推理 2 | ___________________________________ 3 | 4 | 您可以使用如下命令下载测试图片cls.jpg: 5 | 6 | .. code-block:: shell 7 | 8 | wget \ 9 | https://sophon-file.sophon.cn/sophon-prod-s3/model/19/12/05/cls.jpg.tgz 10 | tar -zxvf cls.jpg.tgz 11 | 12 | 13 | 然后,参考下面的程序使用SAIL进行推理: 14 | 15 | .. code-block:: python 16 | 17 | #!/usr/bin/env python3 18 | 19 | import cv2 20 | import numpy as np 21 | import sophon.sail as sail 22 | 23 | # initialize an Engine instance using bmodel. 24 | bmodel = sail.Engine("bmodel/compilation.bmodel", 0, sail.IOMode.SYSIO) 25 | # graph_name is just the net_name in conversion step. 26 | graph_name = bmodel.get_graph_names()[0] 27 | input_tensor_name = bmodel.get_input_names(graph_name)[0] 28 | # why transpose? 29 | # bmodel will always be NCHW layout, 30 | # so, if original tensorflow frozen model is formatted as NHWC, 31 | input_data = {input_tensor_name: \ 32 | np.expand_dims(cv2.resize(cv2.imread("cls.jpg"), (224,224)), 0)} 33 | # do inference 34 | outputs = bmodel.process(graph_name, input_data) 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /docs/source_zh/get_start/hardware/sa.rst: -------------------------------------------------------------------------------- 1 | 算丰服务器(SA)系列 2 | __________________ 3 | .. image:: ../../../images/SA.png 4 | :scale: 50% 5 | :align: center 6 | 7 | 8 | -------------------------------------------------------------------------------- /docs/source_zh/get_start/hardware/sc.rst: -------------------------------------------------------------------------------- 1 | 算丰加速卡(SC)系列 2 | __________________ 3 | .. image:: ../../../images/SC.png 4 | :scale: 50% 5 | :align: center 6 | 7 | -------------------------------------------------------------------------------- /docs/source_zh/get_start/hardware/se.rst: -------------------------------------------------------------------------------- 1 | 算丰边缘端小盒子(SE)系列 2 | ________________________ 3 | .. image:: ../../../images/SE.png 4 | :scale: 50% 5 | :align: center 6 | 7 | 8 | -------------------------------------------------------------------------------- /docs/source_zh/get_start/hardware/sm.rst: -------------------------------------------------------------------------------- 1 | 算丰模组(SM)系列 2 | ________________ 3 | .. image:: ../../../images/sm5.jpg 4 | :scale: 50% 5 | :align: center 6 | -------------------------------------------------------------------------------- /docs/source_zh/get_start/software/deploy.rst: -------------------------------------------------------------------------------- 1 | 模型部署 2 | ________ 3 | 4 | .. image:: ../../../images/sophon_inference.png 5 | 6 | 7 | 模型部署包含两步:模型的离线编译和在线推理。 8 | 上图中包含的软件工具都包含在 BMNNSDK 中。 9 | 10 | **a).模型离线编译** 11 | 12 | 模型的离线编译对应上图中蓝色虚线框中的内容。 13 | 这一过程的目的是把用户在各种框架下训练好的深度学习模型转换成我们定义的模型格式:bmodel。 14 | 目前, 算丰 TPU 包含了 FP32 和 INT8 两种类型的计算单元,因此 bmodel 也分为了 fp32_bmodel 和 int8_bmodel。 15 | 如上图中,经过 tensorflow 训练生成的 xxx.pb 模型可以通过 bmnett 中提供的接口生成 fp32_bmodel; 16 | 也可以先通过我们提供的脚本先生成 fp32_umodel,再通过量化校准工具生成 int8_umodel,最后通过 bmnetu 生成 int8_bmodel。 17 | 目前,我们已经支持了将 Tensorflow、Pytorch、Mxnet、Caffe 四种深度学习框架下训练生成的模型编译成 bmodel。 18 | 这一步骤的完成无需 TPU 的参与,因此是离线的。 19 | 20 | **b).模型在线部署** 21 | 22 | 模型的在线部署对应了上图中红色虚线框中的内容。 23 | bmodel 实际上是一系列算丰 TPU 指令的集合。 24 | 通过使用我们提供的一系列运行时的接口,我们可以把 bmodel 中的指令加载到 TPU 上并执行。 25 | 将 bmodel 加载到 TPU 内存上这一过程类似于将深度学习模型例如 xxx.pb 加载到主机内存的过程。 26 | 加载 bmodel 完成之后,使用运行时的接口将输入张量发送给 TPU 并取出计算后得到的输出张量即是模型的推理过程。 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/source_zh/get_start/software/si.rst: -------------------------------------------------------------------------------- 1 | Sophon Inference 2 | ________________ 3 | 4 | .. image:: ../../../images/sophon_inference.png 5 | 6 | 7 | Sophon Inference 目前主要包含了 SAIL(Sophon Artificial Intelligent Library) 模块。 8 | 我们提供了 python 和 c++ 的接口和示例程序,旨在帮助用户快速将模型部署到算丰 TPU 产品上。 9 | 10 | **SAIL** 11 | :封装了 BMRuntime, BMCV, BMDecoder 等运行时模块。提供了 python 和 c++ 接口。 12 | 可用来: 13 | 14 | a).驱动 TPU 加载 bmodel 并进行推理; 15 | 16 | b).驱动 TPU 进行图像和视频的处理。 17 | 18 | 在线文档: https://sophgo-doc.gitbook.io/sophon-inference/ 19 | -------------------------------------------------------------------------------- /docs/source_zh/module/sail.rst: -------------------------------------------------------------------------------- 1 | SAIL 2 | ==== 3 | 4 | SAIL (Sophon Artificial Intelligent Library)是 Sophon Inference 中的核心模块。 5 | SAIL对 BMNNSDK 中的 BMLib、BMDecoder、BMCV、BMRuntime 进行了封装, 6 | 将 BMNNSDK 中原有的 “加载 bmodel 并驱动 TPU 推理”、“驱动 TPU 做图像处理”、“驱动 VPU 做图像和视频解码”等功能抽象成更为简单的 C++ 接口对外提供; 7 | 并且使用 pybind11 再次封装,提供简洁易用的 python 接口。 8 | 9 | 目前,SAIL 模块中所有的类、枚举、函数都在 “sail” 命名空间下, 10 | 本单元中的文档将向您深入介绍可能用到的 SAIL 中的模块和类。 11 | 核心的类包括: 12 | 13 | * Handle: 14 | 15 | BMNNSDK 中 BMLib 的 bm_handle_t 的包装类,设备句柄,上下文信息,用来和内核驱动交互信息。 16 | 17 | * Tensor: 18 | 19 | BMNNSDK 中 BMLib 的包装类,封装了对 device memory 的管理以及与 system memory 的同步。 20 | 21 | * Engine: 22 | 23 | BMNNSDK 中 BMRuntime 的包装类,可以加载 bmodel 并驱动 TPU 进行推理。 24 | 一个 Engine 实例可以加载一个任意的 bmodel, 25 | 自动地管理输入张量与输出张量对应的内存。 26 | 27 | * Decoder 28 | 29 | 使用VPU解码视频,JPU解码图像,均为硬件解码。 30 | 31 | * Bmcv: 32 | 33 | BMNNSDK 中 BMCV 的包装类,封装了一系列的图像处理函数,可以驱动 TPU 进行图像处理。 34 | 35 | -------------------------------------------------------------------------------- /docs/source_zh/module/sail_cpp.rst: -------------------------------------------------------------------------------- 1 | ../../source_common/api/sail_cpp.rst -------------------------------------------------------------------------------- /docs/source_zh/module/sail_python.rst: -------------------------------------------------------------------------------- 1 | ../../source_common/api/sail_python.rst -------------------------------------------------------------------------------- /git_version: -------------------------------------------------------------------------------- 1 | master -------------------------------------------------------------------------------- /include/tools.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | void model_dryrun(std::string path); 4 | 5 | void multi_tpu_perf(std::string path, std::vector tpu_id_list); 6 | 7 | -------------------------------------------------------------------------------- /modules/algokit/__init__.py: -------------------------------------------------------------------------------- 1 | """sailalgokit source part 2 | """ 3 | -------------------------------------------------------------------------------- /modules/algokit/algo_cv/__init__.py: -------------------------------------------------------------------------------- 1 | """the implementation of computer vision algorithm 2 | """ 3 | -------------------------------------------------------------------------------- /modules/algokit/algo_cv/cls/__init__.py: -------------------------------------------------------------------------------- 1 | """the implementation of computer vision 2 | classification&&recognition algorithm 3 | 4 | General classification 5 | General feature extraction 6 | ... 7 | """ 8 | -------------------------------------------------------------------------------- /modules/algokit/algo_cv/det/__init__.py: -------------------------------------------------------------------------------- 1 | """the implementation of computer vision detection algorithm 2 | 3 | Detection type: 4 | Object detection 5 | Face detection 6 | Pedestrian detection 7 | """ 8 | -------------------------------------------------------------------------------- /modules/algokit/algo_cv/seg/__init__.py: -------------------------------------------------------------------------------- 1 | """the implementation of computer vision segmentation algorithm 2 | """ 3 | -------------------------------------------------------------------------------- /modules/algokit/algo_nlp/__init__.py: -------------------------------------------------------------------------------- 1 | """the implementation of natural language processing algorithm 2 | """ 3 | -------------------------------------------------------------------------------- /modules/algokit/algo_speech/__init__.py: -------------------------------------------------------------------------------- 1 | """the implementation of speech algorithm 2 | """ 3 | -------------------------------------------------------------------------------- /modules/algokit/algofactory/__init__.py: -------------------------------------------------------------------------------- 1 | """Algorithm Factory 2 | """ 3 | -------------------------------------------------------------------------------- /modules/algokit/engine/autodeployconfig/deeplabv3_mobilenetv2_tf.json: -------------------------------------------------------------------------------- 1 | { 2 | "source_path": "deeplabv3_mobilenetv2_tf", 3 | "subgraph_path": "deeplabv3_mobilenetv2_tf/subgraph", 4 | "tfmodel_path": "deeplabv3_mobilenetv2_tf/deeplabv3_mobilenetv2.pb", 5 | "framework": "tensorflow", 6 | "input_names": ["ImageTensor:0"], 7 | "output_names": ["SemanticPredictions:0"], 8 | "layout": "NHWC", 9 | "is_dynamic": false, 10 | "input_shapes": [[1, 513, 513, 3]] 11 | } 12 | -------------------------------------------------------------------------------- /modules/algokit/engine/autodeployconfig/fasterrcnn_resnet50_tf.json: -------------------------------------------------------------------------------- 1 | { 2 | "source_path": "fasterrcnn_resnet50_tf", 3 | "subgraph_path": "fasterrcnn_resnet50_tf/subgraph", 4 | "tfmodel_path": "fasterrcnn_resnet50_tf/fasterrcnn_resnet50.pb", 5 | "framework": "tensorflow", 6 | "input_names": ["image_tensor:0"], 7 | "output_names": ["num_detections:0", "detection_classes:0", "detection_boxes:0", "detection_scores:0"], 8 | "layout": "NHWC", 9 | "is_dynamic": false, 10 | "input_shapes": [[1, 600, 800, 3]] 11 | } 12 | -------------------------------------------------------------------------------- /modules/algokit/engine/autodeployconfig/yolov3_mx.json: -------------------------------------------------------------------------------- 1 | { 2 | "source_path": "yolov3_mx", 3 | "subgraph_path": "yolov3_mx/subgraph", 4 | "json_path": "yolov3_mx/yolo3_darknet53_coco-symbol.json", 5 | "params_path": "yolov3_mx/yolo3_darknet53_coco-0000.params", 6 | "framework": "mxnet", 7 | "input_names": ["data"], 8 | "output_names": ["yolov30_slice_axis1", "yolov30_slice_axis2", "yolov30_slice_axis3"], 9 | "input_shapes": [[1, 3, 512, 672]] 10 | } 11 | -------------------------------------------------------------------------------- /modules/algokit/engine/engineconfig/fasterrcnn_vgg.json: -------------------------------------------------------------------------------- 1 | { 2 | "stage1": { 3 | "arch": { 4 | "context_path": "fasterrcnn_vgg_ir/stage1_ir/compilation.bmodel", 5 | "is_dynamic": false, 6 | "tpus": "0", 7 | "input_names": ["data"], 8 | "output_names": ["conv5_3_output", "rpn_bbox_pred", "rpn_cls_prob_reshape"], 9 | "input_shapes": [[1, 3, 600, 800]] 10 | } 11 | }, 12 | "stage2": { 13 | "arch": { 14 | "context_path": "fasterrcnn_vgg_ir/stage2_ir/compilation.bmodel", 15 | "is_dynamic": true, 16 | "tpus": "0", 17 | "input_names": ["conv5_3_input", "rois"], 18 | "output_names": ["bbox_pred", "cls_prob"], 19 | "input_shapes": [[1, 512, 38, 50], [32, 5]] 20 | } 21 | }, 22 | "xform": [["submean", [102.9801, 115.9465, 122.7717]],["transpose", [2, 0, 1]]] 23 | } 24 | -------------------------------------------------------------------------------- /modules/algokit/engine/engineconfig/googlenet.json: -------------------------------------------------------------------------------- 1 | { 2 | "arch": { 3 | "context_path": "googlenet_ir/compilation.bmodel", 4 | "is_dynamic": false, 5 | "tpus": "0", 6 | "input_names": ["data"], 7 | "output_names": ["prob"], 8 | "input_shapes": [[1, 3, 224, 224]] 9 | }, 10 | "xform": [["resize", [224, 224]], ["submean", [104.00698853, 116.66876984, 122.67891693]], ["transpose", [2, 0, 1]]] 11 | } 12 | -------------------------------------------------------------------------------- /modules/algokit/engine/engineconfig/mobilenetssd.json: -------------------------------------------------------------------------------- 1 | { 2 | "arch": { 3 | "context_path": "mobilenetssd_ir/compilation.bmodel", 4 | "is_dynamic": false, 5 | "tpus": "0", 6 | "input_names": ["data"], 7 | "output_names": ["mbox_conf_flatten", "mbox_loc", "mbox_priorbox"], 8 | "input_shapes": [[1, 3, 300, 300]] 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /modules/algokit/engine/engineconfig/mobilenetv1.json: -------------------------------------------------------------------------------- 1 | { 2 | "arch": { 3 | "context_path": "mobilenetv1_ir/compilation.bmodel", 4 | "is_dynamic": false, 5 | "tpus": "0", 6 | "input_names": ["data"], 7 | "output_names": ["fc7"], 8 | "input_shapes": [[1, 3, 224, 224]] 9 | }, 10 | "xform": [["resize", [224, 224]], ["submean", [104.00698853, 116.66876984, 122.67891693]], ["transpose", [2, 0, 1]], ["scale", 0.017]] 11 | } 12 | -------------------------------------------------------------------------------- /modules/algokit/engine/engineconfig/mobilenetv1_tf.json: -------------------------------------------------------------------------------- 1 | { 2 | "arch": { 3 | "context_path": "mobilenetv1_tf_ir/compilation.bmodel", 4 | "is_dynamic": false, 5 | "tpus": "0", 6 | "input_names": ["_arg_input_0_0"], 7 | "output_names": ["MobilenetV1/Predictions/Reshape_1"], 8 | "input_shapes": [[1, 3, 224, 224]] 9 | }, 10 | "xform": [["resize", [224, 224]], ["submean", [127.5, 127.5, 127.5]], ["transpose", [2, 0, 1]], ["bgr2rgb", true], ["scale", 0.007843]] 11 | } 12 | -------------------------------------------------------------------------------- /modules/algokit/engine/engineconfig/mobilenetyolov3.json: -------------------------------------------------------------------------------- 1 | { 2 | "arch": { 3 | "context_path": "mobilenetyolov3_ir/compilation.bmodel", 4 | "is_dynamic": false, 5 | "tpus": "0", 6 | "input_names": ["data"], 7 | "output_names": ["conv22", "conv23", "conv24"], 8 | "input_shapes": [[1, 3, 416, 416]] 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /modules/algokit/engine/engineconfig/mtcnn.json: -------------------------------------------------------------------------------- 1 | { 2 | "pnet": { 3 | "arch": { 4 | "context_path": "mtcnn_ir/det1_ir/compilation.bmodel", 5 | "is_dynamic": true, 6 | "tpus": "0", 7 | "input_names": ["data"], 8 | "output_names": ["conv4-2", "prob1"], 9 | "input_shapes": [[1, 3, 576, 324]] 10 | } 11 | }, 12 | "rnet": { 13 | "arch": { 14 | "context_path": "mtcnn_ir/det2_ir/compilation.bmodel", 15 | "is_dynamic": true, 16 | "tpus": "0", 17 | "input_names": ["data"], 18 | "output_names": ["conv5-2", "prob1"], 19 | "input_shapes": [[128, 3, 24, 24]] 20 | } 21 | }, 22 | "onet": { 23 | "arch": { 24 | "context_path": "mtcnn_ir/det3_ir/compilation.bmodel", 25 | "is_dynamic": true, 26 | "tpus": "0", 27 | "input_names": ["data"], 28 | "output_names": ["conv6-2", "conv6-3", "prob1"], 29 | "input_shapes": [[128, 3, 48, 48]] 30 | } 31 | }, 32 | "xform": [["submean", 127.5], ["scale", 0.0078125]] 33 | } 34 | -------------------------------------------------------------------------------- /modules/algokit/engine/engineconfig/resnet50.json: -------------------------------------------------------------------------------- 1 | { 2 | "arch": { 3 | "context_path": "resnet50_ir/compilation.bmodel", 4 | "is_dynamic": false, 5 | "tpus": "0", 6 | "input_names": ["data"], 7 | "output_names": ["prob"], 8 | "input_shapes": [[1, 3, 224, 224]] 9 | }, 10 | "xform": [["resize", [224, 224]], ["submean", [104.00698853, 116.66876984, 122.67891693]], ["transpose", [2, 0, 1]]] 11 | } 12 | -------------------------------------------------------------------------------- /modules/algokit/engine/engineconfig/resnet50_pt.json: -------------------------------------------------------------------------------- 1 | { 2 | "arch": { 3 | "context_path": "resnet50_pt_ir/compilation.bmodel", 4 | "is_dynamic": false, 5 | "tpus": "0", 6 | "input_names": ["730"], 7 | "output_names": ["729"], 8 | "input_shapes": [[1, 3, 224, 224]] 9 | }, 10 | "xform": [["resize", [224, 224]], ["transpose", [2, 0, 1]], ["bgr2rgb", true]] 11 | } 12 | -------------------------------------------------------------------------------- /modules/algokit/engine/engineconfig/resnext50_mx.json: -------------------------------------------------------------------------------- 1 | { 2 | "arch": { 3 | "context_path": "resnext50_mx_ir/compilation.bmodel", 4 | "is_dynamic": false, 5 | "tpus": "0", 6 | "input_names": ["data"], 7 | "output_names": ["resnext0_dense0_fwd_output"], 8 | "input_shapes": [[1, 3, 224, 224]] 9 | }, 10 | "xform": [["resize", [224, 224]], ["transpose", [2, 0, 1]], ["bgr2rgb", true]] 11 | } 12 | -------------------------------------------------------------------------------- /modules/algokit/engine/engineconfig/ssh.json: -------------------------------------------------------------------------------- 1 | { 2 | "ssh": { 3 | "arch": { 4 | "context_path": "ssh_ir/sshdet_ir/compilation.bmodel", 5 | "is_dynamic": false, 6 | "tpus": "0", 7 | "input_names": ["data"], 8 | "output_names": ["m1@ssh_bbox_pred_output", 9 | "m1@ssh_cls_prob_reshape_output", 10 | "m2@ssh_bbox_pred_output", 11 | "m2@ssh_cls_prob_reshape_output", 12 | "m3@ssh_bbox_pred_output", 13 | "m3@ssh_cls_prob_reshape_output"], 14 | "input_shapes": [[1, 3, 600, 800]] 15 | } 16 | }, 17 | "onet": { 18 | "arch": { 19 | "context_path": "ssh_ir/det3_ir/compilation.bmodel", 20 | "is_dynamic": true, 21 | "tpus": "0", 22 | "input_names": ["data"], 23 | "output_names": ["conv6-2", "conv6-3", "prob1"], 24 | "input_shapes": [[128, 3, 48, 48]] 25 | } 26 | }, 27 | "ssh_xform": [["submean", [102.9801, 115.9465, 122.7717]], ["transpose", [2, 0, 1]]], 28 | "onet_xform": [["submean", 127.5], ["scale", 0.0078125]] 29 | } 30 | -------------------------------------------------------------------------------- /modules/algokit/engine/engineconfig/vgg16.json: -------------------------------------------------------------------------------- 1 | { 2 | "arch": { 3 | "context_path": "vgg16_ir/compilation.bmodel", 4 | "is_dynamic": false, 5 | "tpus": "0", 6 | "input_names": ["data"], 7 | "output_names": ["prob"], 8 | "input_shapes": [[1, 3, 224, 224]] 9 | }, 10 | "xform": [["resize", [224, 224]], ["submean", [104.00698853, 116.66876984, 122.67891693]], ["transpose", [2, 0, 1]]] 11 | } 12 | -------------------------------------------------------------------------------- /modules/algokit/engine/engineconfig/yolov3.json: -------------------------------------------------------------------------------- 1 | { 2 | "arch": { 3 | "context_path": "yolov3_ir/compilation.bmodel", 4 | "is_dynamic": false, 5 | "tpus": "0", 6 | "input_names": ["data"], 7 | "output_names": ["layer82-conv", "layer94-conv", "layer106-conv"], 8 | "input_shapes": [[1, 3, 416, 416]] 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /modules/algokit/libs/__init__.py: -------------------------------------------------------------------------------- 1 | """The Dependent libraries of sailalgokit 2 | """ 3 | -------------------------------------------------------------------------------- /modules/algokit/libs/extend_layer/__init__.py: -------------------------------------------------------------------------------- 1 | """implementation of some extend layers (optimize) 2 | 3 | Region Proposal layer: 4 | face detection ssh 5 | object detection faster_rcnn 6 | """ 7 | -------------------------------------------------------------------------------- /modules/algokit/libs/extend_layer/base_layer.py: -------------------------------------------------------------------------------- 1 | # Copyright 2016-2022 Bitmain Technologies Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """ The extend base layer 16 | 17 | Which include some commom operations 18 | """ 19 | from abc import ABCMeta, abstractmethod 20 | import six 21 | from ...utils.timer import Timer 22 | 23 | 24 | @six.add_metaclass(ABCMeta) 25 | class BaseLayer(object): 26 | """Contruct a BaseLayer 27 | """ 28 | 29 | def __init__(self): 30 | self.time = Timer() 31 | 32 | @abstractmethod 33 | def forward(self): 34 | """extend layer forward 35 | """ 36 | raise NotImplementedError 37 | -------------------------------------------------------------------------------- /modules/algokit/utils/__init__.py: -------------------------------------------------------------------------------- 1 | """Some utilities 2 | """ 3 | -------------------------------------------------------------------------------- /modules/algokit/utils/timer.py: -------------------------------------------------------------------------------- 1 | # Copyright 2016-2022 Bitmain Technologies Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """Calculate running time 16 | """ 17 | import time 18 | 19 | 20 | class Timer(object): 21 | """Algorithm runtime calculation class 22 | """ 23 | 24 | def __init__(self): 25 | self.start = 0 26 | self.end = 0 27 | self.times = 0 28 | self.total_time = 0 29 | 30 | def tic(self): 31 | """get start time 32 | """ 33 | self.start = time.time() 34 | 35 | def toc(self): 36 | """get end time 37 | """ 38 | self.end = time.time() 39 | self.total_time += (self.end - self.start) 40 | self.times += 1 41 | -------------------------------------------------------------------------------- /modules/auto_runner/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/modules/auto_runner/__init__.py -------------------------------------------------------------------------------- /modules/auto_runner/common/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/modules/auto_runner/common/__init__.py -------------------------------------------------------------------------------- /modules/auto_runner/external/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/modules/auto_runner/external/__init__.py -------------------------------------------------------------------------------- /modules/auto_runner/runner/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/modules/auto_runner/runner/__init__.py -------------------------------------------------------------------------------- /modules/auto_split/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/modules/auto_split/__init__.py -------------------------------------------------------------------------------- /modules/auto_split/common/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/modules/auto_split/common/__init__.py -------------------------------------------------------------------------------- /modules/auto_split/compiler/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/modules/auto_split/compiler/__init__.py -------------------------------------------------------------------------------- /modules/auto_split/external/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/modules/auto_split/external/__init__.py -------------------------------------------------------------------------------- /modules/auto_split/external/caffe_functions.py: -------------------------------------------------------------------------------- 1 | """ Copyright 2016-2022 by Bitmain Technologies Inc. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | """ 15 | 16 | 17 | def get_unsupported_caffe_layers(proto_path): 18 | """ return unsupported layers in caffe prototxt 19 | A List. 20 | """ 21 | ret = list() 22 | return ret 23 | -------------------------------------------------------------------------------- /modules/auto_split/external/pytorch_functions.py: -------------------------------------------------------------------------------- 1 | """ Copyright 2016-2022 by Bitmain Technologies Inc. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | """ 15 | 16 | 17 | def get_unsupported_pytorch_ops(model_path): 18 | """ return unsupported layers in caffe prototxt 19 | A List. 20 | """ 21 | ret = list() 22 | return ret 23 | -------------------------------------------------------------------------------- /modules/auto_split/splitter/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/modules/auto_split/splitter/__init__.py -------------------------------------------------------------------------------- /modules/utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/modules/utils/__init__.py -------------------------------------------------------------------------------- /modules/utils/dryrun.py: -------------------------------------------------------------------------------- 1 | if __name__ == '__main__': 2 | import sys 3 | import sophon.sail as sail 4 | sail._dryrun(sys.argv[1]) 5 | -------------------------------------------------------------------------------- /modules/utils/perf.py: -------------------------------------------------------------------------------- 1 | if __name__ == '__main__': 2 | import sys 3 | import sophon.sail as sail 4 | bmodel_path = sys.argv[1] 5 | try: 6 | tpu_id_list = list(map(int, sys.argv[2].split(','))) 7 | except: 8 | print('please check input tpu id format, e.g. 1,2,3') 9 | sys.exit(-1) 10 | tpu_count = sail.get_available_tpu_num() 11 | tpu_id_list = list(set(tpu_id_list)) 12 | tpu_id_list = list(filter(lambda x: 0 <= x < tpu_count, tpu_id_list)) 13 | print('---------- {} -----------'.format(tpu_id_list)) 14 | sail._perf(bmodel_path, tpu_id_list) 15 | -------------------------------------------------------------------------------- /modules/utils/version.py: -------------------------------------------------------------------------------- 1 | version_list=\ 2 | [ 3 | '191115', 4 | ] 5 | __version__ = version_list[0] 6 | -------------------------------------------------------------------------------- /python/arm_pcie/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include sophon/*.so 2 | include sophon/utils/*.json 3 | include sophon/algokit/engine/autodeployconfig/*.json 4 | include sophon/algokit/engine/engineconfig/*.json -------------------------------------------------------------------------------- /python/arm_pcie/sophon/__init__.py: -------------------------------------------------------------------------------- 1 | """sophon python module 2 | """ 3 | -------------------------------------------------------------------------------- /python/arm_pcie/sophon/algokit: -------------------------------------------------------------------------------- 1 | ../../../modules/algokit/ -------------------------------------------------------------------------------- /python/arm_pcie/sophon/auto_runner: -------------------------------------------------------------------------------- 1 | ../../../modules/auto_runner/ -------------------------------------------------------------------------------- /python/arm_pcie/sophon/utils: -------------------------------------------------------------------------------- 1 | ../../../modules/utils/ -------------------------------------------------------------------------------- /python/arm_pcie/sophon_arm_pcie_whl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # wrap arm_pcie new version 4 | python3 setup.py bdist_wheel 5 | if [[ $? != 0 ]];then 6 | echo "Failed to build sophon wheel" 7 | exit 1 8 | fi 9 | echo "---- setup sophon wheel" 10 | rm -rf ./sophon.egg-info ./build 11 | 12 | -------------------------------------------------------------------------------- /python/loongarch64/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include sophon/*.so 2 | include sophon/utils/*.json 3 | include sophon/algokit/engine/autodeployconfig/*.json 4 | include sophon/algokit/engine/engineconfig/*.json -------------------------------------------------------------------------------- /python/loongarch64/sophon/__init__.py: -------------------------------------------------------------------------------- 1 | """sophon python module 2 | """ 3 | -------------------------------------------------------------------------------- /python/loongarch64/sophon/algokit: -------------------------------------------------------------------------------- 1 | ../../../modules/algokit/ -------------------------------------------------------------------------------- /python/loongarch64/sophon/auto_runner: -------------------------------------------------------------------------------- 1 | ../../../modules/auto_runner/ -------------------------------------------------------------------------------- /python/loongarch64/sophon/utils: -------------------------------------------------------------------------------- 1 | ../../../modules/utils/ -------------------------------------------------------------------------------- /python/loongarch64/sophon_loongarch64_whl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # wrap loongarch64_pcie new version 4 | python3 setup.py bdist_wheel 5 | if [[ $? != 0 ]];then 6 | echo "Failed to build sophon wheel" 7 | exit 1 8 | fi 9 | echo "---- setup sophon wheel" 10 | rm -rf ./sophon.egg-info ./build 11 | 12 | -------------------------------------------------------------------------------- /python/mips64/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include sophon/*.so 2 | include sophon/utils/*.json 3 | include sophon/algokit/engine/autodeployconfig/*.json 4 | include sophon/algokit/engine/engineconfig/*.json -------------------------------------------------------------------------------- /python/mips64/sophon/__init__.py: -------------------------------------------------------------------------------- 1 | """sophon python module 2 | """ 3 | -------------------------------------------------------------------------------- /python/mips64/sophon/algokit: -------------------------------------------------------------------------------- 1 | ../../../modules/algokit/ -------------------------------------------------------------------------------- /python/mips64/sophon/auto_runner: -------------------------------------------------------------------------------- 1 | ../../../modules/auto_runner/ -------------------------------------------------------------------------------- /python/mips64/sophon/utils: -------------------------------------------------------------------------------- 1 | ../../../modules/utils/ -------------------------------------------------------------------------------- /python/mips64/sophon_mips64_whl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # wrap arm_pcie new version 4 | python3 setup.py bdist_wheel 5 | if [[ $? != 0 ]];then 6 | echo "Failed to build sophon wheel" 7 | exit 1 8 | fi 9 | echo "---- setup sophon wheel" 10 | rm -rf ./sophon.egg-info ./build 11 | 12 | -------------------------------------------------------------------------------- /python/pcie/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include sophon/*.so 2 | include sophon/utils/*.json 3 | include sophon/algokit/engine/autodeployconfig/*.json 4 | include sophon/algokit/engine/engineconfig/*.json 5 | 6 | -------------------------------------------------------------------------------- /python/pcie/install_sophon.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "install sophon python library (default: python3)" 4 | 5 | # rm old version 6 | pip3 uninstall sophon -y 7 | echo "---- uninstall old sophon if exists" 8 | # wrap new version 9 | python3 setup.py bdist_wheel 10 | if [[ $? != 0 ]];then 11 | echo "Failed to build sophon wheel" 12 | exit 1 13 | fi 14 | echo "---- setup sophon wheel" 15 | # install new version 16 | pip3 install ./dist/sophon-2.0.2-py3-none-any.whl --user 17 | echo "---- install sophon" 18 | # rm intermediate file 19 | rm -rf ./sophon.egg-info ./build 20 | 21 | -------------------------------------------------------------------------------- /python/pcie/sophon/__init__.py: -------------------------------------------------------------------------------- 1 | """sophon python module 2 | """ 3 | -------------------------------------------------------------------------------- /python/pcie/sophon/algokit: -------------------------------------------------------------------------------- 1 | ../../sophon/algokit -------------------------------------------------------------------------------- /python/pcie/sophon/auto_runner: -------------------------------------------------------------------------------- 1 | ../../sophon/auto_runner -------------------------------------------------------------------------------- /python/pcie/sophon/auto_split: -------------------------------------------------------------------------------- 1 | ../../sophon/auto_split -------------------------------------------------------------------------------- /python/pcie/sophon/utils: -------------------------------------------------------------------------------- 1 | ../../sophon/utils -------------------------------------------------------------------------------- /python/pcie/sophon_pcie_whl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # wrap pcie new version 4 | python3 setup.py bdist_wheel 5 | if [[ $? != 0 ]];then 6 | echo "Failed to build sophon wheel" 7 | exit 1 8 | fi 9 | echo "---- setup sophon wheel" 10 | rm -rf ./sophon.egg-info ./build 11 | 12 | -------------------------------------------------------------------------------- /python/setup_dev_python_path.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # soft link sail 4 | echo "link sail python lib" 5 | 6 | pushd ./sophon 7 | 8 | if [ -f "../../build/lib/sail.cpython-35m-x86_64-linux-gnu.so" ];then 9 | rm -f ./sail.cpython-35m-x86_64-linux-gnu.so 10 | cp ../../build/lib/sail.cpython-35m-x86_64-linux-gnu.so ./sail.cpython-35m-x86_64-linux-gnu.so 11 | fi 12 | if [ -f "../../build/lib/sail.cpython-36m-x86_64-linux-gnu.so" ];then 13 | rm -f ./sail.cpython-36m-x86_64-linux-gnu.so 14 | cp ../../build/lib/sail.cpython-36m-x86_64-linux-gnu.so ./sail.cpython-36m-x86_64-linux-gnu.so 15 | fi 16 | 17 | if [ -f "../../build/lib/sail.cpython-35m-aarch64-linux-gnu.so" ];then 18 | rm -f ./sail.cpython-35m-aarch64-linux-gnu.so 19 | cp ../../build/lib/sail.cpython-35m-aarch64-linux-gnu.so ./sail.cpython-35m-aarch64-linux-gnu.so 20 | fi 21 | 22 | popd 23 | 24 | # add autodeploy && algokit 25 | export PYTHONPATH=$PYTHONPATH:${PWD}:${PWD}/sophon 26 | -------------------------------------------------------------------------------- /python/soc/arm/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include sophon/*.so 2 | include sophon/utils/*.json 3 | include sophon/algokit/engine/autodeployconfig/*.json 4 | include sophon/algokit/engine/engineconfig/*.json -------------------------------------------------------------------------------- /python/soc/arm/sophon/__init__.py: -------------------------------------------------------------------------------- 1 | """sophon python module 2 | """ 3 | -------------------------------------------------------------------------------- /python/soc/arm/sophon/algokit: -------------------------------------------------------------------------------- 1 | ../../../../modules/algokit -------------------------------------------------------------------------------- /python/soc/arm/sophon/auto_runner: -------------------------------------------------------------------------------- 1 | ../../../../modules/auto_runner/ -------------------------------------------------------------------------------- /python/soc/arm/sophon/utils: -------------------------------------------------------------------------------- 1 | ../../../../modules/utils -------------------------------------------------------------------------------- /python/soc/sophon_soc_whl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # wrap x86 new version 4 | pushd ./x86 5 | python3 setup_x86.py bdist_wheel 6 | if [[ $? != 0 ]];then 7 | echo "Failed to build sophon wheel" 8 | exit 1 9 | fi 10 | echo "---- setup sophon x86 wheel" 11 | # rm intermediate file 12 | rm -rf ./sophon_x86.egg-info ./build 13 | popd 14 | 15 | # wrap arm new version 16 | pushd ./arm 17 | python3 setup_arm.py bdist_wheel 18 | if [[ $? != 0 ]];then 19 | echo "Failed to build sophon wheel" 20 | exit 1 21 | fi 22 | echo "---- setup sophon arm wheel" 23 | # rm intermediate file 24 | rm -rf ./sophon_arm.egg-info ./build 25 | popd 26 | -------------------------------------------------------------------------------- /python/soc/x86/setup_x86.py: -------------------------------------------------------------------------------- 1 | ''' 2 | Setup file for sophon 3 | ''' 4 | from __future__ import print_function 5 | import os 6 | import shutil 7 | from distutils.core import setup, Extension 8 | from setuptools import find_packages 9 | 10 | # sophon_x86 python module 11 | PACKAGES_X86 = ['sophon', 'sophon.auto_split', 'sophon.auto_split.common', 12 | 'sophon.auto_split.compiler', 'sophon.auto_split.external', 13 | 'sophon.auto_split.splitter'] 14 | 15 | filehandle = open("../../../git_version","r"); 16 | git_version = filehandle.readline(); 17 | print(git_version); 18 | 19 | # wrap sophon python module 20 | setup(name='sophon_x86', 21 | version=git_version, 22 | description='Inference samples for deep learning on Sophon products.', 23 | author='Sophon algorithm team', 24 | author_email='hong.liu@bitmain.com', 25 | url='https://git.bitmain.vip/ai-algorithm/sophon-inference', 26 | long_description=''' 27 | Guide to deploying deep-learning inference networks and deep vision primitives on Sophon TPU. 28 | ''', 29 | packages=PACKAGES_X86, 30 | include_package_data=False) 31 | -------------------------------------------------------------------------------- /python/soc/x86/sophon/__init__.py: -------------------------------------------------------------------------------- 1 | """sophon python module 2 | """ 3 | -------------------------------------------------------------------------------- /python/soc/x86/sophon/auto_split: -------------------------------------------------------------------------------- 1 | ../../../../modules/auto_split -------------------------------------------------------------------------------- /python/sophon/__init__.py: -------------------------------------------------------------------------------- 1 | """sophon python module 2 | """ 3 | -------------------------------------------------------------------------------- /python/sophon/algokit: -------------------------------------------------------------------------------- 1 | ../../modules/algokit/ -------------------------------------------------------------------------------- /python/sophon/auto_runner: -------------------------------------------------------------------------------- 1 | ../../modules/auto_runner/ -------------------------------------------------------------------------------- /python/sophon/auto_split: -------------------------------------------------------------------------------- 1 | ../../modules/auto_split -------------------------------------------------------------------------------- /python/sophon/utils: -------------------------------------------------------------------------------- 1 | ../../modules/utils/ -------------------------------------------------------------------------------- /python/sw64/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include sophon/*.so 2 | include sophon/utils/*.json 3 | include sophon/algokit/engine/autodeployconfig/*.json 4 | include sophon/algokit/engine/engineconfig/*.json -------------------------------------------------------------------------------- /python/sw64/sophon/__init__.py: -------------------------------------------------------------------------------- 1 | """sophon python module 2 | """ 3 | -------------------------------------------------------------------------------- /python/sw64/sophon/algokit: -------------------------------------------------------------------------------- 1 | ../../../modules/algokit/ -------------------------------------------------------------------------------- /python/sw64/sophon/auto_runner: -------------------------------------------------------------------------------- 1 | ../../../modules/auto_runner/ -------------------------------------------------------------------------------- /python/sw64/sophon/utils: -------------------------------------------------------------------------------- 1 | ../../../modules/utils/ -------------------------------------------------------------------------------- /python/sw64/sophon_sw64_whl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # wrap arm_pcie new version 4 | python3 setup.py bdist_wheel 5 | if [[ $? != 0 ]];then 6 | echo "Failed to build sophon wheel" 7 | exit 1 8 | fi 9 | echo "---- setup sophon wheel" 10 | rm -rf ./sophon.egg-info ./build 11 | 12 | -------------------------------------------------------------------------------- /python/winx64/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include sophon/*.pyd 2 | include sophon/*.dll 3 | include sophon/utils/*.json 4 | include sophon/algokit/engine/autodeployconfig/*.json 5 | include sophon/algokit/engine/engineconfig/*.json 6 | 7 | -------------------------------------------------------------------------------- /python/winx64/install_sophon.bat: -------------------------------------------------------------------------------- 1 | 2 | echo "install sophon python library (default: python3)" 3 | 4 | :: remove old version 5 | pip3 uninstall sophon -y 6 | echo "---- uninstall old sophon if exists" 7 | # wrap new version 8 | python setup.py bdist_wheel 9 | if %errorlevel% equ 1 ( 10 | echo "Failed to build sophon wheel" 11 | exit 1 12 | ) 13 | 14 | echo "---- setup sophon wheel" 15 | :: install new version 16 | pip3 install ./dist/sophon-master-py3-none-any.whl --user 17 | echo "---- install sophon" 18 | :: rm intermediate file 19 | rd /q /s ./sophon.egg-info ./build 20 | 21 | -------------------------------------------------------------------------------- /python/winx64/sophon/__init__.py: -------------------------------------------------------------------------------- 1 | """sailalgokit source part 2 | """ 3 | -------------------------------------------------------------------------------- /python/winx64/sophon_pcie_whl.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | :: wrap pcie new version 4 | python setup.py bdist_wheel 5 | if %errorlevel% equ 1 ( 6 | echo "Failed to build sophon wheel" 7 | exit /B 1 8 | ) 9 | 10 | echo "---- setup sophon wheel" 11 | rd /q /s .\sophon.egg-info 12 | rd /q /s .\build 13 | 14 | -------------------------------------------------------------------------------- /release/qa_test/sc5_tests/cmake/arm/FindOpenCV.cmake: -------------------------------------------------------------------------------- 1 | message(STATUS "Finding Bitmain OpenCV") 2 | set(OpenCV_COMPONENTS 3 | opencv_calib3d 4 | opencv_core 5 | opencv_dnn 6 | opencv_features2d 7 | opencv_flann 8 | opencv_gapi 9 | opencv_highgui 10 | opencv_imgcodecs 11 | opencv_imgproc 12 | opencv_ml 13 | opencv_objdetect 14 | opencv_photo 15 | opencv_stitching 16 | opencv_video 17 | opencv_videoio) 18 | set(OpenCV_INCLUDE_DIRS 19 | "$ENV{REL_TOP}/include/opencv/opencv4") 20 | message(STATUS ${OpenCV_INCLUDE_DIRS}) 21 | foreach(ITEM ${OpenCV_COMPONENTS}) 22 | list(APPEND OpenCV_LIBRARIES "$ENV{REL_TOP}/lib/opencv/arm_pcie/lib${ITEM}.so") 23 | endforeach() 24 | if(OpenCV_INCLUDE_DIRS AND OpenCV_LIBRARIES) 25 | set(OpenCV_FOUND TRUE) 26 | message(STATUS "Bitmain OpenCV found") 27 | else(OpenCV_INCLUDE_DIRS AND OpenCV_LIBRARIES) 28 | message(STATUS "Bitmain OpenCV not found") 29 | endif(OpenCV_INCLUDE_DIRS AND OpenCV_LIBRARIES) 30 | -------------------------------------------------------------------------------- /release/qa_test/sc5_tests/cmake/x86/FindOpenCV.cmake: -------------------------------------------------------------------------------- 1 | message(STATUS "Finding Bitmain OpenCV") 2 | set(OpenCV_COMPONENTS 3 | opencv_calib3d 4 | opencv_core 5 | opencv_dnn 6 | opencv_features2d 7 | opencv_flann 8 | opencv_gapi 9 | opencv_highgui 10 | opencv_imgcodecs 11 | opencv_imgproc 12 | opencv_ml 13 | opencv_objdetect 14 | opencv_photo 15 | opencv_stitching 16 | opencv_video 17 | opencv_videoio) 18 | set(OpenCV_INCLUDE_DIRS 19 | "$ENV{REL_TOP}/include/opencv/opencv4") 20 | message(STATUS ${OpenCV_INCLUDE_DIRS}) 21 | foreach(ITEM ${OpenCV_COMPONENTS}) 22 | list(APPEND OpenCV_LIBRARIES "$ENV{REL_TOP}/lib/opencv/x86/lib${ITEM}.so") 23 | endforeach() 24 | if(OpenCV_INCLUDE_DIRS AND OpenCV_LIBRARIES) 25 | set(OpenCV_FOUND TRUE) 26 | message(STATUS "Bitmain OpenCV found") 27 | else(OpenCV_INCLUDE_DIRS AND OpenCV_LIBRARIES) 28 | message(STATUS "Bitmain OpenCV not found") 29 | endif(OpenCV_INCLUDE_DIRS AND OpenCV_LIBRARIES) 30 | -------------------------------------------------------------------------------- /release/qa_test/sc5_tests/cpp/cls_resnet/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # find opencv 2 | find_package(OpenCV 3 REQUIRED) 3 | # include 4 | include_directories(${BMSDK_INCLUDE_DIRS} 5 | ${OpenCV_INCLUDE_DIRS} 6 | ${PROJECT_SOURCE_DIR}/include) 7 | link_directories(${OpenCV_LIBRARY_DIRS}) 8 | # bm lib path 9 | link_libraries(pthread ${BMNNSDK2_LIBRARIES} ${OpenCV_LIBRARIES} ${SAIL_LIBRARY}) 10 | 11 | # build executable 12 | add_executable(cls_resnet_0 processor.cpp cls_resnet_0.cpp) 13 | add_executable(cls_resnet_1 processor.cpp cls_resnet_1.cpp) 14 | add_executable(cls_resnet_2 processor.cpp cls_resnet_2.cpp) 15 | add_executable(cls_resnet_3 processor.cpp cls_resnet_3.cpp) 16 | -------------------------------------------------------------------------------- /release/qa_test/sc5_tests/cpp/cls_resnet/verify_files/verify_resnet50.ini: -------------------------------------------------------------------------------- 1 | [resnet50_fp32] 2 | top_1 = 65 ; 3 | top_2 = 54 ; 4 | top_3 = 58 ; 5 | top_4 = 50 ; 6 | top_5 = 49 ; 7 | 8 | [resnet50_int8] 9 | top_1 = 54 ; 10 | top_2 = 67 ; 11 | top_3 = 68 ; 12 | top_4 = 58 ; 13 | top_5 = 50 ; 14 | -------------------------------------------------------------------------------- /release/qa_test/sc5_tests/cpp/det_mtcnn/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # find opencv 2 | find_package(OpenCV REQUIRED) 3 | # include 4 | include_directories(${BMSDK_INCLUDE_DIRS} 5 | ${OpenCV_INCLUDE_DIRS} 6 | ${PROJECT_SOURCE_DIR}/include) 7 | link_directories(${OpenCV_LIBRARY_DIRS}) 8 | # bm lib path 9 | link_libraries(${BMSDK_LIBRARIES} ${OpenCV_LIBRARIES} ${SAIL_LIBRARY}) 10 | 11 | #add source files 12 | aux_source_directory(./ SRC) 13 | # build executable 14 | add_executable(det_mtcnn ${SRC}) 15 | -------------------------------------------------------------------------------- /release/qa_test/sc5_tests/cpp/det_ssd/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # find opencv 2 | find_package(OpenCV 3 REQUIRED) 3 | # include 4 | include_directories(${BMSDK_INCLUDE_DIRS} 5 | ${OpenCV_INCLUDE_DIRS} 6 | ${PROJECT_SOURCE_DIR}/include) 7 | link_directories(${OpenCV_LIBRARY_DIRS}) 8 | # bm lib path 9 | link_libraries(${BMNNSDK2_LIBRARIES} ${OpenCV_LIBRARIES} ${SAIL_LIBRARY}) 10 | 11 | # build executable 12 | add_executable(det_ssd_0 det_ssd_0.cpp processor.cpp cvdecoder.cpp) 13 | add_executable(det_ssd_1 det_ssd_1.cpp processor.cpp) 14 | add_executable(det_ssd_2 det_ssd_2.cpp processor.cpp) 15 | -------------------------------------------------------------------------------- /release/qa_test/sc5_tests/cpp/det_ssd/verify_files/verify_ssd_0_fp32_image.ini: -------------------------------------------------------------------------------- 1 | [summary] 2 | num = 7 ; 3 | 4 | [object_0] 5 | category = 6 ; 6 | score = 0.997022 ; 7 | x1 = 657.791 ; 8 | y1 = 250.359 ; 9 | x2 = 1596.91 ; 10 | y2 = 924.068 ; 11 | 12 | [object_1] 13 | category = 6 ; 14 | score = 0.914573 ; 15 | x1 = 1375.06 ; 16 | y1 = 459.794 ; 17 | x2 = 1890.82 ; 18 | y2 = 1079.18 ; 19 | 20 | [object_2] 21 | category = 7 ; 22 | score = 0.998325 ; 23 | x1 = 251.032 ; 24 | y1 = 805.595 ; 25 | x2 = 736.801 ; 26 | y2 = 1066.54 ; 27 | 28 | [object_3] 29 | category = 7 ; 30 | score = 0.967789 ; 31 | x1 = 374.424 ; 32 | y1 = 537.741 ; 33 | x2 = 681.893 ; 34 | y2 = 769.106 ; 35 | 36 | [object_4] 37 | category = 7 ; 38 | score = 0.955047 ; 39 | x1 = 1303.93 ; 40 | y1 = 220.088 ; 41 | x2 = 1477.99 ; 42 | y2 = 325.85 ; 43 | 44 | [object_5] 45 | category = 7 ; 46 | score = 0.924113 ; 47 | x1 = 512.483 ; 48 | y1 = 140.028 ; 49 | x2 = 651.827 ; 50 | y2 = 276.052 ; 51 | 52 | [object_6] 53 | category = 7 ; 54 | score = 0.80821 ; 55 | x1 = 1548 ; 56 | y1 = 265.379 ; 57 | x2 = 1818.74 ; 58 | y2 = 400.805 ; 59 | 60 | [object_7] 61 | category = 7 ; 62 | score = 0.591134 ; 63 | x1 = 1101.96 ; 64 | y1 = 172.926 ; 65 | x2 = 1255.56 ; 66 | y2 = 272.271 ; 67 | -------------------------------------------------------------------------------- /release/qa_test/sc5_tests/cpp/det_ssd/verify_files/verify_ssd_0_fp32_video.ini: -------------------------------------------------------------------------------- 1 | [summary] 2 | num = 5 ; 3 | 4 | [object_0] 5 | category = 7 ; 6 | score = 0.998068 ; 7 | x1 = 456.458 ; 8 | y1 = 713.726 ; 9 | x2 = 841.49 ; 10 | y2 = 1066.86 ; 11 | 12 | [object_1] 13 | category = 7 ; 14 | score = 0.981101 ; 15 | x1 = 727.885 ; 16 | y1 = 267.143 ; 17 | x2 = 871.956 ; 18 | y2 = 392.369 ; 19 | 20 | [object_2] 21 | category = 7 ; 22 | score = 0.759959 ; 23 | x1 = 1265.59 ; 24 | y1 = 236.203 ; 25 | x2 = 1408.99 ; 26 | y2 = 343.736 ; 27 | 28 | [object_3] 29 | category = 7 ; 30 | score = 0.685134 ; 31 | x1 = 1097.46 ; 32 | y1 = 138.303 ; 33 | x2 = 1212.1 ; 34 | y2 = 222.333 ; 35 | 36 | [object_4] 37 | category = 7 ; 38 | score = 0.604724 ; 39 | x1 = 811.095 ; 40 | y1 = 172.148 ; 41 | x2 = 922.832 ; 42 | y2 = 269.056 ; 43 | -------------------------------------------------------------------------------- /release/qa_test/sc5_tests/cpp/det_ssd/verify_files/verify_ssd_0_fp32_video_arm.ini: -------------------------------------------------------------------------------- 1 | [summary] 2 | num = 5 ; 3 | 4 | [object_0] 5 | category = 7 ; 6 | score = 0.998163 ; 7 | x1 = 456.538513 ; 8 | y1 = 713.873962 ; 9 | x2 = 841.480591 ; 10 | y2 = 1066.768311 ; 11 | 12 | [object_1] 13 | category = 7 ; 14 | score = 0.980694 ; 15 | x1 = 727.964661 ; 16 | y1 = 267.275208 ; 17 | x2 = 871.839722 ; 18 | y2 = 392.415649 ; 19 | 20 | [object_2] 21 | category = 7 ; 22 | score = 0.751821 ; 23 | x1 = 1265.654175 ; 24 | y1 = 236.252579 ; 25 | x2 = 1409.191895 ; 26 | y2 = 343.789429 ; 27 | 28 | [object_3] 29 | category = 7 ; 30 | score = 0.684174 ; 31 | x1 = 1097.241821 ; 32 | y1 = 138.194427 ; 33 | x2 = 1212.190796 ; 34 | y2 = 222.295975 ; 35 | 36 | [object_4] 37 | category = 7 ; 38 | score = 0.614392 ; 39 | x1 = 810.923584 ; 40 | y1 = 171.962753 ; 41 | x2 = 922.822144 ; 42 | y2 = 269.156494 ; 43 | -------------------------------------------------------------------------------- /release/qa_test/sc5_tests/cpp/det_ssd/verify_files/verify_ssd_0_int8_video.ini: -------------------------------------------------------------------------------- 1 | [summary] 2 | num = 5 ; 3 | 4 | [object_0] 5 | category = 7 ; 6 | score = 0.99662 ; 7 | x1 = 460.482 ; 8 | y1 = 713.855 ; 9 | x2 = 839.253 ; 10 | y2 = 1065.85 ; 11 | 12 | [object_1] 13 | category = 7 ; 14 | score = 0.981796 ; 15 | x1 = 726.955 ; 16 | y1 = 264.633 ; 17 | x2 = 871.15 ; 18 | y2 = 394.7 ; 19 | 20 | [object_2] 21 | category = 7 ; 22 | score = 0.78939 ; 23 | x1 = 1267.05 ; 24 | y1 = 233.216 ; 25 | x2 = 1408.38 ; 26 | y2 = 343.98 ; 27 | 28 | [object_3] 29 | category = 7 ; 30 | score = 0.720472 ; 31 | x1 = 1095.56 ; 32 | y1 = 136.01 ; 33 | x2 = 1211.17 ; 34 | y2 = 223.054 ; 35 | 36 | [object_4] 37 | category = 7 ; 38 | score = 0.666624 ; 39 | x1 = 808.257 ; 40 | y1 = 172.581 ; 41 | x2 = 919.899 ; 42 | y2 = 270.263 ; 43 | -------------------------------------------------------------------------------- /release/qa_test/sc5_tests/cpp/det_ssd/verify_files/verify_ssd_0_int8_video_arm.ini: -------------------------------------------------------------------------------- 1 | [summary] 2 | num = 5 ; 3 | 4 | [object_0] 5 | category = 7 ; 6 | score = 0.996871 ; 7 | x1 = 460.481903 ; 8 | y1 = 713.854736 ; 9 | x2 = 839.252563 ; 10 | y2 = 1065.845581 ; 11 | 12 | [object_1] 13 | category = 7 ; 14 | score = 0.981786 ; 15 | x1 = 726.955261 ; 16 | y1 = 265.925690 ; 17 | x2 = 871.150269 ; 18 | y2 = 393.407166 ; 19 | 20 | [object_2] 21 | category = 7 ; 22 | score = 0.822685 ; 23 | x1 = 1267.051392 ; 24 | y1 = 233.215897 ; 25 | x2 = 1408.379517 ; 26 | y2 = 343.979736 ; 27 | 28 | [object_3] 29 | category = 7 ; 30 | score = 0.720699 ; 31 | x1 = 1096.918579 ; 32 | y1 = 136.009750 ; 33 | x2 = 1212.534180 ; 34 | y2 = 223.054459 ; 35 | 36 | [object_4] 37 | category = 7 ; 38 | score = 0.612634 ; 39 | x1 = 807.125122 ; 40 | y1 = 172.580704 ; 41 | x2 = 921.031372 ; 42 | y2 = 270.263306 ; 43 | -------------------------------------------------------------------------------- /release/qa_test/sc5_tests/cpp/det_ssd/verify_files/verify_ssd_1_fp32_video.ini: -------------------------------------------------------------------------------- 1 | [summary] 2 | num = 5 ; 3 | 4 | [object_0] 5 | category = 7 ; 6 | score = 0.999234 ; 7 | x1 = 457.341858 ; 8 | y1 = 713.595642 ; 9 | x2 = 849.203003 ; 10 | y2 = 1066.261230 ; 11 | 12 | [object_1] 13 | category = 7 ; 14 | score = 0.981936 ; 15 | x1 = 711.422852 ; 16 | y1 = 267.882690 ; 17 | x2 = 873.663757 ; 18 | y2 = 392.258270 ; 19 | 20 | [object_2] 21 | category = 7 ; 22 | score = 0.838107 ; 23 | x1 = 1268.123657 ; 24 | y1 = 233.672409 ; 25 | x2 = 1405.180664 ; 26 | y2 = 340.561401 ; 27 | 28 | [object_3] 29 | category = 7 ; 30 | score = 0.749364 ; 31 | x1 = 566.304260 ; 32 | y1 = 407.568115 ; 33 | x2 = 818.812500 ; 34 | y2 = 654.049805 ; 35 | 36 | [object_4] 37 | category = 7 ; 38 | score = 0.634786 ; 39 | x1 = 1092.296265 ; 40 | y1 = 135.166840 ; 41 | x2 = 1211.584961 ; 42 | y2 = 218.408524 ; 43 | -------------------------------------------------------------------------------- /release/qa_test/sc5_tests/cpp/det_ssd/verify_files/verify_ssd_1_int8_video.ini: -------------------------------------------------------------------------------- 1 | [summary] 2 | num = 5 ; 3 | 4 | [object_0] 5 | category = 7 ; 6 | score = 0.999330 ; 7 | x1 = 461.884552 ; 8 | y1 = 713.854736 ; 9 | x2 = 848.338379 ; 10 | y2 = 1065.845581 ; 11 | 12 | [object_1] 13 | category = 7 ; 14 | score = 0.982188 ; 15 | x1 = 710.907410 ; 16 | y1 = 265.925690 ; 17 | x2 = 873.566345 ; 18 | y2 = 393.407166 ; 19 | 20 | [object_2] 21 | category = 7 ; 22 | score = 0.860190 ; 23 | x1 = 1268.469971 ; 24 | y1 = 230.148743 ; 25 | x2 = 1404.234497 ; 26 | y2 = 340.912598 ; 27 | 28 | [object_3] 29 | category = 7 ; 30 | score = 0.770718 ; 31 | x1 = 570.068848 ; 32 | y1 = 406.917236 ; 33 | x2 = 815.658386 ; 34 | y2 = 656.811218 ; 35 | 36 | [object_4] 37 | category = 7 ; 38 | score = 0.611404 ; 39 | x1 = 1091.823364 ; 40 | y1 = 134.145844 ; 41 | x2 = 1212.176880 ; 42 | y2 = 219.460022 ; 43 | -------------------------------------------------------------------------------- /release/qa_test/sc5_tests/cpp/det_yolov3/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # find opencv 2 | find_package(OpenCV 3 REQUIRED) 3 | 4 | # include 5 | include_directories(${BMSDK_INCLUDE_DIRS} 6 | ${OpenCV_INCLUDE_DIRS} 7 | ${PROJECT_SOURCE_DIR}/include) 8 | link_directories(${OpenCV_LIBRARY_DIRS}) 9 | # bm lib path 10 | link_libraries(pthread ${BMNNSDK2_LIBRARIES} ${OpenCV_LIBRARIES} ${SAIL_LIBRARY}) 11 | 12 | # build executable 13 | add_executable(det_yolov3_0 det_yolov3_0.cpp processor.cpp) 14 | add_executable(det_yolov3_1 det_yolov3_1.cpp processor.cpp frame_provider.cpp) 15 | -------------------------------------------------------------------------------- /release/qa_test/sc5_tests/python/cls_resnet/verify_files/verify_resnet50.json: -------------------------------------------------------------------------------- 1 | { 2 | "int8_top5": [ 3 | 54, 4 | 67, 5 | 50, 6 | 68, 7 | 58 8 | ], 9 | "fp32_top5": [ 10 | 65, 11 | 54, 12 | 58, 13 | 50, 14 | 49 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /release/qa_test/sc5_tests/python/det_ssd/verify_files/verify_ssd_0_fp32_image.json: -------------------------------------------------------------------------------- 1 | { 2 | "boxes": [ 3 | [ 4 | 6, 5 | "0.99660408", 6 | 658, 7 | 254, 8 | 1597, 9 | 923 10 | ], 11 | [ 12 | 6, 13 | "0.90127367", 14 | 1375, 15 | 458, 16 | 1891, 17 | 1077 18 | ], 19 | [ 20 | 7, 21 | "0.99746412", 22 | 252, 23 | 804, 24 | 738, 25 | 1065 26 | ], 27 | [ 28 | 7, 29 | "0.96772438", 30 | 373, 31 | 537, 32 | 681, 33 | 770 34 | ], 35 | [ 36 | 7, 37 | "0.95652747", 38 | 1304, 39 | 219, 40 | 1477, 41 | 326 42 | ], 43 | [ 44 | 7, 45 | "0.93533689", 46 | 510, 47 | 140, 48 | 651, 49 | 276 50 | ], 51 | [ 52 | 7, 53 | "0.81073463", 54 | 1549, 55 | 264, 56 | 1818, 57 | 402 58 | ], 59 | [ 60 | 7, 61 | "0.59113449", 62 | 1101, 63 | 172, 64 | 1255, 65 | 272 66 | ] 67 | ] 68 | } -------------------------------------------------------------------------------- /release/qa_test/sc5_tests/python/det_ssd/verify_files/verify_ssd_0_fp32_video.json: -------------------------------------------------------------------------------- 1 | { 2 | "boxes": [ 3 | [ 4 | 7, 5 | "0.99793279", 6 | 456, 7 | 713, 8 | 840, 9 | 1066 10 | ], 11 | [ 12 | 7, 13 | "0.98076206", 14 | 728, 15 | 267, 16 | 871, 17 | 392 18 | ], 19 | [ 20 | 7, 21 | "0.76854551", 22 | 1265, 23 | 236, 24 | 1408, 25 | 343 26 | ], 27 | [ 28 | 7, 29 | "0.67942291", 30 | 1097, 31 | 138, 32 | 1212, 33 | 222 34 | ], 35 | [ 36 | 7, 37 | "0.60796654", 38 | 811, 39 | 171, 40 | 922, 41 | 268 42 | ] 43 | ] 44 | } 45 | -------------------------------------------------------------------------------- /release/qa_test/sc5_tests/python/det_ssd/verify_files/verify_ssd_0_fp32_video_arm.json: -------------------------------------------------------------------------------- 1 | { 2 | "boxes": [ 3 | [ 4 | 7, 5 | "0.99816334", 6 | 456, 7 | 713, 8 | 841, 9 | 1066 10 | ], 11 | [ 12 | 7, 13 | "0.98069447", 14 | 727, 15 | 267, 16 | 871, 17 | 392 18 | ], 19 | [ 20 | 7, 21 | "0.75182104", 22 | 1265, 23 | 236, 24 | 1409, 25 | 343 26 | ], 27 | [ 28 | 7, 29 | "0.68417424", 30 | 1097, 31 | 138, 32 | 1212, 33 | 222 34 | ], 35 | [ 36 | 7, 37 | "0.61439234", 38 | 810, 39 | 171, 40 | 922, 41 | 269 42 | ] 43 | ] 44 | } -------------------------------------------------------------------------------- /release/qa_test/sc5_tests/python/det_ssd/verify_files/verify_ssd_0_int8_image.json: -------------------------------------------------------------------------------- 1 | { 2 | "boxes": [ 3 | [ 4 | 6, 5 | "0.99663091", 6 | 621, 7 | 268, 8 | 1593, 9 | 937 10 | ], 11 | [ 12 | 6, 13 | "0.86527830", 14 | 1370, 15 | 465, 16 | 1883, 17 | 1065 18 | ], 19 | [ 20 | 7, 21 | "0.99876082", 22 | 236, 23 | 805, 24 | 737, 25 | 1065 26 | ], 27 | [ 28 | 7, 29 | "0.96795684", 30 | 359, 31 | 536, 32 | 667, 33 | 770 34 | ], 35 | [ 36 | 7, 37 | "0.94647288", 38 | 1300, 39 | 220, 40 | 1477, 41 | 326 42 | ], 43 | [ 44 | 7, 45 | "0.91228491", 46 | 509, 47 | 139, 48 | 651, 49 | 277 50 | ], 51 | [ 52 | 7, 53 | "0.84305054", 54 | 1546, 55 | 265, 56 | 1818, 57 | 403 58 | ], 59 | [ 60 | 7, 61 | "0.55425245", 62 | -1, 63 | 703, 64 | 211, 65 | 807 66 | ], 67 | [ 68 | 7, 69 | "0.55194277", 70 | 1096, 71 | 171, 72 | 1250, 73 | 273 74 | ] 75 | ] 76 | } -------------------------------------------------------------------------------- /release/qa_test/sc5_tests/python/det_ssd/verify_files/verify_ssd_0_int8_video.json: -------------------------------------------------------------------------------- 1 | { 2 | "boxes": [ 3 | [ 4 | 7, 5 | "0.99687940", 6 | 460, 7 | 713, 8 | 839, 9 | 1065 10 | ], 11 | [ 12 | 7, 13 | "0.98178554", 14 | 726, 15 | 266, 16 | 871, 17 | 396 18 | ], 19 | [ 20 | 7, 21 | "0.82662112", 22 | 1267, 23 | 234, 24 | 1408, 25 | 342 26 | ], 27 | [ 28 | 7, 29 | "0.72057921", 30 | 1095, 31 | 136, 32 | 1211, 33 | 223 34 | ], 35 | [ 36 | 7, 37 | "0.61264503", 38 | 810, 39 | 172, 40 | 921, 41 | 270 42 | ] 43 | ] 44 | } 45 | -------------------------------------------------------------------------------- /release/qa_test/sc5_tests/python/det_ssd/verify_files/verify_ssd_0_int8_video_arm.json: -------------------------------------------------------------------------------- 1 | { 2 | "boxes": [ 3 | [ 4 | 7, 5 | "0.99687070", 6 | 460, 7 | 713, 8 | 839, 9 | 1065 10 | ], 11 | [ 12 | 7, 13 | "0.98178554", 14 | 726, 15 | 265, 16 | 871, 17 | 393 18 | ], 19 | [ 20 | 7, 21 | "0.82268524", 22 | 1267, 23 | 233, 24 | 1408, 25 | 343 26 | ], 27 | [ 28 | 7, 29 | "0.72069913", 30 | 1096, 31 | 136, 32 | 1212, 33 | 223 34 | ], 35 | [ 36 | 7, 37 | "0.61263424", 38 | 807, 39 | 172, 40 | 921, 41 | 270 42 | ] 43 | ] 44 | } -------------------------------------------------------------------------------- /release/qa_test/sc5_tests/python/det_ssd/verify_files/verify_ssd_1_fp32_image.json: -------------------------------------------------------------------------------- 1 | { 2 | "boxes": [ 3 | [ 4 | 6, 5 | "0.99693567", 6 | 655, 7 | 249, 8 | 1593, 9 | 937 10 | ], 11 | [ 12 | 6, 13 | "0.82807261", 14 | 1375, 15 | 431, 16 | 1899, 17 | 1085 18 | ], 19 | [ 20 | 6, 21 | "0.78254795", 22 | 833, 23 | 48, 24 | 1176, 25 | 210 26 | ], 27 | [ 28 | 7, 29 | "0.99990535", 30 | 241, 31 | 802, 32 | 721, 33 | 1070 34 | ], 35 | [ 36 | 7, 37 | "0.98387122", 38 | 371, 39 | 533, 40 | 682, 41 | 764 42 | ], 43 | [ 44 | 7, 45 | "0.96309251", 46 | 1282, 47 | 209, 48 | 1482, 49 | 323 50 | ], 51 | [ 52 | 7, 53 | "0.94893932", 54 | 1550, 55 | 261, 56 | 1824, 57 | 402 58 | ], 59 | [ 60 | 7, 61 | "0.94680321", 62 | 502, 63 | 129, 64 | 643, 65 | 278 66 | ], 67 | [ 68 | 7, 69 | "0.62812787", 70 | 1101, 71 | 172, 72 | 1251, 73 | 268 74 | ] 75 | ] 76 | } 77 | -------------------------------------------------------------------------------- /release/qa_test/sc5_tests/python/det_ssd/verify_files/verify_ssd_1_fp32_video.json: -------------------------------------------------------------------------------- 1 | { 2 | "boxes": [ 3 | [ 4 | 7, 5 | "0.99923384", 6 | 457, 7 | 713, 8 | 849, 9 | 1066 10 | ], 11 | [ 12 | 7, 13 | "0.98193616", 14 | 711, 15 | 267, 16 | 873, 17 | 392 18 | ], 19 | [ 20 | 7, 21 | "0.83810651", 22 | 1268, 23 | 233, 24 | 1405, 25 | 340 26 | ], 27 | [ 28 | 7, 29 | "0.74936426", 30 | 566, 31 | 407, 32 | 818, 33 | 654 34 | ], 35 | [ 36 | 7, 37 | "0.63478559", 38 | 1092, 39 | 135, 40 | 1211, 41 | 218 42 | ] 43 | ] 44 | } 45 | -------------------------------------------------------------------------------- /release/qa_test/sc5_tests/python/det_ssd/verify_files/verify_ssd_1_int8_image.json: -------------------------------------------------------------------------------- 1 | { 2 | "boxes": [ 3 | [ 4 | 6, 5 | "0.99764246", 6 | 670, 7 | 219, 8 | 1600, 9 | 970 10 | ], 11 | [ 12 | 6, 13 | "0.80224854", 14 | 1355, 15 | 447, 16 | 1878, 17 | 1072 18 | ], 19 | [ 20 | 6, 21 | "0.77889252", 22 | 830, 23 | 50, 24 | 1182, 25 | 212 26 | ], 27 | [ 28 | 7, 29 | "0.99990737", 30 | 240, 31 | 803, 32 | 722, 33 | 1074 34 | ], 35 | [ 36 | 7, 37 | "0.97708344", 38 | 372, 39 | 534, 40 | 680, 41 | 764 42 | ], 43 | [ 44 | 7, 45 | "0.95755404", 46 | 1543, 47 | 262, 48 | 1826, 49 | 403 50 | ], 51 | [ 52 | 7, 53 | "0.95731193", 54 | 1276, 55 | 210, 56 | 1479, 57 | 325 58 | ], 59 | [ 60 | 7, 61 | "0.94011784", 62 | 500, 63 | 126, 64 | 644, 65 | 278 66 | ], 67 | [ 68 | 7, 69 | "0.66768581", 70 | 1094, 71 | 172, 72 | 1248, 73 | 270 74 | ] 75 | ] 76 | } 77 | -------------------------------------------------------------------------------- /release/qa_test/sc5_tests/python/det_ssd/verify_files/verify_ssd_1_int8_video.json: -------------------------------------------------------------------------------- 1 | { 2 | "boxes": [ 3 | [ 4 | 7, 5 | "0.99932957", 6 | 461, 7 | 713, 8 | 848, 9 | 1065 10 | ], 11 | [ 12 | 7, 13 | "0.98218781", 14 | 710, 15 | 265, 16 | 873, 17 | 393 18 | ], 19 | [ 20 | 7, 21 | "0.86018991", 22 | 1268, 23 | 230, 24 | 1404, 25 | 340 26 | ], 27 | [ 28 | 7, 29 | "0.77071804", 30 | 570, 31 | 406, 32 | 815, 33 | 656 34 | ], 35 | [ 36 | 7, 37 | "0.61140382", 38 | 1091, 39 | 134, 40 | 1212, 41 | 219 42 | ] 43 | ] 44 | } -------------------------------------------------------------------------------- /release/qa_test/se5_tests/README.md: -------------------------------------------------------------------------------- 1 | ## Summary 2 | 3 | ```shell 4 | se5_tests 5 | ├── cls_resnet # test cases of resnet50 for classification(build from cpp) 6 | │   ├── cls_resnet_0 7 | │   └── cls_resnet_1 8 | ├── det_ssd # test case of ssd for detection(python) 9 | │   ├── det_ssd_1.py 10 | │   └── det_ssd_2.py 11 | ├── README.md 12 | └── scripts # contains test scripts 13 | ├── auto_test.sh 14 | └── download.py 15 | ``` 16 | 17 | ## Notes 18 | 19 | ```shell 20 | # this sample run in soc 21 | # the only thing you should do. 22 | # the script will download needed models and data in directory: ./data 23 | # add then test all the cases, it will exit when bug occurs. 24 | ./scripts/auto_test.sh 25 | ``` 26 | -------------------------------------------------------------------------------- /release/qa_test/se5_tests/cls_resnet/verify_files/verify_resnet50.ini: -------------------------------------------------------------------------------- 1 | [resnet50_fp32] 2 | top_1 = 65 ; 3 | top_2 = 54 ; 4 | top_3 = 58 ; 5 | top_4 = 50 ; 6 | top_5 = 49 ; 7 | 8 | [resnet50_int8] 9 | top_1 = 54 ; 10 | top_2 = 67 ; 11 | top_3 = 68 ; 12 | top_4 = 58 ; 13 | top_5 = 50 ; 14 | -------------------------------------------------------------------------------- /release/qa_test/se5_tests/det_ssd/verify_files/verify_ssd_0_fp32_image.ini: -------------------------------------------------------------------------------- 1 | [summary] 2 | num = 7 ; 3 | 4 | [object_0] 5 | category = 6 ; 6 | score = 0.997022 ; 7 | x1 = 657.791 ; 8 | y1 = 250.359 ; 9 | x2 = 1596.91 ; 10 | y2 = 924.068 ; 11 | 12 | [object_1] 13 | category = 6 ; 14 | score = 0.914573 ; 15 | x1 = 1375.06 ; 16 | y1 = 459.794 ; 17 | x2 = 1890.82 ; 18 | y2 = 1079.18 ; 19 | 20 | [object_2] 21 | category = 7 ; 22 | score = 0.998325 ; 23 | x1 = 251.032 ; 24 | y1 = 805.595 ; 25 | x2 = 736.801 ; 26 | y2 = 1066.54 ; 27 | 28 | [object_3] 29 | category = 7 ; 30 | score = 0.967789 ; 31 | x1 = 374.424 ; 32 | y1 = 537.741 ; 33 | x2 = 681.893 ; 34 | y2 = 769.106 ; 35 | 36 | [object_4] 37 | category = 7 ; 38 | score = 0.955047 ; 39 | x1 = 1303.93 ; 40 | y1 = 220.088 ; 41 | x2 = 1477.99 ; 42 | y2 = 325.85 ; 43 | 44 | [object_5] 45 | category = 7 ; 46 | score = 0.924113 ; 47 | x1 = 512.483 ; 48 | y1 = 140.028 ; 49 | x2 = 651.827 ; 50 | y2 = 276.052 ; 51 | 52 | [object_6] 53 | category = 7 ; 54 | score = 0.80821 ; 55 | x1 = 1548 ; 56 | y1 = 265.379 ; 57 | x2 = 1818.74 ; 58 | y2 = 400.805 ; 59 | 60 | [object_7] 61 | category = 7 ; 62 | score = 0.591134 ; 63 | x1 = 1101.96 ; 64 | y1 = 172.926 ; 65 | x2 = 1255.56 ; 66 | y2 = 272.271 ; 67 | -------------------------------------------------------------------------------- /release/qa_test/se5_tests/det_ssd/verify_files/verify_ssd_0_fp32_video.ini: -------------------------------------------------------------------------------- 1 | [summary] 2 | num = 5 ; 3 | 4 | [object_0] 5 | category = 7 ; 6 | score = 0.998068 ; 7 | x1 = 456.458 ; 8 | y1 = 713.726 ; 9 | x2 = 841.49 ; 10 | y2 = 1066.86 ; 11 | 12 | [object_1] 13 | category = 7 ; 14 | score = 0.981101 ; 15 | x1 = 727.885 ; 16 | y1 = 267.143 ; 17 | x2 = 871.956 ; 18 | y2 = 392.369 ; 19 | 20 | [object_2] 21 | category = 7 ; 22 | score = 0.759959 ; 23 | x1 = 1265.59 ; 24 | y1 = 236.203 ; 25 | x2 = 1408.99 ; 26 | y2 = 343.736 ; 27 | 28 | [object_3] 29 | category = 7 ; 30 | score = 0.685134 ; 31 | x1 = 1097.46 ; 32 | y1 = 138.303 ; 33 | x2 = 1212.1 ; 34 | y2 = 222.333 ; 35 | 36 | [object_4] 37 | category = 7 ; 38 | score = 0.604724 ; 39 | x1 = 811.095 ; 40 | y1 = 172.148 ; 41 | x2 = 922.832 ; 42 | y2 = 269.056 ; 43 | -------------------------------------------------------------------------------- /release/qa_test/se5_tests/det_ssd/verify_files/verify_ssd_0_fp32_video_arm.ini: -------------------------------------------------------------------------------- 1 | [summary] 2 | num = 5 ; 3 | 4 | [object_0] 5 | category = 7 ; 6 | score = 0.998163 ; 7 | x1 = 456.538513 ; 8 | y1 = 713.873962 ; 9 | x2 = 841.480591 ; 10 | y2 = 1066.768311 ; 11 | 12 | [object_1] 13 | category = 7 ; 14 | score = 0.980694 ; 15 | x1 = 727.964661 ; 16 | y1 = 267.275208 ; 17 | x2 = 871.839722 ; 18 | y2 = 392.415649 ; 19 | 20 | [object_2] 21 | category = 7 ; 22 | score = 0.751821 ; 23 | x1 = 1265.654175 ; 24 | y1 = 236.252579 ; 25 | x2 = 1409.191895 ; 26 | y2 = 343.789429 ; 27 | 28 | [object_3] 29 | category = 7 ; 30 | score = 0.684174 ; 31 | x1 = 1097.241821 ; 32 | y1 = 138.194427 ; 33 | x2 = 1212.190796 ; 34 | y2 = 222.295975 ; 35 | 36 | [object_4] 37 | category = 7 ; 38 | score = 0.614392 ; 39 | x1 = 810.923584 ; 40 | y1 = 171.962753 ; 41 | x2 = 922.822144 ; 42 | y2 = 269.156494 ; 43 | -------------------------------------------------------------------------------- /release/qa_test/se5_tests/det_ssd/verify_files/verify_ssd_0_int8_video.ini: -------------------------------------------------------------------------------- 1 | [summary] 2 | num = 5 ; 3 | 4 | [object_0] 5 | category = 7 ; 6 | score = 0.99662 ; 7 | x1 = 460.482 ; 8 | y1 = 713.855 ; 9 | x2 = 839.253 ; 10 | y2 = 1065.85 ; 11 | 12 | [object_1] 13 | category = 7 ; 14 | score = 0.981796 ; 15 | x1 = 726.955 ; 16 | y1 = 264.633 ; 17 | x2 = 871.15 ; 18 | y2 = 394.7 ; 19 | 20 | [object_2] 21 | category = 7 ; 22 | score = 0.78939 ; 23 | x1 = 1267.05 ; 24 | y1 = 233.216 ; 25 | x2 = 1408.38 ; 26 | y2 = 343.98 ; 27 | 28 | [object_3] 29 | category = 7 ; 30 | score = 0.720472 ; 31 | x1 = 1095.56 ; 32 | y1 = 136.01 ; 33 | x2 = 1211.17 ; 34 | y2 = 223.054 ; 35 | 36 | [object_4] 37 | category = 7 ; 38 | score = 0.666624 ; 39 | x1 = 808.257 ; 40 | y1 = 172.581 ; 41 | x2 = 919.899 ; 42 | y2 = 270.263 ; 43 | -------------------------------------------------------------------------------- /release/qa_test/se5_tests/det_ssd/verify_files/verify_ssd_0_int8_video_arm.ini: -------------------------------------------------------------------------------- 1 | [summary] 2 | num = 5 ; 3 | 4 | [object_0] 5 | category = 7 ; 6 | score = 0.996871 ; 7 | x1 = 460.481903 ; 8 | y1 = 713.854736 ; 9 | x2 = 839.252563 ; 10 | y2 = 1065.845581 ; 11 | 12 | [object_1] 13 | category = 7 ; 14 | score = 0.981786 ; 15 | x1 = 726.955261 ; 16 | y1 = 265.925690 ; 17 | x2 = 871.150269 ; 18 | y2 = 393.407166 ; 19 | 20 | [object_2] 21 | category = 7 ; 22 | score = 0.822685 ; 23 | x1 = 1267.051392 ; 24 | y1 = 233.215897 ; 25 | x2 = 1408.379517 ; 26 | y2 = 343.979736 ; 27 | 28 | [object_3] 29 | category = 7 ; 30 | score = 0.720699 ; 31 | x1 = 1096.918579 ; 32 | y1 = 136.009750 ; 33 | x2 = 1212.534180 ; 34 | y2 = 223.054459 ; 35 | 36 | [object_4] 37 | category = 7 ; 38 | score = 0.612634 ; 39 | x1 = 807.125122 ; 40 | y1 = 172.580704 ; 41 | x2 = 921.031372 ; 42 | y2 = 270.263306 ; 43 | -------------------------------------------------------------------------------- /release/qa_test/se5_tests/det_ssd/verify_files/verify_ssd_1_fp32_video.ini: -------------------------------------------------------------------------------- 1 | [summary] 2 | num = 5 ; 3 | 4 | [object_0] 5 | category = 7 ; 6 | score = 0.999234 ; 7 | x1 = 457.341858 ; 8 | y1 = 713.595642 ; 9 | x2 = 849.203003 ; 10 | y2 = 1066.261230 ; 11 | 12 | [object_1] 13 | category = 7 ; 14 | score = 0.981936 ; 15 | x1 = 711.422852 ; 16 | y1 = 267.882690 ; 17 | x2 = 873.663757 ; 18 | y2 = 392.258270 ; 19 | 20 | [object_2] 21 | category = 7 ; 22 | score = 0.838107 ; 23 | x1 = 1268.123657 ; 24 | y1 = 233.672409 ; 25 | x2 = 1405.180664 ; 26 | y2 = 340.561401 ; 27 | 28 | [object_3] 29 | category = 7 ; 30 | score = 0.749364 ; 31 | x1 = 566.304260 ; 32 | y1 = 407.568115 ; 33 | x2 = 818.812500 ; 34 | y2 = 654.049805 ; 35 | 36 | [object_4] 37 | category = 7 ; 38 | score = 0.634786 ; 39 | x1 = 1092.296265 ; 40 | y1 = 135.166840 ; 41 | x2 = 1211.584961 ; 42 | y2 = 218.408524 ; 43 | -------------------------------------------------------------------------------- /release/qa_test/se5_tests/det_ssd/verify_files/verify_ssd_1_int8_video.ini: -------------------------------------------------------------------------------- 1 | [summary] 2 | num = 5 ; 3 | 4 | [object_0] 5 | category = 7 ; 6 | score = 0.999330 ; 7 | x1 = 461.884552 ; 8 | y1 = 713.854736 ; 9 | x2 = 848.338379 ; 10 | y2 = 1065.845581 ; 11 | 12 | [object_1] 13 | category = 7 ; 14 | score = 0.982188 ; 15 | x1 = 710.907410 ; 16 | y1 = 265.925690 ; 17 | x2 = 873.566345 ; 18 | y2 = 393.407166 ; 19 | 20 | [object_2] 21 | category = 7 ; 22 | score = 0.860190 ; 23 | x1 = 1268.469971 ; 24 | y1 = 230.148743 ; 25 | x2 = 1404.234497 ; 26 | y2 = 340.912598 ; 27 | 28 | [object_3] 29 | category = 7 ; 30 | score = 0.770718 ; 31 | x1 = 570.068848 ; 32 | y1 = 406.917236 ; 33 | x2 = 815.658386 ; 34 | y2 = 656.811218 ; 35 | 36 | [object_4] 37 | category = 7 ; 38 | score = 0.611404 ; 39 | x1 = 1091.823364 ; 40 | y1 = 134.145844 ; 41 | x2 = 1212.176880 ; 42 | y2 = 219.460022 ; 43 | -------------------------------------------------------------------------------- /release/release_case/cpp_cv_bmcv_sail/README.md: -------------------------------------------------------------------------------- 1 | ## Example of SSD300 decoded by bm-opencv, preprocessed by bmcv, inference by sail. 2 | 3 | ## Usage: 4 | 5 | * Deploy on SOC mode. 6 | 7 | ```shell 8 | make -f Makefile.arm 9 | 10 | # bmodel: bmodel path, can be fp32 or int8 model 11 | # input: input path, can be image/video file or rtsp stream 12 | # loops: frames count to be detected, default: 1 13 | ./ssd300_cv_bmcv_sail.arm \ 14 | --bmodel your-path-to-bmodel \ 15 | --input your-path-to-input \ 16 | --loops frames_count_to_detect 17 | ``` 18 | -------------------------------------------------------------------------------- /release/release_case/cpp_cv_cv+bmcv_sail/README.md: -------------------------------------------------------------------------------- 1 | ## Example of SSD300 decoded by bm-opencv, preprocessed by bm-opencv, inference by sail. 2 | 3 | ## Usage: 4 | 5 | * Deploy on SOC mode. 6 | 7 | ```shell 8 | make -f Makefile.arm 9 | 10 | # bmodel: bmodel path, can be fp32 or int8 model 11 | # input: input path, can be image/video file or rtsp stream 12 | # loops: frames count to be detected, default: 1 13 | ./ssd300_cv_cv+bmcv_sail.arm \ 14 | --bmodel your-path-to-bmodel \ 15 | --input your-path-to-input \ 16 | --loops frames_count_to_detect 17 | ``` 18 | -------------------------------------------------------------------------------- /release/release_case/cpp_ffmpeg_bmcv_sail/README.md: -------------------------------------------------------------------------------- 1 | ## Example of SSD300 decoded by bm-ffmpeg, preprocessed by bmcv, inference by sail. 2 | 3 | ## Usage: 4 | 5 | * Deploy on SOC mode. 6 | 7 | ```shell 8 | make -f Makefile.arm 9 | 10 | # bmodel: bmodel path, can be fp32 or int8 model 11 | # input: input path, can be image/video file or rtsp stream 12 | # loops: frames count to be detected, default: 1 13 | ./ssd300_ffmpeg_bmcv_sail.arm \ 14 | --bmodel your-path-to-bmodel \ 15 | --input your-path-to-input \ 16 | --loops frames_count_to_detect 17 | ``` 18 | 19 | * Deploy on PCIE mode. 20 | 21 | ```shell 22 | make -f Makefile.pcie 23 | 24 | # bmodel: bmodel path, can be fp32 or int8 model 25 | # input: input path, can be image/video file or rtsp stream 26 | # loops: frames count to be detected, default: 1 27 | ./ssd300_ffmpeg_bmcv_sail.pcie \ 28 | --bmodel your-path-to-bmodel \ 29 | --input your-path-to-input \ 30 | --loops frames_count_to_detect 31 | ``` 32 | -------------------------------------------------------------------------------- /samples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # cpp sail target 2 | if(USE_CENTOS) 3 | # libstdc++ 4 | if(USE_ARM_PCIE) 5 | if(USE_BMNNSDK2) 6 | set(STDCPP_LIB_DIR ${BMNNSDK2_PATH}/lib/sys/aarch64) 7 | else() 8 | set(STDCPP_LIB_DIR ${NNT_PATH}/lib/sys/aarch64) 9 | endif() 10 | else() 11 | if(USE_BMNNSDK2) 12 | set(STDCPP_LIB_DIR ${BMNNSDK2_PATH}/lib/sys/x86) 13 | else() 14 | set(STDCPP_LIB_DIR ${NNT_PATH}/lib/sys/x86) 15 | endif() 16 | endif() 17 | file(GLOB STDCPP_LIBS "${STDCPP_LIB_DIR}/lib*.so*") 18 | link_libraries(${STDCPP_LIBS}) 19 | endif() 20 | 21 | add_subdirectory(cpp/cls_resnet) 22 | add_subdirectory(cpp/det_mtcnn) 23 | add_subdirectory(cpp/det_yolov3) 24 | add_subdirectory(cpp/det_ssd) 25 | -------------------------------------------------------------------------------- /samples/cpp/cls_resnet/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | message(STATUS "bmnn_link_dirs=${bmnn_link_dirs}") 3 | if (NOT WIN32) 4 | link_libraries(sail ${opencv_link_libs} ${ffmpeg_link_libs} ${bmnn_link_libs} pthread) 5 | add_executable(cls_resnet_0 processor.cpp cls_resnet_0.cpp) 6 | add_executable(cls_resnet_1 processor.cpp cls_resnet_1.cpp) 7 | add_executable(cls_resnet_2 processor.cpp cls_resnet_2.cpp) 8 | add_executable(cls_resnet_3 processor.cpp cls_resnet_3.cpp) 9 | else() 10 | link_libraries(libsail ${opencv_link_libs} ${ffmpeg_link_libs} ${bmnn_link_libs}) 11 | 12 | add_executable(cls_resnet_0 processor.cpp cls_resnet_0.cpp getopt_win.c) 13 | add_executable(cls_resnet_1 processor.cpp cls_resnet_1.cpp getopt_win.c) 14 | add_executable(cls_resnet_2 processor.cpp cls_resnet_2.cpp getopt_win.c) 15 | add_executable(cls_resnet_3 processor.cpp cls_resnet_3.cpp getopt_win.c) 16 | endif() 17 | # build executable 18 | 19 | -------------------------------------------------------------------------------- /samples/cpp/det_mtcnn/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | message(STATUS "bmnn_link_dirs=${bmnn_link_dirs}") 2 | 3 | if (NOT WIN32) 4 | link_libraries(sail ${opencv_link_libs} ${ffmpeg_link_libs} ${bmnn_link_libs} pthread) 5 | # build executable 6 | add_executable(det_mtcnn det_mtcnn.cpp processor.cpp) 7 | else() 8 | link_libraries(libsail ${opencv_link_libs} ${ffmpeg_link_libs} ${bmnn_link_libs}) 9 | # build executable 10 | add_executable(det_mtcnn det_mtcnn.cpp processor.cpp getopt_win.c) 11 | endif() 12 | 13 | -------------------------------------------------------------------------------- /samples/cpp/det_yolov3/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | message(STATUS "bmnn_link_dirs=${bmnn_link_dirs}") 2 | 3 | if (NOT WIN32) 4 | link_libraries(sail ${opencv_link_libs} ${ffmpeg_link_libs} ${bmnn_link_libs} pthread) 5 | # build executable 6 | add_executable(det_yolov3_0 det_yolov3_0.cpp processor.cpp) 7 | if(USE_FFMPEG) 8 | add_executable(det_yolov3_1 det_yolov3_1.cpp processor.cpp frame_provider.cpp) 9 | endif() 10 | else() 11 | link_libraries(libsail ${opencv_link_libs} ${ffmpeg_link_libs} ${bmnn_link_libs}) 12 | # build executable 13 | add_executable(det_yolov3_0 det_yolov3_0.cpp processor.cpp getopt_win.c) 14 | if(USE_FFMPEG) 15 | add_executable(det_yolov3_1 det_yolov3_1.cpp processor.cpp frame_provider.cpp getopt_win.c) 16 | endif() 17 | endif() 18 | 19 | 20 | -------------------------------------------------------------------------------- /samples/python/README.md: -------------------------------------------------------------------------------- 1 | ## Summary 2 | 3 | ### Image Classification 4 | 5 | ID|Input|Decoder|Preprocessor|Data Type|Model|Mode|Model Number|TPU Number|Multi-Thread 6 | -|-|-|-|-|-|-|-|-|- 7 | 1|image|opencv|opencv|fp32/int8|resnet-50|static|1|1|N 8 | 2|image|opencv|opencv|fp32/int8|resnet-50|static|1|1|Y 9 | 3|image|opencv|opencv|fp32/int8|resnet-50|static|1|2|Y 10 | 4|image|opencv|opencv|fp32/int8|resnet-50|static|2|1|Y 11 | 12 | [cls_resnet](cls_resnet/README.md) 13 | 14 | ### Object Detection 15 | 16 | ID|Input|Decoder|Preprocessor|Data Type|Model|Mode|Batch Size|Multi-Thread 17 | -|-|-|-|-|-|-|-|- 18 | 1|video/image|opencv|opencv|fp32/int8|ssd_vgg|static|1|N 19 | 2|video/image|bm-ffmpeg|bmcv|fp32/int8|ssd_vgg|static|1|N 20 | 3|video|bm-ffmpeg|bmcv|fp32/int8|ssd_vgg|static|4|N 21 | 4|multi-video|opencv|opencv|fp32/int8|yolov3|static|1|Y 22 | 5|multi-video|bm-ffmpeg|bmcv|fp32/int8|yolov3|static|1|Y 23 | 24 | [det_ssd](det_ssd/README.md) 25 | [det_yolov3](det_yolov3/README.md) 26 | 27 | ### Face Detection 28 | 29 | ID|Input|Decoder|Preprocessor|Data Type|Model|Mode 30 | -|-|-|-|-|-|- 31 | 1|image|opencv|opencv|fp32|mtcnn|dynamic 32 | 33 | [det_mtcnn](det_mtcnn/README.md) 34 | -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/README: -------------------------------------------------------------------------------- 1 | 1、多进程获取视频流 写入queue 2 | 2、多进程消费queue调用retinaface检测人脸 3 | 3、将人脸检测结果保存到本地。 4 | 4、每一路视频有一个解码线程,每4路视频创建一个进程,每个进程中包含一个检测线程 5 | 6 | 首次运行: 7 | ## 安装依赖 8 | 1. 安装redis-server依赖: 9 | 10 | ```bash 11 | sudo apt install redis-server 12 | ``` 13 | 14 | 2、安装python依赖 15 | ```bash 16 | sudo pip3 install -r requirements.txt 17 | ``` 18 | 19 | 3、进入detection文件夹,执行Make 20 | 21 | 22 | 配置文件: 23 | 1. utils/__init__.py 24 | 2、 25 | 检测模型文件 : DETECTION_MODEL_PATH 26 | 检测模型使用的TPU : DETECTION_TPU_ID 27 | 测试视频文件或者rtsp列表:VIDEO_LIST 28 | 浏览器访问的端口号 :WEBSOCKET_PORT 29 | 30 | 运行说明: 31 | python3 server.py 32 | 33 | ## 查看画面 34 | 35 | 打开浏览器查看: http://:WEBSOCKET_PORT 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/after_2_tensor.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/samples/python/multiprocess_detection/after_2_tensor.jpg -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/capture/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding:utf-8 -*- 2 | # @author : cbingcan 3 | # @time : 2021/8/24/024 11:01 4 | -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/detection/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | cd rcnn/cython/; python3 setup.py build_ext --inplace; rm -rf build; cd ../../ 3 | cd rcnn/pycocotools/; python3 setup.py build_ext --inplace; rm -rf build; cd ../../ 4 | clean: 5 | cd rcnn/cython/; rm *.so *.c *.cpp; cd ../../ 6 | cd rcnn/pycocotools/; rm *.so; cd ../../ 7 | -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/detection/lw-edge.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/samples/python/multiprocess_detection/detection/lw-edge.zip -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/detection/rcnn/PY_OP/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/samples/python/multiprocess_detection/detection/rcnn/PY_OP/__init__.py -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/detection/rcnn/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/samples/python/multiprocess_detection/detection/rcnn/__init__.py -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/detection/rcnn/core/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/samples/python/multiprocess_detection/detection/rcnn/core/__init__.py -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/detection/rcnn/core/callback.py: -------------------------------------------------------------------------------- 1 | import mxnet as mx 2 | 3 | 4 | def do_checkpoint(prefix, means, stds): 5 | def _callback(iter_no, sym, arg, aux): 6 | if 'bbox_pred_weight' in arg: 7 | arg['bbox_pred_weight_test'] = (arg['bbox_pred_weight'].T * 8 | mx.nd.array(stds)).T 9 | arg['bbox_pred_bias_test'] = arg['bbox_pred_bias'] * mx.nd.array( 10 | stds) + mx.nd.array(means) 11 | mx.model.save_checkpoint(prefix, iter_no + 1, sym, arg, aux) 12 | if 'bbox_pred_weight' in arg: 13 | arg.pop('bbox_pred_weight_test') 14 | arg.pop('bbox_pred_bias_test') 15 | 16 | return _callback 17 | -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/detection/rcnn/cython/.gitignore: -------------------------------------------------------------------------------- 1 | *.c 2 | *.cpp 3 | *.so 4 | -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/detection/rcnn/cython/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/samples/python/multiprocess_detection/detection/rcnn/cython/__init__.py -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/detection/rcnn/cython/gpu_nms.hpp: -------------------------------------------------------------------------------- 1 | void _nms(int* keep_out, int* num_out, const float* boxes_host, int boxes_num, 2 | int boxes_dim, float nms_overlap_thresh, int device_id); 3 | -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/detection/rcnn/dataset/__init__.py: -------------------------------------------------------------------------------- 1 | from .imdb import IMDB 2 | from .retinaface import retinaface 3 | -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/detection/rcnn/dataset/ds_utils.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | 4 | def unique_boxes(boxes, scale=1.0): 5 | """ return indices of unique boxes """ 6 | v = np.array([1, 1e3, 1e6, 1e9]) 7 | hashes = np.round(boxes * scale).dot(v).astype(np.int) 8 | _, index = np.unique(hashes, return_index=True) 9 | return np.sort(index) 10 | 11 | 12 | def filter_small_boxes(boxes, min_size): 13 | w = boxes[:, 2] - boxes[:, 0] 14 | h = boxes[:, 3] - boxes[:, 1] 15 | keep = np.where((w >= min_size) & (h > min_size))[0] 16 | return keep 17 | -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/detection/rcnn/io/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/samples/python/multiprocess_detection/detection/rcnn/io/__init__.py -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/detection/rcnn/logger.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | # set up logger 4 | logging.basicConfig() 5 | logger = logging.getLogger() 6 | logger.setLevel(logging.INFO) 7 | -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/detection/rcnn/processing/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/samples/python/multiprocess_detection/detection/rcnn/processing/__init__.py -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/detection/rcnn/pycocotools/UPSTREAM_REV: -------------------------------------------------------------------------------- 1 | https://github.com/pdollar/coco/commit/336d2a27c91e3c0663d2dcf0b13574674d30f88e 2 | -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/detection/rcnn/pycocotools/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'tylin' 2 | -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/detection/rcnn/pycocotools/setup.py: -------------------------------------------------------------------------------- 1 | from distutils.core import setup 2 | from Cython.Build import cythonize 3 | from distutils.extension import Extension 4 | import numpy as np 5 | 6 | # To compile and install locally run "python setup.py build_ext --inplace" 7 | # To install library to Python site-packages run "python setup.py build_ext install" 8 | 9 | ext_modules = [ 10 | Extension( 11 | '_mask', 12 | sources=['maskApi.c', '_mask.pyx'], 13 | include_dirs=[np.get_include()], 14 | extra_compile_args=['-Wno-cpp', '-Wno-unused-function', '-std=c99'], 15 | ) 16 | ] 17 | 18 | setup(name='pycocotools', ext_modules=cythonize(ext_modules)) 19 | -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/detection/rcnn/symbol/__init__.py: -------------------------------------------------------------------------------- 1 | from .symbol_ssh import * 2 | from .symbol_mnet import * 3 | from .symbol_resnet import * 4 | -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/detection/rcnn/tools/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/samples/python/multiprocess_detection/detection/rcnn/tools/__init__.py -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/detection/rcnn/utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/samples/python/multiprocess_detection/detection/rcnn/utils/__init__.py -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/detection/rcnn/utils/combine_model.py: -------------------------------------------------------------------------------- 1 | from .load_model import load_checkpoint 2 | from .save_model import save_checkpoint 3 | 4 | 5 | def combine_model(prefix1, epoch1, prefix2, epoch2, prefix_out, epoch_out): 6 | args1, auxs1 = load_checkpoint(prefix1, epoch1) 7 | args2, auxs2 = load_checkpoint(prefix2, epoch2) 8 | arg_names = args1.keys() + args2.keys() 9 | aux_names = auxs1.keys() + auxs2.keys() 10 | args = dict() 11 | for arg in arg_names: 12 | if arg in args1: 13 | args[arg] = args1[arg] 14 | else: 15 | args[arg] = args2[arg] 16 | auxs = dict() 17 | for aux in aux_names: 18 | if aux in auxs1: 19 | auxs[aux] = auxs1[aux] 20 | else: 21 | auxs[aux] = auxs2[aux] 22 | save_checkpoint(prefix_out, epoch_out, args, auxs) 23 | -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/detection/rcnn/utils/save_model.py: -------------------------------------------------------------------------------- 1 | import mxnet as mx 2 | 3 | 4 | def save_checkpoint(prefix, epoch, arg_params, aux_params): 5 | """Checkpoint the model data into file. 6 | :param prefix: Prefix of model name. 7 | :param epoch: The epoch number of the model. 8 | :param arg_params: dict of str to NDArray 9 | Model parameter, dict of name to NDArray of net's weights. 10 | :param aux_params: dict of str to NDArray 11 | Model parameter, dict of name to NDArray of net's auxiliary states. 12 | :return: None 13 | prefix-epoch.params will be saved for parameters. 14 | """ 15 | save_dict = {('arg:%s' % k): v for k, v in arg_params.items()} 16 | save_dict.update({('aux:%s' % k): v for k, v in aux_params.items()}) 17 | param_name = '%s-%04d.params' % (prefix, epoch) 18 | mx.nd.save(param_name, save_dict) 19 | -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/models/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding:utf-8 -*- 2 | # @author : cbingcan 3 | # @time : 2021/8/24/024 10:13 4 | -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/models/compilation_cssd_32.bmodel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/samples/python/multiprocess_detection/models/compilation_cssd_32.bmodel -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/predict/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding:utf-8 -*- 2 | # @author : cbingcan 3 | # @time : 2021/8/24/024 11:02 4 | -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/requirements.txt: -------------------------------------------------------------------------------- 1 | flask==1.1.4 2 | cython 3 | scipy 4 | numpy 5 | pillow 6 | sklearn 7 | requests==2.22.0 8 | configobj==5.0.6 9 | pyDes==2.0.1 10 | PyMySQL==0.9.3 11 | borax==3.2.0 12 | tornado==5.1 13 | redis==3.2.1 14 | psutil==5.7.0 -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/setup.py: -------------------------------------------------------------------------------- 1 | # -*- coding:utf-8 -*- 2 | -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/sort/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding:utf-8 -*- 2 | # @author : cbingcan 3 | # @time : 2021/8/24/024 11:02 4 | -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/utils/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding:utf-8 -*- 2 | # @author : cbingcan 3 | # @time : 2021/8/24/024 11:00 4 | SERVER_PORT= 8080 5 | 6 | # input_img_h = 180 7 | # input_img_w = 320 8 | DETECTION_MODEL_PATH = 'models/compilation_cssd_32.bmodel' 9 | DETECTION_SAVE_PATH = "/data/video/save_result" 10 | 11 | DETECTION_TPU_ID = 0 12 | 13 | 14 | VIDEO_LIST = [ 15 | {"id": "35050000002000001371", "name": "001", "rtsp":"/data/video/fps25_num5.mp4"}, 16 | {"id": "35050000002000001372", "name": "002", "rtsp":"/data/video/fps25_num5.mp4"}, 17 | {"id": "35050000002000001373", "name": "003", "rtsp": "/data/video/fps25_num5.mp4"}, 18 | {"id": "35050000002000001374", "name": "004", "rtsp": "/data/video/fps25_num5.mp4"}, 19 | {"id": "35050000002000001392", "name": "013", "rtsp": "/data/video/fps25_num5.mp4"}, 20 | {"id": "35050000002000001393", "name": "014", "rtsp": "/data/video/fps25_num5.mp4"}, 21 | {"id": "35050000002000001394", "name": "015", "rtsp": "/data/video/fps25_num5.mp4"}, 22 | {"id": "35050000002000001395", "name": "016", "rtsp": "/data/video/fps25_num5.mp4"} 23 | ] 24 | -------------------------------------------------------------------------------- /samples/python/multiprocess_detection/websocket/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Webcam over WebSocket using OpenCV and Tornado 5 | 6 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /samples/python/multiprocess_detection_yolox/capture/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding:utf-8 -*- 2 | # @author : cbingcan 3 | # @time : 2021/8/24/024 11:01 4 | -------------------------------------------------------------------------------- /samples/python/multiprocess_detection_yolox/models/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding:utf-8 -*- 2 | # @author : cbingcan 3 | # @time : 2021/8/24/024 10:13 4 | -------------------------------------------------------------------------------- /samples/python/multiprocess_detection_yolox/models/yolox_s_4_int8.bmodel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sophon-ai-algo/sophon-inference/c9fa07851da663dda4953dba72e1d3937299a4ea/samples/python/multiprocess_detection_yolox/models/yolox_s_4_int8.bmodel -------------------------------------------------------------------------------- /samples/python/multiprocess_detection_yolox/requirements.txt: -------------------------------------------------------------------------------- 1 | cython 2 | flask==1.1.4 3 | requests==2.22.0 4 | configobj==5.0.6 5 | pyDes==2.0.1 6 | PyMySQL==0.9.3 7 | borax==3.2.0 8 | tornado==5.1 9 | redis==3.2.1 10 | psutil==5.7.0 11 | -------------------------------------------------------------------------------- /samples/python/multiprocess_detection_yolox/setup.py: -------------------------------------------------------------------------------- 1 | # -*- coding:utf-8 -*- 2 | -------------------------------------------------------------------------------- /samples/python/multiprocess_detection_yolox/websocket/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Webcam over WebSocket using OpenCV and Tornado 5 | 6 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /toolchain-x86_64-linux.cmake: -------------------------------------------------------------------------------- 1 | 2 | set(CMAKE_C_COMPILER $ENV{BMWS}/bm_prebuilt_toolchains/x86-64-core-i7--glibc--stable/bin/x86_64-linux-gcc) 3 | set(CMAKE_CXX_COMPILER $ENV{BMWS}/bm_prebuilt_toolchains/x86-64-core-i7--glibc--stable/bin/x86_64-linux-g++) 4 | -------------------------------------------------------------------------------- /tools/README.md: -------------------------------------------------------------------------------- 1 | * install prerequisites, build and test as a pipeline 2 | ```shell 3 | # sudo privilege is needed 4 | # please excute the command at the project root path 5 | # BMNNSDK_PATH is the absolute path to install BMNNSDK 6 | cd ${BMNNSDK_PATH};source envsetup.sh 7 | bash ./tools/test_all.sh 8 | ``` 9 | * install prerequisites 10 | ```shell 11 | # sudo privilege is needed 12 | bash ./tools/install.sh 13 | ``` 14 | * downlad test data, model and convert to bmodel 15 | ```shell 16 | # get the model list 17 | python3 download_and_convert.py model_list 18 | # downlad test data 19 | python3 download_and_convert.py test_data 20 | # downlad a model in model list and convert it to bmodel 21 | python3 download_and_convert.py model_name 22 | # downlad test data, download all models in model list and convert them to bmodels 23 | python3 download_and_convert.py all 24 | ``` 25 | -------------------------------------------------------------------------------- /tools/ci_test/gitlab_runner_config.toml_soc: -------------------------------------------------------------------------------- 1 | concurrent = 1 2 | check_interval = 0 3 | 4 | [session_server] 5 | session_timeout = 1800 6 | 7 | [[runners]] 8 | name = "soc_test" 9 | url = "https://git.bitmain.vip/" 10 | token = "23c7d551633a044edf81ec535d2983" 11 | executor = "shell" 12 | [runners.custom_build_dir] 13 | [runners.cache] 14 | [runners.cache.s3] 15 | [runners.cache.gcs] 16 | -------------------------------------------------------------------------------- /tools/ci_test/prepare_soc_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SOC_DATA_DIR=/workspace/soc_data 4 | 5 | function clean_data() { 6 | if [ -d $SOC_DATA_DIR ]; then 7 | rm -rf $SOC_DATA_DIR/* 8 | else 9 | mkdir $SOC_DATA_DIR 10 | fi 11 | } 12 | 13 | function fill_data() { 14 | pushd $SOC_DATA_DIR 15 | mkdir -p cpp/lib cpp/bin python3/samples 16 | popd 17 | cp ./build/lib/libsail.so $SOC_DATA_DIR/cpp/lib 18 | cp ./build/bin/* $SOC_DATA_DIR/cpp/bin 19 | cp -r ./out/sophon-inference/python3/soc/sophon $SOC_DATA_DIR/python3 20 | cp -r ./samples/python/* $SOC_DATA_DIR/python3/samples 21 | cp ./tools/ci_test/test_all_soc.sh $SOC_DATA_DIR 22 | } 23 | 24 | clean_data 25 | fill_data 26 | -------------------------------------------------------------------------------- /tools/envset_buildserver.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export PATH=/workspace/bm_prebuilt_toolchains/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/:/workspace/bm_prebuilt_toolchains/mips-loongson-gcc7.3-linux-gnu/2019.06-29/bin/:/workspace/bm_prebuilt_toolchains/x86-64-core-i7--glibc--stable/bin/:/usr/sw/swgcc830_cross_tools-bb623bc9a/usr/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin: 4 | export PATH=/workspace/bm_prebuilt_toolchains/loongarch64-linux-gnu-2021-04-22-vector/bin:$PATH 5 | echo ${PATH} 6 | export LD_LIBRARY_PATH=/workspace/bm_prebuilt_toolchains/x86-64-core-i7--glibc--stable/x86_64-buildroot-linux-gnu/lib64:/workspace/bm_prebuilt_toolchains/loongarch64-linux-gnu-2021-04-22-vector/loongarch64-linux-gnu/sysroot/lib64:/usr/local/lib: --------------------------------------------------------------------------------