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 全栈开发,Day42(Thread类的其他方法,同步锁,死锁与递归锁,信号量,事件,条件,定时器,队列,Python标准模块--concurrent.futures)
昨日内容回顾 线程什么是线程?线程是cpu调度的最小单位进程是资源分配的最小单位 进程和线程是什么关系? 线程是在进程中的 一个执行单位 多进程 本质上开启的这个进程里就有一个线程 多线程 单纯的在当 ...
- Luogu P1776 宝物筛选_NOI导刊2010提高(02)(多重背包模版)
传送门 多重背包板子题, 多重背包就是每种东西有好几个,可以把它拆分成一个一个的01背包 优化:二进制拆分(拆成1+2+4+8+16+...) 比如18=1+2+4+8+3,可以证明18以内的任何数都 ...
- JPA和分布式事务简介
1. Transaction 分两种,Local Transaction 和 Global Transaction. 涉及到一个Connection的Commit,称为Local Transactio ...
- LeetCode264:Ugly Number II
自己的做法超时了.主要是每次生成一个数据,保存到list中,然后对List重新排序.排序太耗费时间 记录下讨论组里的写法 public int NthUglyNumber(int n) { int[] ...
- 快看Sample代码,速学Swift语言(3)-运算符
运算符是用来检查,更改或组合值的特殊符号或短语.Swift提供的很多常规的运算符,如+.-.*./.%.=.==等,以及逻辑运算的&&.||等等,基本上不需要重复介绍,我们在这里只需要 ...
- DOM(二)
文档信息 document对象还有一些标准的Document对象所没有的属性: title属性:包含着<title>元素中的文本——显示在浏览器窗口的标题栏或标签页上,通过整个属性可以取得 ...
- kuangbin 基础DP集合
HDU 1024第一遍水过,没有体会到这个题的奥妙,思考了很久终于体会了.大概意思是求把序列分成m段的子序列,并不一定要覆盖完,求子序列和的最大值我们首先要写出基本的动态转移方程: DP:dp[ i ...
- semantic-ui 输入框
1.标准输入框 semantic-ui中定义输入框需要将input标签包含于另外一个标签内,外层标签的class为ui input,注意外层标签可以是div,span.p.i. <div cla ...
- Java ME Technology - CDC(Connected Device Configuration)
Java ME Technology - CDChttps://www.oracle.com/technetwork/java/javame/tech/index-jsp-139293.html Ne ...
- sys模块进度条玩法笔记
#! /user/bin/env python# -*- encoding:utf-8 -*-import time,sys for i in range(31): sys.stdout.write( ...