Skip to content

Latest commit

 

History

History
66 lines (40 loc) · 2.56 KB

README-en.md

File metadata and controls

66 lines (40 loc) · 2.56 KB

中文 | Screencast | Live demo! | Coding tutorial

Quick start

Make sure that you have the Serverless Framework installed. Clone this repo, and run the following command to build and deploy the entire application.

$ sls deploy
... ...
  website:       https://sls-website-ap-hongkong-kfdilz-1302315972.cos-website.ap-hongkong.myqcloud.com
  vendorMessage: null

63s › tencent-tensorflow-scf › "deploy" ran for 3 apps successfully.

Load the website URL in any web browser and start to use this function to identify objects in photos.

GitHub could be very slow behind the Great Chinese Firewall. Clone from Gitee if you are in mainland China. git clone https://gitee.com/secondstate/tencent-tensorflow-scf.git

Build your own Tensorflow cloud function

Fork this repo and use the Code | Open with Codespaces button to launch Github Codespaces IDE in your browser. It may take a few minutes to start the first time.

Low code development

Once the Codespaaces IDE starts, you can make simple changes to the source code to customize it for your own applications. See a coding tutorial

  • Make changes to the Tensorflow model and data pre-processing and post-processing logic in src/lib.rs file.
  • Make changes to the front end UI in the website/content/index.html file.

Build

Open a Terminal windon in the Codespaces IDE, and run the following command to build your cloud function.

$ ssvmup build --enable-aot

Deploy

In the Terminal window, run the following commands to deploy the Tensorflow cloud function to the Tencent Cloud.

$ cp pkg/scf.so scf/

$ sls deploy
... ...
  website:       https://sls-website-ap-hongkong-kfdilz-1302315972.cos-website.ap-hongkong.myqcloud.com

Load the deployed URL in any web browser and have fun!

Develop on your own computer

If you cannot or do not wish to use Github Codespaces, you can install the ssvmup and serverless framework toolchains on your own computer (or Docker image) to build and deploy Tensorflow serverless functions.

Install the ssvmup tool

Install the Serverless Framework via the NPM.

$ npm install -g serverless

That's it. You can now follow the Codespaces' build and deploy instructions above.