Life is short, use cloud for development | How to elegantly complete the programmer's knight dream?

Head picture.png

Author | Ma Chao
Source | Alibaba Cloud Native Official Account

The charm of Coding is so strong that it has attracted countless programmers to compete. At the 1024 Programmer Festival held by CSDN this year, Qiu Bojun, the great master of the first generation of programmers in China, said that he was happy to see someone using WPS back then, because Many people use it. Then, I will also find out who cracked it, so I met Lei Jun. Although I am retired, I am still writing code, writing game code, not commercial software....In fact, I am writing a plug-in. I am embarrassed to take this Show off, but it does make the game easier. It can be said that the highest goal of every programmer is to let your own code and your own projects circulate widely.

If a worker wants to do his job well, he must first obtain his tools. A handy programming tool is undoubtedly an efficiency artifact for programmers, which can make development work twice the result with half the effort. After the author personally tried cloud native development tools, it can be said that the latest development platform represented by the cloud development platform, with The efficiency boost that comes is amazing.

Ten years ago, there was a saying in the industry that “code is engulfing the world”, and later it was said that “everything in the Internet world comes from open source.” However, it was only recently that people really realized that cloud native is the big one behind it. BOSS, anyone who does not use the cloud will fall behind, cannot be agile, and cannot keep up with the times. As a model of cloud native tools, cloud development platforms will inevitably become mainstream programming artifacts in the future.

1.png

Let's take a look at the development history of the development platform first, and read with readers the general trend formed by the combination of cloud native and DEVOPS. The development platform is like a sword in the hands of programmers, except that the sword in the hands of programmers has changed from the time when they could only be carried with them, and has become a flying fairy from the cloud.

From localized development to online development

After the emergence of high-level languages, programmers only need to care about core business logic and code implementation, and no longer need to care about specific assembly language manuals, and no longer have to deal with registers. In particular, IDEs make programmers less and less configuration and debugging work outside of the code. Localized development platforms such as the earliest vim+gcc and later Borland's Powerbuilder, as well as the later local IDE masters Visual stuio and Eclipese, were also all the rage when they were launched.

But such development tools are actually the products of the software era. The software companies in those days only provided compiled binary executable programs instead of source code. The source code was of more commercial significance and would not even be made public within the company. In this context, localized development tools can indeed accomplish his mission.

However, with the rise of the open source foundation society GNU and the popularity of Linux, the concept of open source has gradually become popular with the Internet era. The legendary IT industry Eric Raymond said in his epic book "The Cathedral and the Bazaar" There are two types of buildings in the world: one is the market, which is open every day, from scratch, from small to large; the other is the cathedral, which has been built with the painstaking effort of several generations. use. When you build a new building, you can use the market model or the cathedral model. Generally speaking, the market is characterized by open construction, low cost, short cycle, and mediocre quality; the cathedral is characterized by closed construction, high cost, long cycle, and excellent quality. Driven by the open source model, online development platforms represented by Github's Web Ide and kaggle have risen. This also makes it possible for thousands of master developers to simultaneously develop open source projects.

However, although the online development platform is more closely integrated with the code warehouse, it cannot be completely agile, cannot directly implement WYSIWYG testing, and cannot release the version efficiently and quickly. It can be said that this is not the ultimate development platform. form.

Cloud development platform zero distance

Combining cloud services with development platforms, serverless services can be invoked at any time during development, which is what you see is what you get. The following author will take everyone to experience the charm of the cloud development platform together.

At present, face information is already a key area of ​​information security. For example, the Partialconv model can repair images through AI ( Partialconv's paper address , Partialconv's Github portal ), even if the image loses a large area of ​​pixels The loss can be repaired through AI. Partialconv is also the originator of the so-called “one-click to “clothes”, one-click to “code” applications. The effect diagram is as follows:

2.png

When Partialconv was launched, many people exclaimed that avatar coding will no longer be safe, and it even makes no sense at all.

The AI ​​face- changing project ALAE based on self-encoding technology  successfully reached the top of Github, and then it opened a new era of AI face-  changing . Compared with the previous face image processing projects, ALAE can be described as the level of the big boss, just post a few. Let's take a look at the effect picture.

