I am an elderly developer, and I have been honed in languages such as LOGO, Pascal, C/C++, Java, C#/F#, JavaScript, Python, TypeScript, Rust, Go, etc. 's code farmer. I first heard about low code in 2017, how did it feel? The inside word is that I am not worried that I will lose my job, I always feel like a toy. After several years of development, can low-code really complete all business work? Next, I will help you "explore the store".
from demand
I have been focusing on mobile applications and machine learning technology for the past few years. I am also a Star Wars fan, so let's make a computer vision-based mobile application.
From the traditional approach, this requires deep learning to complete the identification of object classification, then publish services through the cloud, and finally complete application development through cross-platform mobile technology. But how is it done from a low-code perspective?
We completed the work of object classification through Microsoft's custom vision service (CustomVision), and then directly generated the model container code through Custom Vision to directly make a service and publish it to Azure Function, and finally completed the development of mobile applications through Power Apps.
Roll up your sleeves
▌ Zero-code custom computer vision
Computer vision is the most mature technology in the field of artificial intelligence. There are many algorithms, but for developers who are not engaged in this field, they need to relearn from the development environment to deep learning frameworks and algorithms. With Microsoft's custom vision , you don't need any knowledge of artificial intelligence, you only need to upload images for image classification or object recognition to quickly generate computer vision models through the cloud. And you can export these models for offline deployment to the cloud/Internet of Things/mobile devices.
Here are 4 steps to complete computer vision
1. Enter the Azure Portal and create a custom vision service from AI+Machine Learning by adding a resource group (you need an Azure account here)
2. Enter the custom vision portal and create a project with image classification function
Custom vision supports image classification and object recognition. You can choose according to your needs. Here, choose Image Classification (Classification) Choose to identify multiple types of single tags (Single tag per image) It is recommended to choose General (compact), this option supports Supports the export of multiple model types, such as TensorFlow, ONNX, CoreML, suitable for deployment to different terminals, and cloud applications.
3. After the creation is successful, create three folders: BB8, C3PO, and R2D2 after entering, and upload them to the corresponding folders based on the pictures you find.
4. Click to train
After the training is successful, you can see the relevant training results
Find a picture and test it
It's amazing, you don't need any line of code at all, you can complete the computer vision work in 3 steps, and make a lot of money. This allows you to spend more time on application scenarios.
▌PaaS-based Azure Function
Through CustomVision, not only computer vision models can be generated, but also application codes can be generated by combining models based on different application scenarios. You can export through Export. There are many cloud native technologies, and Serverless is a very popular cloud PaaS. Azure Functions in Azure is a serverless solution that enables users to write less code, reduce infrastructure to maintain, and save costs. need to worry about deploying and maintaining servers, the cloud infrastructure provides all the up-to-date resources needed to keep applications running. You just focus on the business code that is most important to you. The code of the Container is exported through Custom Vision, and the code writing, testing, and deployment of the Azure Function can be completed through Visual Studio Code. Below are the relevant steps.
Install Azure CLI and Azure Function CLI
Install the Azure CLI
https://docs.microsoft.com/en-us/cli/azure/install-azure-cli
Install the Azure Function CLI
https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local
1. Open Visual Code, install the Azure Tools plugin, and log in to the relevant Azure account
2. Open the Azure Tools plugin, select the folder under Azure Functions, and create a new Azure Function (I take the Python development environment as an example)
3. Put the code exported from the custom vision into the folder of Azure Function, and modify init.py
Put the exported labels.txt, model.pb, predict.py in the specified folder respectively
Replace the file inside __init__.py
import logging
import azure.functions as func
import io
from PIL import Image
from click import format_filename
from flask import Flask, jsonify
from .predict import initialize, predict_image, predict_url
def main(req: func.HttpRequest) -> func.HttpResponse:
logging.info('Python HTTP trigger function processed a request.')
results = "{}"
try:
image_bytes = req.get_body()
image = Image.open(io.BytesIO(image_bytes))
app = Flask(__name__)
initialize()
with app.app_context():
results = predict_image(image)
score = 0.0
name = ''
for item in results['predictions']:
if item['probability']>score:
score = item['probability']
name = item['tagName']
results = jsonify(
tagName = name ,
tagScore = score
)
results = results.get_data(as_text=True)
except Exception as e:
logging.info(f'exception: {e}')
pass
logging.info('Image processed. Results: ' + name)
return func.HttpResponse(results, status_code=200)
4. Try to test locally
Test with Postman
5. Deploy to Azure
Test with Postman
Compared with the traditional method of model application, you can use the custom vision service to generate the code of the application scenario more easily, and use the Azure Function deployment as an interface to call any application scenario, eliminating a lot of tedious work.
▌ Drag-and-drop mobile development experience - Power Apps
Nowadays, there are many application scenarios for the front-end of business, especially in the Internet era, mobile applications of iOS/Android are very important. In the past, teams needed to use Flutter/Xamarin/ReactNative to complete the development of cross-platform mobile applications. But Power Apps are low-code application products for business application scenarios. You can use it to publish front-end applications in combination with your business. Power Apps is very suitable for people without a code base. You can complete UI development by dragging and dropping controls. In business, you can combine your business logic and data to make calls. Next, let's take a look at how to combine our computer vision-based Azure Func to make a very simple application (Power Apps also comes with AI Builder tool, which can be very convenient to combine the previously mentioned A custom service does the work, and this example is for better illustration)
1. opens the Power Apps portal and creates a mobile phone application
Choose to create a Phone app
2. Drag and drop related controls to generate an interface
3. Go back to the Power Apps portal and create a custom linker
A key point here is that when adding Action, because the transmission is a binary format, the Body of Request needs to be set to "" instead of a Json, and it must be set to binary
4. Go back to the mobile phone application you just created and add the data source you just created
5. Click the button control and enter the following instructions on the formula
Set(Info, StarWarAzureFunc.UploadImage(Image1.Image));
6. Select Label and enter the following command on the formula
Info.tagName
7. Select Run
After writing two lines of code, I completed a bunch of tedious work in the past and released a computer vision application. This shortens a lot of connection time, which is very necessary for business personnel. You can not only complete the operation of artificial intelligence, but also connect more business data and display more business elements.
"Exploring the Store" Summary
The low-code "exploration shop" in 2022 has given me a deeper understanding, and I can give anyone what could only be done by developers in the past. Low-code has gone through the stages from concept to usable to usable. "Everyone can program" is finally here. Low-code allows more people to release more application scenarios more efficiently, and accelerates the digital transformation of enterprises in combination with the cloud.
Free application for Azure resources
Azure Student Resources Credit Card Free Application
https://aka.ms/studentgetazure
Learn more about custom computer vision
https://docs.microsoft.com/zh-cn/azure/cognitive-services/custom-vision-service/overview
Learn more about Azure Functions
https://docs.microsoft.com/zh-cn/azure/azure-functions/
Learn more about Power Apps
https://docs.microsoft.com/zh-cn/powerapps/powerapps-overview
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。