YouTube Transcript:
Real time image data collection using python | Custom Object Detection | TensorFlow
Skip watching entire videos - get the full transcript, search for keywords, and copy with one click.
Share:
Video Transcript
View:
this is Dr sadik and today we are
discussing how to collect imagery data
using Python opencv and your webcam as a
data scientist you need to have a very
huge amount of data for object detection
and pubg detection model implementation
in a specific application areas such as
driverless car emotion detection sign
language implementation and
optimizations if you are a deep learning
researcher and you are a data scientist
then today's topic is very important for
you you can easily collect imagery data
about different subjects in about
different classes like if you want to
work in emotions so you can collect data
about different emotions if you are
working in object detection in action
recognitions then you can easily collect
data at your home at your office in
through from your students and they can
give you different poses different
gestures different actions and they can
they can pretend to have different
emotion as well so it's very easy to
collect data about different emotions
and about different actions uh using
python code you can collect enough
amount of data for your model and you
can initiate object detection model at
your home so I will directly jump to the
to the coding because we already know
how to install tensorflow and how to
install different dependencies of
pythons and object detection
so if you are new here and you don't
know how to install tensorflow in other
dependencies then you can find my
lectures how to install tensorflow and
how to install Cuda in other
dependencies link is in the description
below so in this lecture we will cover
three types of actions one is like this
one like for example this is for like
this is for dislike and this is for no
this is for no so we will cover these
three types of actions in this lecture
so let's have a look
so let's start
create a folder with imagery data new
folder imagery data
so now go to the Anaconda prompt and I
will activate uh OTF obj
I have already created this environment
and installed the dependencies of FG
detection like Cuda Cubana and
tensorflow object detection so if you
want to learn about that I have already
provided the links in the description so
you can follow all these lectures
so I will directly go I will activate
this TF obj
so go to the D
and in the D you will have to open the
jupyter notebook
Jupiter notebook
so now go to the imagery data and in the
imagery data create a python like an
interpreter file
new python file
so now we are in the D and in the D we
are we we are in the folder images data
we have created a jupyter notebook file
and now import dependencies import
CV2
import
OS import
time import
uuid
so this is actually opencv
OS is for the file path
and the time we use this dependency for
to give some bread between the different
classes like for example if we have
three classes one is like dislike and no
so if if the system collected images for
like so time break a time is also for
time taken is also for the the time
between the two two images and lastly we
will use uuid to name our image file so
let's run this code
okay it's successfully implemented let's
move to the next step so next we will we
will have we will give a path to the to
that particular folder and in that
folder imagery imagery data we will
create another folder which uh name is
image folder okay so here you can see
this is the imagery data and in that
image data we don't have any folder here
you can see uh imagery data
and in the imagery data we will create
another folder and its name should be
image folder okay
so let's run this code
and now let's move to the next step and
in the next step we will provide labels
like we have three labels like this like
No And we want 10 picture for every
level like we are giving this this
command that collect 10 picture for
every every levels so let's run this
code and move to the next step so now we
have three labels like dislike and no
and we need 10 uh 10 images per level
and here in the next segment we are
giving birth and we are we are trying to
create a directory and next this one
will access your webcam and my webcam
device name is it's zero it's
independent your system then what what
what is your your it can be one two or
something like that so here this code
will will access our webcam and it will
initiate our webcam for my device it's
zero and it depends on your system
Network number uh should fit in your
device so here in the next step it will
print that we are collecting images for
a specific level it depends that what
label is like for every level it will
give you a message a print it will give
you a print message so next is time that
slip so it will give you five seconds to
to have another pose
so this is important because you can
give different poses of a different
action like if you are collecting images
for emotions so you can give different
poses different gestures about different
emotions and if you are giving some
different action like if you are working
for sign language then you can give
different actions as well so next we are
going to collect images and this code
will will give us the particular uh
objective we can we can achieve the
particular objective from this
particular code and here you can see the
total number of images and the total
number of images is 10 so we want 10
images per label this particular command
will give us a capture and we are most
interested in in the frame the next this
this is the entire path here we will
join the path here you can see image
image folder here we will give the this
particular path and it will create
and also label for because we want to we
want different folder for each label
because it will create different level
for like three it will create three
labels lying dislike and no and in each
level it will uh it will save the
particular actions like if we are giving
action for the uh for the like so it
will save it in the uh in in that in the
like folder and if we give a dislike so
it will save it in the dislike folder
and same is the No it will uh definitely
save it in the jpga format and it will
pass it through specific string which is
which means that it should be unique
here the CV2 will write that particular
image uh to that particular folder and
lastly it will show us on the screen as
well and lastly we will go to the uh it
will be the ability to second time for
sleep like between the two images and
lastly if there is any error so it will
go directly to break that particular uh
to stop that particular uh compilation
so let's run the code and see what is
going to happen
so there is an error so now let's run it
again uh I think it was uh because I
haven't initiated again because the uh
because the Canada was dead so whenever
your Canal is dead and you uh you
initiate it uh Jupiter notebooks so you
must
initiate the the all this code like
python image image path labels and next
then you can jump to this this
particular segments so let's start from
this run
okay next
next
and
finally
so let's wait for it it will take a few
few seconds
yeah it's collecting here you can see
collecting images for like so let's see
let's give pause for like
okay this is for like
here you can see
it will collect 10 images actually
so let's see
I'm giving different poses
now it will collect for dislike so I'm
giving D for uh
action for dislike so let's see
and the third folder will be no
okay now it's time to no collecting
images for no okay
so you can give different poses like we
we have done this for three
three classes and you can give so it's
all done so let's let's check and have a
look at
in the folder so it's already created
here you can see imagery
you can see imagery and in the imagery
we can have it's created we have created
for the image and in the image is
created image folder okay just like this
you can see here
here you can see it's created the image
folder like imagery and in the image we
have images and in the image folder uh
it created image folder here you can see
so we are in the image folder so for
each of the class it created different
folder like for the dislike it's
collected different images here you can
see it's
collected for dislike and
here is collected for like you can see
it's collected for likes and it's
collected for no actually we demanded 10
pictures per label so that's why it's
collected only 10 picture per label if
you want hundreds of thousands of
pictures so you can you you can you can
have very long experiment for that so
this is all about how to how to collect
image data using Python opencv and your
webcam so in the next slide we will
label the particular actions and in the
next lecture you will learn how to label
that particular images using python
coding and how to detect that that
action in real time thank you so much
Click on any text or timestamp to jump to that moment in the video
Share:
Most transcripts ready in under 5 seconds
One-Click Copy125+ LanguagesSearch ContentJump to Timestamps
Paste YouTube URL
Enter any YouTube video link to get the full transcript
Transcript Extraction Form
Most transcripts ready in under 5 seconds
Get Our Chrome Extension
Get transcripts instantly without leaving YouTube. Install our Chrome extension for one-click access to any video's transcript directly on the watch page.
Works with YouTube, Coursera, Udemy and more educational platforms
Get Instant Transcripts: Just Edit the Domain in Your Address Bar!
YouTube
←
→
↻
https://www.youtube.com/watch?v=UF8uR6Z6KLc
YoutubeToText
←
→
↻
https://youtubetotext.net/watch?v=UF8uR6Z6KLc