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的更多相关文章
随机推荐
- linux安装jdk1.8(rpm方式)
在Oracle官网下载64位的jdk1.8版本 jdk1.8: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloa ...
- dubbo源码阅读
http://seekheap.com/posts/dubbo/dubbo-src-01-overview-and-debug-environment.html 先占坑
- React-菜鸟学习笔记(二)
这篇新颖的东西是React的组件的封装和引用 <!DOCTYPE html> <html> <head> <meta charset="UTF-8& ...
- APM实践目录
长路漫漫,如果不能作出一款可用开源的东西出来,那是对时光的浪费. 这是我的学习分布式调用链的实践之路! 思考大纲: .Net架构篇:思考如何设计一款实用的分布式监控系统? 理论篇: http:// ...
- git 分支管理规范
保证master分支永远处于可部署的状态.禁止自接提交代码到master分支 开发分支基于master分支创建,命名规范如下: 如果是功能需求,分支命名为feature/xxx,xxx要具有描述性 如 ...
- MVC5+EF6入门教程——实现动态创建数据库与登录验证
详细步骤 创建文件夹,规划好项目目录 创建相关实体类 (Data Model) 创建 Database Context 创建Initializer, 使用EF初始化数据库,插入测试数据 实现数据库登录 ...
- C#.NET 大型通用信息化系统集成快速开发平台 4.1 版本 - 访问记录功能改进
当用户数据非常庞大时需要一个功能,就是统计各种账户的访问系统的情况,用户数量的各种参数需要让管理者心里有个数. 1:信息系统中有多少有效账户?可以很方便能知道具体个数,让管理者心里有个数. 2:某个公 ...
- BOM基础 计时器 定时器 DOM 基础
-------------------------------------------滴水穿石,我心永恒. day48 CSSJS 1 ECMA script 2 BOM browser object ...
- Python-Urllib库详解
官方文档地址:https://docs.python.org/3/library/urllib.html 什么是Urllib: Urllib是python内置的HTTP请求库: urllib.requ ...
- Python—randonm模块介绍
random是python产生伪随机数的模块 >>> random.randrange(1,10) #返回1-10之间的一个随机数,不包括10 >>> random ...