1. How to collect Images for Deep Learning Project? | Custom Image Dataset for Machine Learning

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
greetings from diazonic labs my name is amir and welcome to my channel when you are working on any machine learning or deep learning or data science project the fundamental thing what you need is data the most common ones are in the form of images audio video numbers text etc we are today dealing with the image data so now the question is how do you gather enough images when you are training machine learning or deep learning model with enough amount of images watch the video till the end to get some answer if you haven't subscribed to our channel please do consider subscribing it and also press the bell icon to get the latest notification on our videos we bring to you lot of tech related videos the subscribe button is given at the bottom right corner of the video so let's go ahead with the video as we were discussing about the gathering of image data the first question to be answered is how we can actually get the images the most common method what we all use to get any image is just go to google and then download the image and then manually annotate them right this is what we do but then there is another simple method simple technique wherein you can gather automatically lots and lots of images okay and this can be done with just one help of a simple python library and the library which we will be using is called as bing image downloader so you might have definitely heard about google this is the most famous search engine which is available out there along with google we also have something called as bing so bing is also a search engine just like google all right and there is actually a python library which is called as bing image downloader so when you use this particular library it will be very easy for you to actually scrape the data to actually download the image data directly from the bing website so what i'm gonna do right now is let me just go to say the google chrome and i will type here bing okay let me just go to bing here in fact i will type bing image all right and then if i go inside bing images okay so let me search for say apple fruit here okay i'm just giving your apple fruit and you should be able to see we are getting lots of apples here right lots of apple images whatever we have so it is just like the google search like imagine you go to google and then go to images and type for something you will get it right so what we will do is uh in our programming language so we'll be using the base as again python because python is the most popular language right for data science so we'll be using the python language as the base and we will install this bing image downloader let's see how we can do that and let us also check whether we are able to download the images properly or not all right so first of all i will go to say google collab let me just open google collab google collab is the online python notebook for executing python codes so i'm just going to create a new notebook here now as the notebook opens uh if you remember whenever you are actually using any library in python you will have to always understand that there are two types of libraries in python the first one is inbuilt library uh which is actually coming with the interpreter whenever you download or install any python software or go ahead with python interpreter online you get that particular library as it is and the second type is user defined library so the user defined library is actually handled by one specific manager called as pip all right so the libraries are actually uh noted in one specific website called as pypi.org so what i'll do is i'll go to this website and i will type here bing image downloader all right so the documentation for this particular wing image downloader is actually given here let us go inside this and you should be able to see here it says bing image downloader so this is a python library to download bulk of images from bing.com okay uh this is what it says now how do you install this particular library so if you want to install this particular library on your say python notebook or any of your ide you need to just write pip install bing image downloader all right let us do the same here so i will copy this and paste it here inside my google collab if you want to convert your cell into say command line interface you just need to write your exclamatory and then let me just connect and run this and this particular library will get installed once the library is installed the next thing what i'll do is i will actually create a new directory so for creating a new directory i can write mkdir make directory and let me name it as say images all right and let me run this as well so it is installing the bing image downloaded here this is installed it is successfully installed and the version which we are using is 1.0.4 which is the latest version according to pypi.org as well it was released in july 26 2020 all right so once this is downloaded here i am just creating a new folder by the name of mkdir images so if you see here in the file section you should be able to see here a new directory by the name of images is actually available and if you want to put this particular thing inside the drive you can definitely mount your drive and do the same as well all right but then let us continue with this particular thing itself now how can we download an image right so imagine you want to download this fruit apple fruit image how can you do that imagine i want to download more than one i want to say download uh say 20 or 30 images of this how can you do that so first of all you need to write a simple code here uh let me just write say from bing underscore image underscore downloader all right from here i will import downloader okay this is the library which i'm importing okay sorry yeah so once i've imported this particular library from this particular package now i can write downloader dot download all right and then inside this you can write what you need to actually search so i'm searching for apple fruit now before continuing with the uh you know code i want to go back to say my pypi da website and then inside this project description you should be able to see here lot of you know queries or the parameters which are available for this download method all right so the first query is query string or this is what i have typed here as apple fruit and i will get that the next thing is limit limit by default is 100 if you want uh you know you can keep it more or you can keep it less okay so i will give my limit i don't want to download obviously 100 images for now uh so i will make it as say 10 okay just for understanding i'm gonna make it as 10 and then the next thing is what should be your output directory okay let me just copy this uh since i've already created the directory by the name of images i will also name the output directory as images all right what else do we have here here we have got three more other parameters which we need not use uh but let us just discuss quickly so the first one it says adult filter so if you don't want any adult content then uh you should keep it as true okay by default it is true so i will not make any changes here then the next thing is force replace imagine if you have a folder then if that particular thing is present then it will delete and then it will uh start a new download it will start a fresh download so we don't need to do that okay let it be false as it is and then the timeout imagine this particular thing is not able to get the image properly if it is not able to access the image it will wait for 60 seconds and then it will get the uh timeout done then it will move on to the next query all right this is how it works so we will not use this uh three parameters okay let us just use the first three what it is given all right now once this is done i will just run the code let me press shift enter and run the code you should be able to see here it says indexing page one that means the first image is actually you know downloading here so see here uh downloading image one this is from the first page of bing okay and then first image is downloaded second image third fourth fifth sixth seventh and ninth okay all the ten images are now downloaded so how can you know how can you be sure that this particular images are downloaded okay so you can just go to your files here and then check out you should be able to see your images uh inside images you have got apple fruit and then if you go inside this you should be able to see image one image to image three image four all of this particular categories or whatever the values are here uh it will be given so let me just open it let me just try opening this and you should be able to see uh the apple image opening up all right so i'll just scroll down and show you this is a big picture of apple which we have got here let me just check some other image as well so you should be able to see here the apple images are actually taken into consideration and that is the code guys so with the help of say barely three lines i have actually written a code wherein it can download lots of uh you know images directly inside your say google collab or else if you are using any offline tool you can directly download inside your directory of your computer okay this is how it does okay so if you like this video please do consider subscribing to our channel let us know if you have any queries regarding the same
Info
Channel: Diazonic Labs
Views: 70,022
Rating: undefined out of 5
Keywords: how to get image data from google, image dataset for machine learning, how to create image dataset for machine learning, bing image downloader, create image dataset python, image classification project in python, Data Collection for Image Classification using Python, data gathering of image, how to get many images, image scraping from google, what is a image crawler, end to end image classification, bing image downloader python, python library for data science
Id: solASfMs89Q
Channel Id: undefined
Length: 9min 38sec (578 seconds)
Published: Mon Nov 02 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.