Image Segmentation And Object Detection Using 5 Lines Of Code Using PixelLib
Key Takeaways
Demonstrates image segmentation and object detection using PixelLib with just 5 lines of code
Full Transcript
hello all my name is krishna and welcome to my youtube channel so guys this will be an amazing video for every one of you because in this particular video we are going to discuss about image segmentation and how you can implement it with just writing five lines of code right so initially if you have this kind of image or probably you have this kind of image then you will be able to convert it something like this okay now here you can see that how the segmentation is basically done it so object detection is also there you can see over here traffic light person everything is there apart from that the segmentation you know it is being able to do this kind of segmentation where with different different colors uh you'll you'll be able to see each and every objects and into this right not only this suppose if i have this specific image if i apply this kind of segmentation then finally you'll be able to get something like this right and this is all possible just by this file lines of code right so we'll try to see what it is and the library that we are going to use is pixel lip so what is pixel lip over here you can see um the pixel leave is a library for performing segmentation of objects in images and videos so it both supports button images and videos right now in this particular video we'll focus on images you know and then in the upcoming videos we'll see in videos how we can do it right it'll be pretty much amazing i tried it with both and trust me with the approach that we used to follow before and with the approach of this you'll be able to do it very very easily and here you can also do custom training which i will be showing you as we go ahead okay so for this first thing is that what are libraries you're actually requiring require tensorflow you require tensorflow gpu any of them and there is also some dependencies of libraries that are required okay and you can also check out this entire github page so let's proceed and let's see first of all i'm just going to create my requirement.txt file so here you can see uh these are my requirement.txt files uh which you actually require okay one is opencv python skykit image pillow pixel lib okay so this all libraries you actually required and one more which i forgot to write over here is tensorflow gpu right so this all libraries you actually require and this is the dependencies for this pixel lib library okay at the end of the day we are going to use pixel lib because there are techniques over here which will actually help you to do the image segmentation both in images and videos right so please make sure that you keep this requirement.txt file and then go to the terminal and just write pip install pip install minus r requirement.txt so you just have to write like this pip install minus r requirement requirements dot txt that's it right so automatically all the requirements will be installed okay i don't want to do it again because i have already done it okay so let's go to the next step now the next step is that i will go to my app.py and in this particular uh code what we are actually going to do is that we are going to import the pixel lab we are going to import pixel lab dot instance import instance segmentation so fine guys we have actually imported both this library and we are going to use this instant segmentation for doing the segmentation and for this we also required a library probably like rcnn and all so that it will be able to do the object detection and based on that it will also be able to show the boxes to us right so for that we are going to use this h5 file and where did i get this h55 because it is already given away if i go down you'll be able to see all the examples over here and they have released what all different different types of models are there one is deep level and one is mast rcnn which they have actually used and uh remember guys the the the you know the inference part is very very quick uh if you are also using this so just go over here okay and uh you can download this mass rcnn coco.h5 right so this rcnn is basically trained on the coco data set so what you have to do go over here there is have there is something called as tutorial on back background editing and videos and here you can actually see the uh the note is there which says deep lab and mars rcn are available in the release of this repository so once you click this you'll be able to go over here and you'll be able to select this okay so again let me just go and click it so you'll be getting this page and then go down right go down and just click this okay so mask rcn and for this particular purpose we are going to use marks rcnn okay now after we use this after i download it if i click this i'll get downloaded and here you can see that i'll be able to find this h55 so i've actually uploaded this in my same working location perfect then what i'm going to do i'm going to use this segment image first of all we are going to initialize with the help of instance segmentation this will be an object and then we are going to load this particular h5 file for the object detection purpose and along with that we'll try to also do the segment image so this is both object detection and image segmentation okay so here in the segment image the first image is basically your input image and then there will be a parameter which is called as show pb uh b boxes is equal to true you have to set it as true otherwise you will be able to not be able to see the boxes and after taking this image after performing the image segmentation and object detection you will be able to get the output name something like this right so let's quickly run right now i'm giving hangover.jpg i hope everybody has seen the hangover image right i saw this particular movie hangover part one i hope many people have seen it so let's see how we are going to get an output once then output is basically created you'll be able to get output1.jpg okay so let's go and run it and here we go and make sure that you have all the libraries installed perfectly guys then only things will work okay so i'm now executing this uh you'll be able to see all the image segmentation will be done and it will actually create an image called as output one so here you can see processed image saved successfully in the current working directory and this is my output one and if i want to show you the image this is how it looks like yes it has been detecting this building as tv but person is detected person is defected and refrigerated because this looks like a refrigerator itself but amazing accuracy let's try some other one so here i'm going to give you this image okay cycle.jpg let's see so i'm just going to try this one cycle.jpg and probably give my image as output dot or i'll say output2.jpg okay and probably i'll run it so probably this will also take some time to run it and again uh it depends on your system also based on the inferences that you are actually getting okay so quickly quickly let's let's see yes it is saved what is my file name output 2 so initially i had this specific image and now i'm able to get this specific image and you can see how accurately everything is there you can see this petted plant you can see person cars this this everything is there amazingly right it is being able to even traffic light is given over here right so this is my second example third example i can also take something like this this is my test.gpg you'll be able to see input.jpg over here let's see this one football i can see that it is not that clear but let me try this one also so here i can say football.jpg okay football dot jpg and here i'm just going to say output three so just with this three line of code and in the upcoming videos i'll also show you how to do this in videos okay it will be pretty much amazing in live streams also i'll i'll be able to show you how these things work because i've been exploring with respect to image segmentation trust me the older approach that we used to do and you may be thinking krish how to do custom training don't worry about that that also i'll try to show custom training of different images and all also you can actually do so this is my output three now here you can see that yes within this also it is being properly determined person and all but here you can see the tennis is basically determined this was not tennis actually yes some some amount of error is there definitely uh not 100 accuracy but yes a good accuracy altogether right uh let's see one more so i have this football one dot jpg let's see this also if i'm able to get in a proper way and i have output four perfect and let me run it so here you will be able to see now i think it will work perfectly fine and i'm just giving my input and output image by just using this rcnn model and i think it will work so it is get saved now let me see my output 4 so here you can see right this was my initial image sorry this was my initial image now after doing the segmentation doll i'm actually getting something like this and here clearly everything is basically getting determined even stop sign also so i hope you like this particular video please do subscribe the channel if you're not already subscribed and i'll put all this particular thing in my github so that you can actually work it out right i'll see y'all in the next video have a great day thank you and all bye
Original Description
github:https://github.com/krishnaik06/Image-Segmentation-Using-Pixellib
Documentation Page: https://github.com/ayoolaolafenwa/PixelLib
Complete DL Playlist: https://www.youtube.com/watch?v=YFNKnUhm_-s&list=PLZoTAELRMXVPGU70ZGsckrMdr0FteeRUi
--------------------------------------------------------------------------------------------------------------------------
Subscribe my vlogging channel
https://www.youtube.com/channel/UCjWY5hREA6FFYrthD0rZNIw
Please donate if you want to support the channel through GPay UPID,
Gpay: krishnaik06@okicici
Telegram link: https://t.me/joinchat/N77M7xRvYUd403DgfE4TWw
Please join as a member in my channel to get additional benefits like materials in Data Science, live streaming for Members and many more
https://www.youtube.com/channel/UCNU_lfiiWBdtULKOw6X0Dig/join
-----------------------------------------------------------------------------------------------------------------------------------------------------
Connect with me here:
Twitter: https://twitter.com/Krishnaik06
Facebook: https://www.facebook.com/krishnaik06
instagram: https://www.instagram.com/krishnaik06
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Krish Naik · Krish Naik · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Natural Language Processing|Stemming
Krish Naik
Natural Language Processing|BagofWords
Krish Naik
Gaussian distribution or Normal Distribution in statisctics
Krish Naik
Natural Language Processing|TF-IDF for Machine Learning| Text Prerocessing
Krish Naik
Log Normal Distribution in Statistics
Krish Naik
Covariance in Statistics
Krish Naik
Confusion matrix, Precision, Recall| Data Science Interview questions
Krish Naik
Tutorial 44-Balanced vs Imbalanced Dataset and how to handle Imbalanced Dataset
Krish Naik
Implementing a Spam classifier in python| Natural Language Processing
Krish Naik
Tutorial 11-Exploratory Data Analysis(EDA) of Titanic dataset
Krish Naik
Face Recognition using open CV and VGG 16 Transfer Learning
Krish Naik
Pedestrian Detection using OpenCV from Videos
Krish Naik
Face and Eye Detection from Videos using HAAR Cascade Classifier
Krish Naik
Reading, Writing and Displaying images with Opencv| OpenCV Tutorial
Krish Naik
OpenCV Installation | OpenCV tutorial
Krish Naik
Face and Eye Detection from Images using HAAR Cascade Classifier
Krish Naik
Car Detection using HAAR Cascade and Opencv from Videos.
Krish Naik
Using OpenFace for Face recognition in Keras
Krish Naik
OpenPose Tutorial with Tensorflow
Krish Naik
Multiple Linear Regression using python and sklearn
Krish Naik
Dimensional Reduction| Principal Component Analysis
Krish Naik
Movie Recommender System using Python
Krish Naik
TPR,FPR,FNR,TNR, Confusion Matrix
Krish Naik
Precision, Recall and F1-Score
Krish Naik
Artificial Neural Network for Customer's Exit Prediction from Bank
Krish Naik
GridSearchCV- Select the best hyperparameter for any Classification Model
Krish Naik
RandomizedSearchCV- Select the best hyperparameter for any Classification Model
Krish Naik
K Nearest Neighbor classification with Intuition and practical solution
Krish Naik
K Means Clustering Intuition
Krish Naik
Create custom Alexa Skill- Lambda function- Part2
Krish Naik
Hierarchical Clustering intuition
Krish Naik
Implement Transfer Learning with a generic Code Template
Krish Naik
Gender Classifier and Age Estimator using Resnet Convolution Neural Network
Krish Naik
Unlock Your Application With Your Face using OpenCV
Krish Naik
Draw rectangle from webcam and sketch process it on a live feed
Krish Naik
Complete Life Cycle of a Data Science Project
Krish Naik
How we can apply Machine Learning in Finance
Krish Naik
Deep Learning in Medical Science
Krish Naik
How to switch your career to Data Science.
Krish Naik
Linear Regression Mathematical Intuition
Krish Naik
Handle Categorical features using Python
Krish Naik
Machine Learning Algorithm- Which one to choose for your Problem?
Krish Naik
DBSCAN Clustering Easily Explained with Implementation
Krish Naik
Curse of Dimensionality Easily explained| Machine Learning
Krish Naik
Feature Selection Techniques Easily Explained | Machine Learning
Krish Naik
Tutorial 29-R square and Adjusted R square Clearly Explained| Machine Learning
Krish Naik
Cross Validation using sklearn and python | Machine Learning
Krish Naik
Handling Missing Data Easily Explained| Machine Learning
Krish Naik
Deploy Machine Learning Model using Flask
Krish Naik
Deployment of Deep Learning Model using Flask
Krish Naik
How to Visualize Multiple Linear Regression in python
Krish Naik
K Nearest Neighbour Easily Explained with Implementation
Krish Naik
Predicting Heart Disease using Machine Learning
Krish Naik
Predicting Lungs Disease using Deep Learning
Krish Naik
Stock Sentiment Analysis using News Headlines
Krish Naik
Random Forest(Bootstrap Aggregation) Easily Explained
Krish Naik
Voting Classifier(Hard Voting and Soft Voting Classifier)
Krish Naik
Credit Card Fraud Detection using Machine Learning from Kaggle
Krish Naik
Hyperparameter Optimization for Xgboost
Krish Naik
Tutorial 45-Handling imbalanced Dataset using python- Part 1
Krish Naik
More on: CV Basics
View skill →Related Reads
📰
📰
📰
📰
AI 3D Object Reconstruction for Crime Scenes
Medium · AI
What Is YOLOv8? An Introduction to the YOLOv8 Model Family
Medium · AI
What Is YOLOv8? An Introduction to the YOLOv8 Model Family
Medium · Data Science
Mistral's 8B Robostral Navigate outperforms multi-sensor robots
Dev.to · ironbyte-rgb
🎓
Tutor Explanation
DeepCamp AI