Data Science & Machine Learning Project - Part 4 Feature Engineering | Image Classification
HTML-код
- Опубликовано: 27 авг 2024
- In this video, we will use cropped images and apply wavelet transform to extract meaning features that can help with image identification. You need to understand many important concepts such as time vs frequency domain, fourier transform, representing images as frequency etc. You will find below resources to understand these concepts. USing wavelet transform and a raw pixel image we will create our X and use class labels as y. These X and y will be used for model training. Feature engineering techniques in this tutorial will enhance your understanding on how they can be used to create powerful prediction function.
Code: github.com/cod...
Resources to understand signal processing concepts:
My friend Iman's youtube channel: / @imanmoaz
Representing image as a frequency: • Frequency concept in a...
Fourier transform: • But what is the Fourie...
Special thanks to,
Debjyoti Paul (Amazon Data Scientist): For help with entire project
Do you want to learn technology from me? Check codebasics.io/ for my affordable video courses.
Website: codebasics.io/
Facebook: / codebasicshub
Twitter: / codebasicshub
Check out our premium machine learning course with 2 Industry projects: codebasics.io/courses/machine-learning-for-data-science-beginners-to-advanced
Next Video: ruclips.net/video/5Uc_m9CRWro/видео.html
Data Science Project | Sports Celebrity Image Classification: ruclips.net/video/qWXXHjV3JHI/видео.html
Machine Learning & Data Science Project | Real Estate Price Prediction Project: ruclips.net/video/rdfbcdP75KI/видео.html
Learn data science for beginners (How to learn data science for free)?: ruclips.net/video/Vn_mmOuQkSA/видео.html
cannot reshape array of size 3072 into shape (1024,1) getting this error 15:37 code, please tell how to resolve this?
I was facing the same issue and wasn't calling the cv2.resize method on the img_har correctly (called it twice on img instead of img_har) so make sure you do this correctly so the dimensions of both images are correct. (scalled_img_har = cv2.resize(img_har, (32,32)) )
I have the same error
[ WARN:0@36129.923] global /Users/runner/work/opencv-python/opencv-python/opencv/modules/imgcodecs/src/loadsave.cpp (239) findDecoder imread_('./dataset/cropped/Neymar/Neymar14.png'): can't open/read file: check file path/integrity
[ WARN:0@36130.248] global /Users/runner/work/opencv-python/opencv-python/opencv/modules/imgcodecs/src/loadsave.cpp (239) findDecoder imread_('./dataset/cropped/Modric/Modric7.png'): can't open/read file: check file path/integrity
[ WARN:0@36130.270] global /Users/runner/work/opencv-python/opencv-python/opencv/modules/imgcodecs/src/loadsave.cpp (239) findDecoder imread_('./dataset/cropped/Modric/Modric11.png'): can't open/read file: check file path/integrity
[ WARN:0@36130.363] global /Users/runner/work/opencv-python/opencv-python/opencv/modules/imgcodecs/src/loadsave.cpp (239) findDecoder imread_('./dataset/cropped/Modric/Modric18.png'): can't open/read file: check file path/integrity
[ WARN:0@36130.379] global /Users/runner/work/opencv-python/opencv-python/opencv/modules/imgcodecs/src/loadsave.cpp (239) findDecoder imread_('./dataset/cropped/Messi/Messi1.png'): can't open/read file: check file path/integrity
Have you found the solution for that,, please help 🙏🏻
Thank you sir its making things very much easy for me to learn and specifically this series as i dont know to attach backend to frontend , i mix up every thing thank for being there
Hello
Did you encounter difference in the image produced by sir and the code? I am getting completely blackish image
@@jashdaftary8965 no i didn't encounter just image but it was black and white
@@bannoreaaditya3909 I used the same code he used from GitHub. I don't get it. Can I somehow send you the image I got ?
There is a correction in above code if its giving this error
setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (200,) + inhomogeneous part.
The solution is
change this "imArray_H = list(coeffs)"
to this "imArray_H = pywt.waverec2(coeffs_H, mode);"
Nice work sir looking forward to see next video of the project ....... Make more awesome simple biggnner projects like this 👍🏽👍🏽👍🏽
Awesome video
this series is very good keep it up
hi! your projects are really insightful. I am finding them very useful for my journey in ML
Glad it was helpful!
@@codebasics Can you please explain why the gray scale image was stacked with wavelet decomposed image. Can't we only use the wavelet decomposed image? Thanks in advance
Really good DS project. Can you please do more DS projects using APIs and Databases in the cloud? Thanks
I just love your content
Hello Sir, Please make more end to end projects like this.
Hi Dhaval, pics which you are using , you may get copyright strike .hope they will not send strike..these are educational video purpose
obvious.
good job man
Nice series. Can you please explain the reason behind stacking the transformed image under the original image? Also, when doing actual prediction do we use a similarly transformed & stacked image?
+1, Though I searched for it and got this - 'Stacking image and wavelet transformed image in image classification can be a useful technique for enhancing the performance of machine learning models, especially when dealing with texture-rich images or when attempting to capture both high-frequency and low-frequency information'
using jupyter notebook you were able to continue from the cropped images after u manually deleted them. I am using virtual studio but whenever i run the code it brings back all the dataset the i manually deleted. my question is how can i continue using the dataset after i have manually deleted them?
hi ser thank u so much, i have a question please i'm using LBP for feature extraction should i concatenate two images or the input should be just the LBP result ??
Can you tell, why were you used wavelet and stack it with original image ,what will be the benefit?
Dhaval sir, What is the purpose of changing all the Approximation coefficients to zeros.
coeffs *= 0??
Thanks from Nigeria
Is it possible to reshape images in data of final shape (x, y) to the shape that can be accepted by keras models (x, 1, img_size, img_size)?
hello, i am not able to execute your 1st part of this video....its showing this error "No module named 'StringIO'"
'
Actully sir i am doing the image classification on specially on leopard images to classify the species of leopard.& harcascade files are not able to work on those images....so is there any other method to detecting feature & for cropping images.
u missed the explanation of 6 lines of code how to create a dictionary it contains keys ara names and key values are image paths☺️☺️
Hello
Did anyone encounter difference in image produced by sir and code? I am getting a blackish image instead of black and white. Please help
w2d function is not working. Any solutions?
Hello sir can we apply the same feature engineering in plant Village dataset?
Can someone please explain to me why the grayscale image was stacked with a wavelet decomposed image. Can't we only use the wavelet decomposed image?
I think, both wavelet & grayscale image makes better to identify their target.
wrote exactly the same w2d function and my the images it provides are very different from your first example. Mine are in gray tones and yours is just black or white
Exactly. Did you find any solution for that?
Sir can you please share your python file for this project. I would be easier for me rectify my errors. I have started this project but stuck in between.
sir can you clear something . Ultimately we are just following few lines of code written in websites of initial developers . in what way we have control over the project , we are just doing a copy paste kind of thing . if in real corporate also works get done in the same way then it is absolutely . For freshers it's a dilemma to understand
I also have this doubt. Hope we will get an answer.
It is not bad to do copy paste.in real life developers think about logic and flow. After that they either write little code snippets themselves or copy from other sources like stack overflow.
I am not very sure if understood your question properly. If not plz post
@@codebasics hi dhaval,can you make a video on how to contribute open source data science projects and libraries . And how can we start as a beginner
@@codebasics sir why i am asking this question bcoz i dont feel like much control over the coding part of this problem . we are just following code of someone else . there is no sort of improvisation from our side .
@@jayamishra960 Not true. The logic that we have to do what after what is the control we have on the code. As a developer in a company, you have to think about the logic and not the code. Code can be written easily if you know the logic behind the working.
Can anybody suggest a video on wavelet transform on image please
Please do this project using Deep Learning too.
Yes the video on solving same problem using neural network is coming up.. stay tuned.
@@codebasics i'm waiting sir.
i have installed PyWavelets still showing PyWavelets not installed @codebasics
Yes I too am facing a similar issue.
Hello Dear teacher, thank you for this very good tutorial, I have an error that I cannot resolve since in fact it is the function to resize here is the error do you have any idea? thank you
error: OpenCV(4.5.1) /tmp/pip-req-build-hj027r8z/opencv/modules/imgproc/src/resize.cpp:4051: error: (-215:Assertion failed) !ssize.empty() in function 'resize'
I solved the problem just by surrounding code with try catch like this :
X, y = [], []
for celebrity_name, training_files in celebrity_file_names_dict.items():
for training_image in training_files:
img = cv2.imread(training_image) #training image c'est juste l'image recardrée de chaque sous dico qui est le nom de la célébrité
try:
scalled_raw_img = cv2.resize(img, (32, 32))#ici on veut recardrer nos images car avant d'entrainner le modèle les images doivent avoir meme dimension.
img_har = w2d(img,'db1',5)#appel de la fonction w2d sur chaque image
scalled_img_har = cv2.resize(img_har, (32, 32))#redimensionnement des images transformées avec pywt
combined_img = np.vstack((scalled_raw_img.reshape(32*32*3,1),scalled_img_har.reshape(32*32,1)))#les images en pleine couleur on 3 paramètres pour les rga d'ou 3 et les images transformées avec pywavelet ont une seule couleur d'ou 1.
X.append(combined_img)
y.append(class_dict[celebrity_name])
except:
break
@@loicsan5616 Thanks I got the same error and solved as you said, you saved my livre bro.
@@armelsauvy7253 great.
@@loicsan5616 Let me try this solution!
@@JuanAntonioNelson Have you found the solution for this ??