3.png

Not only does the image distinguish several blocks of the previous generations of face-changing models, but the visualization of the learning process is also stronger.

4.gif

It can be said that once the facial information is lost, the consequences will be very serious, and it is just a need for many young people to share social dynamics, which means exposing photos. So how to balance is a problem.

The answer to this question is to cartoonize your own images, such as using the UGATIT ( paper address , Github address ) model to convert your avatar between various cartoon styles.

5.png

However, using such a professional AI model to install and configure is very complicated, and it has always been done by professionals. It was difficult for ordinary people to use such AI services before, but with the support of the cloud development platform, such applications have changed. It's very simple.

However, the installation and configuration of such a professional AI model is very complicated, and it has always been done by professionals. It was difficult for ordinary people to use such AI services before, but with the addition of cloud development platforms, such applications have become It's very simple.

You only need to delete the cloud development platform service and activate related services, and the conversion of a cartoon avatar can be completed in a few minutes.

1. Request parameters

6.jpg

2. Return data

7.jpg

3. Examples

1) Request example

http(s)://[Endpoint]/?Action=GenerateHumanAnimeStyle
&ImageURL=http://invi-label.oss-cn-shanghai.aliyuncs.com/label/temp/cartoon/test_data/g1.png
&<公共请求参数>

2) Example of normal return

  • XML format
<RequestId>59697D68-2A6E-4553-89BD-0FADD07881E8</RequestId>
<Data>
    <ImageURL>http://vibktprfx-prod-prod-aic-gd-cn-shanghai.oss-cn-shanghai.aliyuncs.com/person-image-cartoonizer/59697D68-2A6E-4553-89BD-0FADD07881E8_7ee5_20201027-070958.jpg?Expires=1603784400&OSSAccessKeyId=LTAI4FoLmvQ9urWXgSR****&Signature=ut2kn46Lz%2FRwqJ9jWJ0RBDut12****</ImageURL>
</Data>
  • JSON format
{
    "RequestId": "59697D68-2A6E-4553-89BD-0FADD07881E8",
    "Data": {
        "ImageURL": "http://vibktprfx-prod-prod-aic-gd-cn-shanghai.oss-cn-shanghai.aliyuncs.com/person-image-cartoonizer/59697D68-2A6E-4553-89BD-0FADD07881E8_7ee5_20201027-070958.jpg?Expires=1603784400&OSSAccessKeyId=LTAI4FoLmvQ9urWXgSR****&Signature=ut2kn46Lz%2FRwqJ9jWJ0RBDut12****"
    }
}

The above code is very simple to configure such an HTTP request on the cloud development platform , which can not only be quickly debugged:

8.png

There is even a free production environment call quota of 100,000 times:

9.png

Of course, if readers have the needs of WeChat applets, their implementation is also very simple and fast. They only need to upload a portrait image, pass it to the backend, and the backend calls the algorithm and returns the result .

3. Mini Program Calling API Example

wx.chooseImage({
  success({ tempFiles }) {
    var files = tempFiles
    that.fileUpload(files[0].path);
    wx.request({
      url: '/api',
      method: 'GET|POST',
      data: {
        imageUrl: 'url'
      }
    })
  }
})

The test results are as follows:

10.png
Original image

11.jpg
Cartoon result graph

This kind of rapid development method and function realization can be regarded as a kind of chivalrous man who has a lot of fame and fame afterwards. The Yunyuanfa platform is actually a cloud native platform. As long as you have an idea, you can quickly become a corresponding one. With the fast launch of functions, Xiaobai can also become a martial arts hero with the blessing of the cloud development platform, realizing the era of geeks. The biggest difference between the IT industry and the traditional industry is that there is a shadow of chivalrous rivers and lakes hidden behind it. The author believes that Ali’s cloud development platform with great sincerity this time will surely receive pertinent opinions and support from the technical community. The cloud development platform has launched a fast-stretching path for various martial arts masters, and in this process of continuous exchanges and discussions, the martial arts level of each school will definitely be improved. So here, I also sincerely hope that Ali will launch more high-quality cloud-native projects in the future to promote the healthy development of the industry.

Guess you like

Origin blog.51cto.com/13778063/2588865