Giter Site home page Giter Site logo

jungin500 / snpe-docker Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 1.0 15 KB

Unofficial docker wrapper for Qualcomm SNPE(Snapdragon Neural Processing Engine) SDK

Home Page: https://hub.docker.com/r/jungin500/snpe

Dockerfile 70.95% Shell 29.05%
docker snpe snapdragon sdk linux tensorflow caffe caffe2

snpe-docker's Introduction

Unofficial Dockerized Qualcomm Neural Processing SDK (SNPE - Snapdragon Neural Processing Engine)

SNPE Version jungin500/snpe-docker jungin500/snpe

Description

  • I've packaged Qualcomm's SNPE SDK into dockerized environment, as installing Caffe over different environment took ALMOST FULL DAY for me! (BVLC/caffe didn't supplied python wheel file, and caffe V1 repository was deprecated as there was no updates in recent 2 years!)

License

  • Qualcomm's PKLA(Product Kit License Aggrement) indicates that SDK should not be included in open source in any forms (refer to the license text:
    3.5. Open Source Prohibition.
    LICENSEE shall not ... incorporate, link, distribute or use any third party software or code in conjunction with any part of a PKLA Product Kit ...
    
  • If you agree the Full License, you could download SNPE SDK. Recommending to use it for educational/study purpose.

Requirements

  • Windows(Docker Desktop with WSL2), Linux
  • Docker
  • Qualcomm Neural Processing SDK for AI v1.53.2 (or newer): Download snpe-1.53.2.zip
    • WARNING: Version under (or same as) SNPE 1.48.0 would not work. Qualcomm changed host platform from Ubuntu 16.04 to 18.04, and a lot of libraries are changed. Try at your own adventure.
  • Boost 1.77.0 source: Download boost_1_77_0.tar.gz
    (Be aware that boost's distribution platform jfrog didn't let me automatically download their sourcecode using wget!)

Usage

  1. Download snpe-1.53.2.zip or newer.

  2. Create new empty directory and unzip file snpe-1.53.2.zip into that directory.

  3. Run following command (${SNPE_ROOT} refers to current directory, you could replace it with $(pwd) on linux, or full path on windows WSL2 environment)

    docker run \
        -it --rm \
        -v ${SNPE_ROOT}:/snpe \
        jungin500/snpe:1.5x
  4. (Optional) Run examples inside SNPE SDK's /snpe/models directory:

    cd /snpe
    
    # It will take some time (5~10mins) to download AlexNet from Caffe repository
    python models/alexnet/scripts/setup_alexnet.py -a models/alexnet/assets -d

    Output should show up like following:

    ... (Download sequence)
    
    Copying Caffe model
    Modiying prototxt to use a batch size of 1
    Creating DLC
    2021-09-09 08:45:54,886 - 188 - INFO - across channels=True
    2021-09-09 08:45:54,887 - 188 - INFO - across channels=True
    2021-09-09 08:45:55,901 - 188 - INFO - INFO_DLC_SAVE_LOCATION: Saving model at /snpe/models/alexnet/dlc/bvlc_alexnet.dlc
    2021-09-09 08:46:18,776 - 188 - INFO - INFO_CONVERSION_SUCCESS: Conversion completed successfully
    Getting imagenet aux data
    Creating ilsvrc_2012_mean.npy
    Creating %s ilsvrc_2012_mean_cropped.bin
    Creating ilsvrc_2012_labels.txt
    Create SNPE alexnet input
    processing /snpe/models/alexnet/data/chairs.jpg
    processing /snpe/models/alexnet/data/notice_sign.jpg
    processing /snpe/models/alexnet/data/plastic_cup.jpg
    processing /snpe/models/alexnet/data/trash_bin.jpg
    Create file lists
    /snpe/models/alexnet/data/cropped/raw_list.txt created listing 4 files.
    /snpe/models/alexnet/data/target_raw_list.txt created listing 4 files.
    Setup alexnet completed.
    

    and result model .dlc file would be created on models/alexnet/dlc/bvlc_alexnet.dlc:

    (snpe) root@fc6441ac1308:/snpe# ls -alh models/alexnet/dlc/
    total 233M
    drwxrwxrwx 1 1000 1000 4.0K Sep  9 07:18 .
    drwxrwxrwx 1 1000 1000 4.0K Sep  8 08:40 ..
    -rwxrwxrwx 1 1000 1000 233M Sep  9 08:46 bvlc_alexnet.dlc
    
  5. You can use SNPE's python tools listed below:

    snpe-caffe-to-dlc
    snpe-caffe2-to-dlc
    snpe-diagview
    snpe-dlc-diff
    snpe-dlc-info
    snpe-dlc-quantize
    snpe-dlc-reorder
    snpe-dlc-viewer
    snpe-net-run
    snpe-onnx-to-dlc
    snpe-parallel-run
    snpe-platform-validator-py
    snpe-tensorflow-to-dlc
    snpe-tflite-to-dlc
    snpe-throughput-net-run
    snpe-udo-package-generator
    

snpe-docker's People

Contributors

jungin500 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

abbyzak

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.