Latest YouTube Video
Saturday, December 9, 2017
Ravens: Jeremy Maclin (back) questionable Sunday vs. Steelers - Adam Schefter (ESPN)
via IFTTT
wsg/ - asmr
from Google Alert - anonymous http://ift.tt/2BoqfLR
via IFTTT
Geoip2 anonymous ip database download
from Google Alert - anonymous http://ift.tt/2jE6cyg
via IFTTT
ID CARD and non-anonymous profiles For secure reviews.
from Google Alert - anonymous http://ift.tt/2C26VRJ
via IFTTT
▶ Eric Weddle raids the dessert aisles and makes huge ice cream sundae after last week's win (ESPN)
via IFTTT
IX➍ freebtc4all.com - free BTC. BTC generator anonymous
from Google Alert - anonymous http://ift.tt/2kPwxNy
via IFTTT
Anonymous user edc3e5
from Google Alert - anonymous http://ift.tt/2A6CIzs
via IFTTT
Anonymous user 49e20e
from Google Alert - anonymous http://ift.tt/2AIvFxK
via IFTTT
Anonymous user e54127
from Google Alert - anonymous http://ift.tt/2nJ540N
via IFTTT
Anonymous user 4067f6
from Google Alert - anonymous http://ift.tt/2Aq08UM
via IFTTT
I have a new follower on Twitter
PS Marketing
Growth Hacker, Data Driven Business Developer, Coach, CEO, CRO, Marketing Automation, Keynote, Wordpress King, 90 days of Success Founder - https://t.co/QiKUHIcSUt
City of London, London
https://t.co/nuo5uy7I3p
Following: 12157 - Followers: 16011
December 09, 2017 at 07:25AM via Twitter http://twitter.com/marketingbyps
Pre-Installed Keylogger Found On Over 460 HP Laptop Models
from The Hacker News http://ift.tt/2C11geE
via IFTTT
Anonymous pastebin
from Google Alert - anonymous http://ift.tt/2y9U9NH
via IFTTT
Fresh anonymous proxy list
from Google Alert - anonymous http://ift.tt/2kJMLY8
via IFTTT
Anonymous text app
from Google Alert - anonymous http://ift.tt/2y9usNl
via IFTTT
I have a new follower on Twitter
Paul Jauregui
Marketing Executive at @PraetorianLabs focused on #IoT #Security for the next wave of innovation. https://t.co/2w13o9VOT0 #InternetOfThings #IIoT #CyberSecurity
Austin, TX
https://t.co/5vhg39DqqT
Following: 15271 - Followers: 17187
December 09, 2017 at 05:50AM via Twitter http://twitter.com/pauljauregui
I have a new follower on Twitter
Chuck Thomas
CEO @HollywogCompany
Chattanooga, TN
https://t.co/GuCYDu6gZa
Following: 1969 - Followers: 2968
December 09, 2017 at 04:50AM via Twitter http://twitter.com/Chuck__Thomas
Android Flaw Lets Hackers Inject Malware Into Apps Without Altering Signatures
from The Hacker News http://ift.tt/2BMWkZR
via IFTTT
I have a new follower on Twitter
PrecisionClass
#IoTClass Get smarter about #IoT
San Jose, CA
https://t.co/lgB8AZ6Mhu
Following: 5987 - Followers: 7273
December 09, 2017 at 04:30AM via Twitter http://twitter.com/precisionclass
Stardust in Aries
Friday, December 8, 2017
This Is What Alcoholics Anonymous Taught Me About Parenting through Recovery
from Google Alert - anonymous http://ift.tt/2jyED9J
via IFTTT
Emotion anonymous meetings
from Google Alert - anonymous http://ift.tt/2yQgweM
via IFTTT
Anonymous donor lays $25K challenge on CMN Radiothon
from Google Alert - anonymous http://ift.tt/2jyaMy5
via IFTTT
Lawyer in Sale (M33) | Anonymous
from Google Alert - anonymous http://ift.tt/2kFnheu
via IFTTT
Anonymous user b9b018
from Google Alert - anonymous http://ift.tt/2nFmSd6
via IFTTT
I have a new follower on Twitter
Carlos R. Guevara
Sr. Digital Marketing Specialist in the world of #CustomerData #Technology #customerintelligencemanagement | Marketing Director @B2H_org non-profit #TeamBTH
Toronto, Ontario
https://t.co/Z7zVnECftu
Following: 4295 - Followers: 5098
December 08, 2017 at 01:20PM via Twitter http://twitter.com/crguevar
Anonymous Gifts and Nonprofit Transparency: A Concern for Nonprofit Boards
from Google Alert - anonymous http://ift.tt/2iEnSJg
via IFTTT
ISS Daily Summary Report – 12/07/2017
from ISS On-Orbit Status Report http://ift.tt/2kcoHJB
via IFTTT
data-dialog-type not working in mobile view for anonymous users
from Google Alert - anonymous http://ift.tt/2iFCDeL
via IFTTT
Anonymous
from Google Alert - anonymous http://ift.tt/2B3OIpf
via IFTTT
The Trouble with Anonymous Feedback
from Google Alert - anonymous http://ift.tt/2BgGUAF
via IFTTT
Option to avoid generated contents authored by anonymous users
from Google Alert - anonymous http://ift.tt/2B3OxKB
via IFTTT
SSL Server Allows Anonymous Authentication Vulnerability
from Google Alert - anonymous http://ift.tt/2y7NGCI
via IFTTT
[FD] Follow-up on CVE-2017-8769 - WhatsApp Issues with Media Files
Source: Gmail -> IFTTT-> Blogger
[FD] APPLE-SA-2017-12-6-1 macOS High Sierra 10.13.2, Security Update 2017-002 Sierra, and Security Update 2017-005 El Capitan
Source: Gmail -> IFTTT-> Blogger
Alpine Superga Moonset
Thursday, December 7, 2017
Anonymous text app
from Google Alert - anonymous http://ift.tt/2nM9zrJ
via IFTTT
qbittorrent/qBittorrent
from Google Alert - anonymous http://ift.tt/2j6BIrI
via IFTTT
(07/12/2017)[N,E,W,S]⑸ free anonymous bitcoin sallet - free bitcoin sm.
from Google Alert - anonymous http://ift.tt/2kvnVLH
via IFTTT
I have a new follower on Twitter
Dan Yarmoluk
#InternetOfThings #IIoT #IoT #DataScientist Value Creation, Commercialization, Business Models, #Bigdata #Analytics #MachineLearning #AI #DigitalTransformation
Minneapolis, MN
https://t.co/vMjAo9jTrL
Following: 39104 - Followers: 49367
December 07, 2017 at 06:18PM via Twitter http://twitter.com/YarmolukDan
I have a new follower on Twitter
IM Consult Services
We are #onlinemarketing consultants who help #business owners effectively use online #marketing. Qualify for a free 60-minute Results In Advance session.
--- Check out our website ---
https://t.co/0Fr10ieOM8
Following: 8428 - Followers: 10430
December 07, 2017 at 06:18PM via Twitter http://twitter.com/IMConsultServ
I have a new follower on Twitter
WiTouchPro
WiTouch Pro #Bluetooth #TENS #therapy offers affordable #BackPain relief to help you make it through the day & keep moving #Wearable #Pain #Relief #PainRelief
Chattanooga, TN
https://t.co/WlEHbzXrCT
Following: 1122 - Followers: 60
December 07, 2017 at 06:18PM via Twitter http://twitter.com/WiTouchPro
📷 Kevin Gausman will wear No. 34 next season to honor Roy Halladay (ESPN)
via IFTTT
I have a new follower on Twitter
Daniel Elizalde
Founder of TechProductManagement. Learn the skills to manage any IoT Product | https://t.co/EH2QXcBk6u #prodmgmt #InternetOfThings #IoT #IIoT
San Francisco, CA
https://t.co/EH2QXcBk6u
Following: 43291 - Followers: 43637
December 07, 2017 at 04:18PM via Twitter http://twitter.com/delizalde
Sample Essay On Alcohol Anonymous
from Google Alert - anonymous http://ift.tt/2kx9M0w
via IFTTT
GTJ3 free anonymous bitcoin wallwt | frede bitcoin spinner 1.2 apk.
from Google Alert - anonymous http://ift.tt/2j31i0Q
via IFTTT
Anonymous hero risked his life to save a rabbit from wildfire in California
from Google Alert - anonymous http://ift.tt/2kyAVA1
via IFTTT
Ravens: WR Jeremy Maclin (back) not practicing Thursday; LB C.J. Mosley (neck) limited (ESPN)
via IFTTT
RocketChat/Rocket.Chat
from Google Alert - anonymous http://ift.tt/2AkbVDJ
via IFTTT
General manager gastro pub in London | Anonymous
from Google Alert - anonymous http://ift.tt/2BbSZak
via IFTTT
ISS Daily Summary Report – 12/06/2017
from ISS On-Orbit Status Report http://ift.tt/2AkBvbQ
via IFTTT
Security Analysis and Improvement of An Anonymous Attribute-Based Proxy Re-encryption
from Google Alert - anonymous http://ift.tt/2iCbc5x
via IFTTT
Security Flaw Leaves Major Banking Apps Vulnerable to MiTM Attacks Over SSL
from The Hacker News http://ift.tt/2kwIOpM
via IFTTT
Anonymous Canton gold coin donor steps up once again for Salvati
from Google Alert - anonymous http://ift.tt/2k7eBcY
via IFTTT
Anonymous texting apk
from Google Alert - anonymous http://ift.tt/2Bc9h3e
via IFTTT
CEA Meeting (Cookie Eaters Anonymous)
from Google Alert - anonymous http://ift.tt/2AiClGa
via IFTTT
Process Doppelgänging: New Malware Evasion Technique Works On All Windows Versions
from The Hacker News http://ift.tt/2nCb1Nf
via IFTTT
Largest Crypto-Mining Exchange Hacked; Over $70 Million in Bitcoin Stolen
from The Hacker News http://ift.tt/2j3Nnrg
via IFTTT
Slambana #14 ft. Waasabi, Thor, Anonymous Moniker
from Google Alert - anonymous http://ift.tt/2AyZCCE
via IFTTT
Uber Paid 20-Year-Old Florida Hacker $100,000 to Keep Data Breach Secret
from The Hacker News http://ift.tt/2AZxPvK
via IFTTT
Wednesday, December 6, 2017
Anonymous Tips
from Google Alert - anonymous http://ift.tt/2ABlg6Z
via IFTTT
Anonymous email reviews
from Google Alert - anonymous http://ift.tt/2iYCwyZ
via IFTTT
Beautiful/Anonymous Podcast with Chris Gethard
from Google Alert - anonymous http://ift.tt/2krOvp9
via IFTTT
Anonymous Basketball Player Goes Up for Dunk, Gets Totally Annihilated
from Google Alert - anonymous http://ift.tt/2j1Dnz1
via IFTTT
Dec 5 -Jespersen - 11:45 - 630 CHED Santas Anonymous teddy bear toss
from Google Alert - anonymous http://ift.tt/2krOq4P
via IFTTT
ISS Daily Summary Report – 12/05/2017
from ISS On-Orbit Status Report http://ift.tt/2kr8Mv0
via IFTTT
I have a new follower on Twitter
Roberta Cushey
#Blogger #Knowmad #Coach #GoogleProfessional #MarketingDigital #Analytics #SEO #SEM #AnalistaDigital #Investigador Consultor Digital
United States
Following: 2198 - Followers: 979
December 06, 2017 at 10:18AM via Twitter http://twitter.com/RobertaCushey
I have a new follower on Twitter
Scott Collnis
Physician | Social Media Enthusiast | My Journey Through Medicine, Social Media & Life | Family Physician | Primary Care Advocate | Views Are My Own
United States
Following: 2357 - Followers: 857
December 06, 2017 at 10:18AM via Twitter http://twitter.com/ScottCollnis
I have a new follower on Twitter
Donna Boardwine
I unleashed the zombie apocalypse. Producer, Volunteer, Beer Fanatic, Grammar Nazi, Nixon in China.
United States
Following: 609 - Followers: 106
December 06, 2017 at 10:08AM via Twitter http://twitter.com/Boardwine5
Critical Flaw in Major Android Tools Targets Developers and Reverse Engineers
from The Hacker News http://ift.tt/2kqGb90
via IFTTT
I have a new follower on Twitter
Zack Sanchez
Father, Youth Baseball Coach, Businessman, Marketing, Publicist, Baseball, NFL, Fantasy Football, Consultant, Roanoke VA, Talent Manager, Real Estate, Mentor.
United States
Following: 2177 - Followers: 879
December 06, 2017 at 06:08AM via Twitter http://twitter.com/ConsultantZack
New TeamViewer Hack Could Allow Clients to Hijack Viewers' Computer
from The Hacker News http://ift.tt/2itEzXT
via IFTTT
Insomniacs Anonymous Sleep Spray
from Google Alert - anonymous http://ift.tt/2zQxXtx
via IFTTT
Tuesday, December 5, 2017
Anonymous user 97e216
from Google Alert - anonymous http://ift.tt/2iqQCoP
via IFTTT
Beelden!!!!!!
from Google Alert - anonymous http://ift.tt/2jVhuxB
via IFTTT
I have a new follower on Twitter
Magda Urbaniak
Global Communications Manager @Brand24 | CEO at Tractormania.pl 🚜 | Agro PR | @Quora Top Writer | Host of BrandTalks #Podcast 🎙| https://t.co/Pavw2SSbSA 🇵🇱 🇺🇸
https://t.co/W8SumEn7uD
Following: 11843 - Followers: 13785
December 05, 2017 at 08:18PM via Twitter http://twitter.com/Meg_Urbaniak
Anonymous donor again blesses the Wells County Food Bank
from Google Alert - anonymous http://ift.tt/2konVx3
via IFTTT
Anonymous donor to pay for 100 App State students tickets to Dollar General Bowl
from Google Alert - anonymous http://ift.tt/2iqioSt
via IFTTT
Creating Marketing Opportunity from Digital Chaos - Personalizing Anonymous Web Experiences
from Google Alert - anonymous http://ift.tt/2jUbrJq
via IFTTT
Anonymous user 6d20be
from Google Alert - anonymous http://ift.tt/2zQyYlm
via IFTTT
Anonymous user 0f691d
from Google Alert - anonymous http://ift.tt/2nzJZGi
via IFTTT
ISS Daily Summary Report – 12/04/2017
from ISS On-Orbit Status Report http://ift.tt/2nu5k3H
via IFTTT
Ravens place CB Jimmy Smith (Achilles) on IR, promote CB Stanley Jean-Baptiste from practice squad (ESPN)
via IFTTT
[FD] SSD Advisory – Coredy CX-E120 Repeater Multiple Vulnerabilities
Source: Gmail -> IFTTT-> Blogger
Anonymous Imperial Hubris Essay
from Google Alert - anonymous http://ift.tt/2ipLvp1
via IFTTT
Anonymous user is able to delete webform
from Google Alert - anonymous http://ift.tt/2jSCZPG
via IFTTT
Massive Breach Exposes Keyboard App that Collects Personal Data On Its 31 Million Users
from The Hacker News http://ift.tt/2BBIxVF
via IFTTT
Anonymous user 4add93
from Google Alert - anonymous http://ift.tt/2iWeRyX
via IFTTT
📈 Ravens climb three spots to No. 13 in Week 14 NFL Power Rankings (ESPN)
via IFTTT
Max-age for anonymous users
from Google Alert - anonymous http://ift.tt/2AYd5ol
via IFTTT
Anonymous user eeeed3
from Google Alert - anonymous http://ift.tt/2A8YF4Q
via IFTTT
Anonymous ️
from Google Alert - anonymous http://ift.tt/2AX95o8
via IFTTT
Anonymous user bc4081
from Google Alert - anonymous http://ift.tt/2jgyFKu
via IFTTT
Anonymous user b022d0
from Google Alert - anonymous http://ift.tt/2iWqYMt
via IFTTT
Anonymous user f347b3
from Google Alert - anonymous http://ift.tt/2ARAEyL
via IFTTT
Anonymous user 38cb8d
from Google Alert - anonymous http://ift.tt/2iUUH8H
via IFTTT
Anonymous user 56feff
from Google Alert - anonymous http://ift.tt/2ARAyHp
via IFTTT
MailSploit — Email Spoofing Flaw Affects Over 30 Popular Email Clients
from The Hacker News http://ift.tt/2AY8VwL
via IFTTT
Anonymous user 7ab5f0
from Google Alert - anonymous http://ift.tt/2A8sSkv
via IFTTT
Anonymous user 99e1e1
from Google Alert - anonymous http://ift.tt/2AYs69E
via IFTTT
Young Hacker, Who Took Over Jail Network to Get Friend Released Early, Faces Prison
from The Hacker News http://ift.tt/2jfUBFp
via IFTTT
A Horizon with Blue and Red
Monday, December 4, 2017
ISS Daily Summary Report – 12/01/2017
from ISS On-Orbit Status Report http://ift.tt/2ikTGD3
via IFTTT
Feds Shut Down 'Longest-Running' Andromeda Botnet
from The Hacker News http://ift.tt/2jLmwN2
via IFTTT
Anonymous job
from Google Alert - anonymous http://ift.tt/2AOwYho
via IFTTT
How to create a deep learning dataset using Google Images
PyImageSearch reader José asks:
Hey Adrian, thanks for putting together Deep Learning for Computer Vision with Python. This is by far the best resource I’ve seen for deep learning.
My question is this:
I’m working on a project where I need to classify the scenes of outdoor photographs into four distinct categories: cities, beaches, mountains, and forests.
I’ve found a small dataset (~100 images per class), but my models are quick to overfit and far from accurate.
I’m confident I can solve this project, but I need more data.
What do you suggest?
José has a point — without enough training data, your deep learning and machine learning models can’t learn the underlying, discriminative patterns required to make robust classifications.
Which begs the question:
How in the world do you gather enough images when training deep learning models?
Deep learning algorithms, especially Convolutional Neural Networks, can be data hungry beasts.
And to make matters worse, manually annotating an image dataset can be a time consuming, tedious, and even expensive process.
So is there a way to leverage the power of Google Images to quickly gather training images and thereby cut down on the time it takes to build your dataset?
You bet there is.
In the remainder of today’s blog post I’ll be demonstrating how you can use Google Images to quickly (and easily) gather training data for your deep learning models.
Looking for the source code to this post?
Jump right to the downloads section.
Deep learning and Google Images for training data
Today’s blog post is part one of a three part series on a building a Not Santa app, inspired by the Not Hotdog app in HBO’s Silicon Valley (Season 4, Episode 4).
As a kid Christmas time was my favorite time of the year — and even as an adult I always find myself happier when December rolls around.
Looking back on my childhood, my dad always went out well of his way to ensure Christmas was a magical time.
Without him I don’t think this time of year would mean as much to me (and I certainly wouldn’t be the person I am today).
In order to keep the magic of ole’ Saint Nicholas alive, we’re going to spend the next three blog posts building our Not Santa detector using deep learning:
- Part #1: Gather Santa Clause training data using Google Images (this post).
- Part #2: Train our Not Santa detector using deep learning, Python, and Keras.
- Part #3: Deploy our trained deep learning model to the Raspberry Pi.
Let’s go ahead and get started!
Using Google Images for training data and machine learning models
The method I’m about to share with you for gathering Google Images for deep learning is from a fellow deep learning practitioner and friend of mine, Michael Sollami.
He discussed the exact same technique I’m about to share with you in a blog post of his earlier this year.
I’m going to elaborate on these steps and provide further instructions on how you can use this technique to quickly gather training data for deep learning models using Google Images, JavaScript, and a bit of Python.
The first step in using Google Images to gather training data for our Convolutional Neural Network is to head to Google Images and enter a query.
In this case we’ll be using the query term “santa clause”:
As you can see from the example image above we have our search results.
The next step is to use a tiny bit of JavaScript to gather the image URLs (which we can then download using Python later in this tutorial).
Fire up the JavaScript console (I’ll assume you are using the Chrome web browser, but you can use Firefox as well) by clicking
View => Developer => JavaScript Console:
From there, click the
Consoletab:
This will enable you to execute JavaScript in a REPL-like manner. The next step is to start scrolling!
Keep scrolling until you have found all relevant images to your query. From there, we need to grab the URLs for each of these images. Switch back to the JavaScript console and then copy and paste this JavaScript snippet into the Console:
// pull down jquery into the JavaScript console var script = document.createElement('script'); script.src = "http://ift.tt/1V0HKB6"; document.getElementsByTagName('head')[0].appendChild(script);
The snippet above pulls down the jQuery JavaScript library, a common package used for nearly every JavaScript application.
Now that jQuery is pulled down we can use a CSS selector to grab a list of URLs:
// grab the URLs var urls = $('.rg_di .rg_meta').map(function() { return JSON.parse($(this).text()).ou; });
Note: Make sure you expand the code block above using the “<=>” button — this will ensure you copy and pate the entire JavaScript function call.
And then finally write the URLs to file (one per line):
// write the URls to file (one per line) var textToSave = urls.toArray().join('\n'); var hiddenElement = document.createElement('a'); hiddenElement.href = 'data:attachment/text,' + encodeURI(textToSave); hiddenElement.target = '_blank'; hiddenElement.download = 'urls.txt'; hiddenElement.click();
After executing the above snippet you’ll have a file named
urls.txtin your default Downloads directory.
If you are having trouble following this guide, please see the video at the very top of this blog post where I provide step-by-step instructions.
Downloading Google Images using Python
Now that we have our
urls.txtfile, we need to download each of the individual images.
Using Python and the requests library, this is quite easy.
If you don’t already have requests installed on your machine you’ll want to install it now (taking care to use the
workoncommand first if you are using Python virtual environments):
$ workon cv $ pip install requests
From there, open up a new file, name it
download_images.py, and insert the following code:
# import the necessary packages from imutils import paths import argparse import requests import cv2 import os
Here we are just importing required packages. Notice
requestson Line 4 — this will be the package we use for downloading the image content.
Next, we’ll parse command line arguments and load our
urlsfrom disk into memory:
# construct the argument parse and parse the arguments ap = argparse.ArgumentParser() ap.add_argument("-u", "--urls", required=True, help="path to file containing image URLs") ap.add_argument("-o", "--output", required=True, help="path to output directory of images") args = vars(ap.parse_args()) # grab the list of URLs from the input file, then initialize the # total number of images downloaded thus far rows = open(args["urls"]).read().strip().split("\n") total = 0
Command line argument parsing is handled on Lines 9-14 — we only require two:
-
--urls
: The path to the file containing image URLs generated by the Javascript trick above. -
--output
: The path to the output directory where we’ll store our images downloaded from Google Images.
From there, we load each URL from the file into a list on Line 18. We also initialize a counter,
total, to count the files we’ve downloaded.
Next we’ll loop over the URLs and attempt to download each image:
# loop the URLs for url in rows: try: # try to download the image r = requests.get(url, timeout=60) # save the image to disk p = os.path.sep.join([args["output"], "{}.jpg".format( str(total).zfill(8))]) f = open(p, "wb") f.write(r.content) f.close() # update the counter print("[INFO] downloaded: {}".format(p)) total += 1 # handle if any exceptions are thrown during the download process except: print("[INFO] error downloading {}...skipping".format(p))
Using
requests, we just need to specify the
urland a timeout for the download. We attempt to download the image file into a variable,
r, which holds the binary file (along with HTTP headers, etc.) in memory temporarily (Line 25).
Let’s go ahead and save the image to disk.
The first thing we’ll need is a valid path and filename. Lines 28 and 29 generate a path + filename,
p, which will count up incrementally from
00000000.jpg.
We then create a file pointer,
f, specifying our path,
p, and indicating that we want write mode in binary format (
"wb") on Line 30.
Subsequently, we write our files contents (
r.content) and then close the file (Lines 31 and 32).
And finally, we update our total count of downloaded images.
If any errors are encountered along the way (and there will be some errors — you should expect them whenever trying to automatically download unconstrained images/pages on the web), the exception is handled and a message is printed to the terminal (Lines 39 and 40).
Now we’ll do a step that shouldn’t be left out!
We’ll loop through all files we’ve just downloaded and try to open them with OpenCV. If the file can’t be opened with OpenCV, we delete it and move on. This is covered in our last code block:
# loop over the image paths we just downloaded for imagePath in paths.list_images(args["output"]): # initialize if the image should be deleted or not delete = False # try to load the image try: image = cv2.imread(imagePath) # if the image is `None` then we could not properly load it # from disk, so delete it if image is None: delete = True # if OpenCV cannot load the image then the image is likely # corrupt so we should delete it except: print("Except") delete = True # check to see if the image should be deleted if delete: print("[INFO] deleting {}".format(imagePath)) os.remove(imagePath)
As we loop over each file, we’ll initialize a
deleteflag to
False(Line 45).
Then we’ll
tryto load the image file on Line 49.
If the
imageis loaded as
None, or if there’s an exception, we’ll set
delete = True(Lines 53 and 54 and Lines 58-60).
Common reasons for an image being unable to load include an error during the download (such as a file not downloading completely), a corrupt image, or an image file format that OpenCV cannot read.
Lastly if the
deleteflag was set, we call
os.removeto delete the image on Lines 63-65.
That’s all there is to the Google Images downloader script — it’s pretty self-explanatory.
To download our example images, make sure you use the “Downloads” section of this blog post to download the script and example
urls.txtfile.
From there, open up a terminal and execute the following command:
$ python download_images.py --urls urls.txt --output images/santa [INFO] downloaded: images/santa/00000000.jpg [INFO] downloaded: images/santa/00000001.jpg [INFO] downloaded: images/santa/00000002.jpg [INFO] downloaded: images/santa/00000003.jpg ... [INFO] downloaded: images/santa/00000519.jpg [INFO] error downloading images/santa/00000519.jpg...skipping [INFO] downloaded: images/santa/00000520.jpg ... [INFO] deleting images/santa/00000211.jpg [INFO] deleting images/santa/00000199.jpg ...
As you can see, example images from Google Images are being downloaded to my machine as training data.
The error you see in the output is normal — you should expect these. You should also expect some images to be corrupt and unable to open — these images get deleted from our dataset.
Pruning irrelevant images from our dataset
Of course, not every image we downloaded is relevant.
To resolve this, we need to do a bit of manual inspection.
My favorite way to do this is to use the default tools on my macOS machine. I can open up Finder and browse the images in the “Cover Flow” view:
I can then easily scroll through my downloaded images.
Images that are not relevant can easily moved to the Trash using
<cmd> + <delete>— similar shortcuts exist on other operating systems as well. After pruning my downloaded images I have a total of 461 images as training to our Not Santa app.
In next week’s blog post I’ll demonstrate how we can use Python and Keras to train a Convolutional Neural Network to detect if Santa Clause is in an input image.
The complete Google Images + deep learning pipeline
I have put together a step-by-step video that demonstrates me performing the above steps to gather deep learning training data using Google Images.
Be sure to take a look!
Summary
In today’s blog post you learned how to:
- Use Google Images to search for example images.
- Grab the image URLs via a small amount of JavaScript.
- Download the images using Python and the requests library.
Using this method we downloaded ~550 images.
We then manually inspected the images and removed non-relevant ones, trimming the dataset down to ~460 images.
In next week’s blog post we’ll learn how to train a deep learning model that will be used in our Not Santa app.
To be notified when the next post in this series goes live, be sure to enter your email address in the form below!
Downloads:
The post How to create a deep learning dataset using Google Images appeared first on PyImageSearch.
from PyImageSearch http://ift.tt/2nqvfZX
via IFTTT