NotBacon
What's It Do?
The application consists of two components:
- A Custom Vision Service project that allows you to build a custom image classifier to detect bacon in a photo.
- An Azure Web App to display a web interface for users to submit photos.

Configuration
Create a Custom Vision Service account
- Navigate to customvision.ai.
- Click Sign in and log in with your Microsoft Account.
Create and train a Custom Vision project
Click on New Project.
- Provide a name for the project.
Select Food as the domain to optimize the model to work with plates of food.

Obtain a variety of photos. To properly train your model, you need at least 30 photos that contain bacon, and 30 that do not. Download and separate the photos into two folders:
baconandnot-bacon.Tip
A good place to find photos is by doing an internet image search for
breakfast. The list of images used in the training set for this article is here.Click on Add Images and select all the photos you previously downloaded in the
baconfolder.- Create a tag named
baconand click + to add it.
- Create a tag named
Click Upload to upload the photos and tag them as bacon.

Click on Add Images again to add images from the not-bacon folder. This time, tag them as not-bacon.

Click Train to train the image classifier. When training is complete, your model is ready to use.

Click Quick Test to test your classifier. Find a photo that was not in your training set. Browse local files to upload it or enter its URL. Check that the model correctly predicted the tags for the photo.

Obtain Custom Vision Service API information
In order to configure the web application, you need some information about the Custom Vision Service project you created.
- Select the Performance tab in your project.
If you have trained your model more than once, select the latest iteration and click Make Default. The default REST API endpoint of your project is set to use this iteration of the model.

Click on Prediction URL. Under the "If you have an image URL" section, copy the API endpoint URL and the prediction key value for use in the next step.

Deploy to a Web App
- Click the Deploy to Azure link here or the button at the top of this page.
- If prompted, sign in to your Azure account.
- Enter the information for your new application, such as the resource group name, site name, etc.
- Fill in the Custom Vision API Key and Custom Vision API URL with the values that you previously copied.

- Click Next and then Deploy.
Test the web application

- If the application is successfully deployed, the Deploy to Azure tool displays a URL. Open the application by clicking on the link.
- Find a photo on the internet, paste its URL in the URL text box, and click Submit.
- The application should display whether or not bacon was detected in the photo.
How it works
The web application calls the Custom Vision Service REST API with the URL of the image to be analyzed in the body. Here is an example of the JSON response:
{
"Id": "38d1249f-7153-4c2b-aa11-292bf9bd7085",
"Project": "736b29fa-0c84-4f3e-87ee-201012399fd7",
"Iteration": "d27e017e-c162-4c10-9610-19772d5e5049",
"Created": "2017-08-21T17:48:26.2785384Z",
"Predictions": [
{
"TagId": "017dab76-8630-4ef4-9cd0-46cec6b01655",
"Tag": "bacon",
"Probability": 0.845978856
},
{
"TagId": "bf9f817a-ed74-4bb3-8e9d-49f1b3b7a4bb",
"Tag": "no-bacon",
"Probability": 0.041467078
}
]
}
NotBacon的更多相关文章
随机推荐
- python __call__方法的使用
介绍一下python __call__ 方法的使用 代码如下: #!/usr/bin/env python # -*- coding: utf- -*- ''' __call__方法 普通的类定义的方 ...
- CF833D Red-Black Cobweb 点分治、树状数组
传送门 统计所有路径的边权乘积的乘积,不难想到点分治求解. 边权颜色比例在\([\frac{1}{2},2]\)之间,等价于\(2B \geq R , 2R \geq B\)(\(R,B\)表示红色和 ...
- 如何备份和恢复你的TFS服务器(二)
配置一个备份计划 在你的TFS(Team Foundation Server)2010服务器上安装新版本的Power Tools以后(是的,这个工具只支持TFS(Team Foundation Ser ...
- FineUIPro v3.6.0 发布了(3 年助力 200 家企业的信息化建设)!
FineUI(专业版)自从 2014-07-30 发布第一个版本以来,3 年来已经持续更新了 25 个版本,我们的坚持有目共睹,同时也受到了 200 家企业的青睐和信任,感谢一路有你. FineUI( ...
- 如何解决 Windows 实例出现身份验证错误及更正 CredSSP
阿里云上的ESC赠送1核2G服务器,安装windows server 2016 Datacenter 3389远程登录时提示错误信息,参考阿里文档:https://help.aliyun.com/kn ...
- 基于 Django的Ajax实现 文件上传
---------------------------------------------------------------遇到困难的时候,勇敢一点,找同学朋友帮忙,找导师求助. Ajax Ajax ...
- 如何在Github中删除已有仓库或文件
一.删除已有仓库如果我们想要删除Github中没有用的仓库,应该如何去做呢? 进入到我们需要删除的仓库里面,找到“settings”即仓库设置: 然后,在仓库设置里拉到最底部,找到“Danger Zo ...
- remote:error:refusing to update checked out branc
参考网上的GIt服务器配置流程(http://blog.csdn.net/ice520301/article/details/6142503) 遇到了 http://www.cnblogs.com/c ...
- 使用HttpUtils完成Http Basic 认证
调用声网(agora)的远程接口(Restful Api)时,对方需要使用Basic Auth的方式进行认证(需要输入用户名和密码). 一,使用Postman完成基于Basic Auth的Http认证 ...
- O(N) 求数组中最大子串和
int MaxSubSum3(int *arr, int len) { int i; long long MaxSum = 0; long long CurSum = 0; for(int i = 0 ...