Coder Social home page Coder Social logo

atlaswrapper's Introduction

atlas-wrapper

a simple, efficient, easy-to-use HUAWEI Ascend310 Atlas wrapper for cnn with c++ and python api. You will be able use atlas wrapper to fast demo or deploy your FP16 model with few lines of code!

//c++
// create Net
atlas::Net *net = new atlas::Net(modelPath, enginePath, deviceId);
// get Net information
net->getNetInfo()
// inferece
// accept input images as vector<cv::Mat> or vector<uint8_t> with vector<int> for image shape.
// recieve the output and outputDims from atlas::NetResult
net->inference(opencv_img_vec, results);
// net->inference(uint8_t_img_vec, image_shape_vec, results);

// destroy net
delete net;
# python
# import
import pyatlas
# create net
net = pyatlas.net(modelPath, enginePath, deviceId)
# get net information
netInfo = net.getNetInfo()
# inference
result = net.DoInference(img, imgSize)

Features

  • Support Atlas300. Make little change on CMakeLists.txt to support Atlas500, Atlas200SoC.
  • Resize in DVPP, so you can use images of any shape in a batch inference.
  • Auto alignUp for DVPP input.
  • Do mean and std opteration in the first layer (AIPP)
  • Dynamic graph.
  • High performance data transfer between host and device.
  • get net information such as batchSize, net input shapes, output dims and size.
  • Python api support.
  • Set device.

System Requirements

Atlas DDK B893+ and driver

opencv_world 3.4+

for python api, python 2.x/3.x and numpy in needed

Installation

Make sure you had install dependencies list above.

# clone project and submodule
git clone --recurse-submodules ...

cd atlaswrapper

bash build.sh A300 #(options: A500, A200)

then you can intergrate it into your own project with libatlasWrapper.so and Net.h, for python module, you get pyatlas.so

Model Conersion

Please follow the details from the documents of Atlas300

Demo

Please check the c++ & python demo on test folder.

Liscense

AtlasWrapper is released under the [Apache 2.0 license].

TODO

  1. Add demo for model conversion.
  2. Modify CMakeLists.txt to support A500, A200SoC.

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.