Do you want to know how I created the binary mask I used in this tutorial? Take a look at the Computer Vision School! www.computervision.school 😃🚀🎓 Try my premium courses! 😃🙌😊 ● Hands-On Computer Vision in the Cloud: Building an AWS-based Real Time Number Plate Recognition System bit.ly/3RXrE1Y ● End-To-End Computer Vision: Build and Deploy a Video Summarization API bit.ly/3tyQX0M ● Computer Vision on Edge: Real Time Number Plate Recognition on an Edge Device bit.ly/4dYodA7 ● Machine Learning Entrepreneur: How to start your entrepreneurial journey as a freelancer and content creator bit.ly/4bFLeaC
Terima kasih video pembelajarannya... Kami mahasiswa/i Magister Teknik Informatika Universitas Pamulang sangat berterima kasih dan bermanfaat videonya untuk guna pembelajarannya.
Thank you soo much for this video!! At first i was dreading doing a machine learning project since it always seemed complicated and I felt that you would need to do masters or phd to do something like this. But your video was completely opposite! It was really easy and interesting to understand. I cannot believe I did a FUN ML project in just AN HOUR!! Thank you and keep up the good work!! :))
well, i complated this project in 1 week(copied and pasted scripts from your video), and i don.t regret to my time. Fillippe because of your lessons, Im planning after your all videos to buy some course about computer vision or ML and get certificate to work on this)))
@@F_F_CH ill check it and let you know again ,the thing is my vscode is saying this type of file cant be opened or viewed ,it says it for the .p file And also since the vedio file is above 10MB its also not supported
@@Obit0bi its very strange that video i not supported. Are you sure that you did your projects with PyCharm and downloaded all libraries? My advice is to follow the path if you started directly from this video. Because I started from Python, than OpenCV and than this video. For example I had some problems with Yolov8 video of Philippe and I resolved it by deleting all drivers and programs related to python and rea installing them, but your problem is very specific. Send me time on this video where you faced to problem, than i check mine script
@@F_F_CH Figured it out the thing is path given in the code to fetch .p file was wrong , When I clicked the .p file in the explorer section of vscode it was showing 'the file isnt displayed bcoz its either binary or unsupported text encoding' So I thought it would be some encoding issues of the pickle file Now I need to integrate this project to a website that im goin to create
Thank you so much, but I get some strange Error Messages... I'm not using your exact code but its quite similar... When I use my trained model I get the error message: "X has 150738 features, but SVC is expecting 675 features as input" and I cant find help online...
Hey Felipe, Loved your work.I especially admire your ability to present complex concepts in a simplified and engaging manner, making it accessible to viewers like myself. I found myself pondering the ideas long after watching it. It's evident that you put a lot of effort into crafting your content, and it truly shows.As someone who is deeply interested in the subject matter you cover, I was wondering if it would be possible to obtain the model.p file for this video. I believe it would be a valuable resource for further exploration and study.
Hi, thank you for your kind words! Yes, sure, the model is available, take a look at my video where I trained the image classifier, a link to the model is provided in the description if not mistaken. 😃🙌
Thank you so mych for this amazing video it is extremly helpful. Coud you please advise how you managed to generate masking image? Did you use any particular tool or you managed to get it from 1 frame of the video? Thank you in advance.
hi brother,i could not run the main.py i have a error like this: FileNotFoundError: [Errno 2] No such file or directory: 'model.p' inside util.py file: MODEL = pickle.load(open("model.p", "rb")) pls give way to fix it
check whether model.p path location you entered correct or not in util.py file just like this MODEL = pickle.load(open("/Users/mohdaltamash/Desktop/parking project/model.p", "rb"))
check whether model.p path location you entered correct or not in util.py file just like this MODEL = pickle.load(open("/Users/mohdaltamash/Desktop/parking project/model.p", "rb"))
Thanks so much for the video so I did the same exact thing just I little update in the scaling factor x and y but I when I run everything appears red so can it be that I did not get the data well ?
Hey felipe, I want to add something like entry barrier allows only the no of cars equivalent to the number of free space in the lot. How can i do that ? Loved the video tho.
I would like to thank you very much for the application but I have a question: can I do this without using the mask and if so, can you tell me in which part I will modify it? I need an answer urgently
to create make i have downloaded Inkscape. then import frame .make a new layer and mark the parking spots using rectangle with white fill. then create new layer below that and fil black rectangle. export the image to folder as png. but when i run the code using this mask the allignment is not correct .there is huge difference. how can i correct this.
this is great thank you so much for what you do. if we had a video of how you made the mask it would have been much better. if you have it please drop the link.
thank you for this wonderful video.how did you create this mask? should this be manually created for every different use case if parking arrangement/ dimension is different?
Hey Binod, I created the mask using Inkscape, which is something like an open source version of Adobe Illustrator. I like it because it is open source and very easy to use, but I guess any software would do. Yes, the mask should be manually created for every different use case if the parking arrangement / dimension is different. Although creating the mask manually takes some time, it is a one time process, once it is done you can just focus on everything else! I am glad you enjoyed the video! 😄🙌
Great video Felipe! i wonder if i want to use this with ip camera at different places of parking lots, is image classification the best approach to use? what say you?
Do you mean what is the best approach in order to classify if the parking slot is empty or not? It depends on the camera point of view and many other factors. If it is an aerial point of view like the one in the video I think an image classifier is a good approach. 🙌
@@ComputerVisionEngineer if the camera position is from the side, do i need to warp the image of the parking slots into rectangle shape first, or is okay if i just mask the parking slots image even if they are not the exact rectangle shape?
hey im getting this error, can u help me sir py", line 70, in spot_status[spot_indx] = spot_status TypeError: 'bool' object does not support item assignment
Hey Felipe, Big fan of your Work! I have a quick question: will the model be effective with different videos and masks, or is it specifically trained only on the examples you've provided?
hey felipe, thankyou for doing this video, im trying to remake the parking space detection with my own parking space video but i’m a bit troubled because i capture the video from the side so the shape of the space is parallelogram, can u help me to solve this so the bounding box can show parallelogram shape for the output? thankyou!
Hey, not sure if I understand, do you want to adjust this project to your video where the camera has a different point of view? If it is a fixed camera you could start creating the mask, so you get the parking spots by calling the connected components of the mask the same way I did on the video. 🙌
Hey Abdulhakeem, this model uses an OpenCV function to detect the parking slots and an image classifier to classify if a parking slot is empty or not. Both methods can be considered as AI! 😃💪
Hey Felipe, I want to do this project while watching your tutorial then share the project in my Linkedin referring to you and your channel and maybe adding it to Github for my CV. Is it okay for you ? I wanted your permission before doing it. I am new in computer vision. And I wanted to have some computer vision projects for my CV while learning it.
hey felipe, why i cant run the file like in the 9:50, theres no error in the main.py , but it wont show the video, but theres an error in util.py says that "Import \"skimage.transform\" could not be resolved from source", can you help me please
Actually for our project I was able to create mask image somehow(photoshop). It took me almost 5 hours and still 20-30% boxes are not at right position. drone view is easy ig, but I was making for side view angle.
hey im getting this error, can u help me sir for somaeone, can help me, thank you py", line 70, in spot_status[spot_indx] = spot_status TypeError: 'bool' object does not support item assignment
Hey Felipe . I have simple question how did you created that Gray scale image to detect space and is it possible to do that in runtime? Nice Video I loved It Thanks in Advance
Hey Vicky, do you mean the mask? I created the mask using Inkscape, which is something like an open source version of Adobe Illustrator. I just took a random frame from the video and I manually created the mask from it. This is something you need to prepare before running the algorithm, you can't do it in run time. 💪🙌
@@ComputerVisionEngineer Thank you for this great video. But is there another way to get the mask by coding? Because having to manually create masks for each different parking lot is quite annoying. Or can we have the bbox of parking spot without a mask ?
@@ngocnguyenduy5183 do you mean something like a parking spot detector that would work for any parking lot? I can not think on a solution that is robust enough to work on any parking lot. Creating a binary mask as I did on this video, although I agree is very time consuming, it is something you do only once and then you have a super accurate description of where the slots are located. I think it is a good solution when working with parking lots with a fixed camera. If you come up with a different solution let me know! 😃🙌
sir can you help me to solve this problem 97 x1, y1, w, h = spot 98 ---> 99 spot_crop = previous_frame[y1:y1 + h, x1:x1 + w, :] 100 101 spot_status = empty_or_not(spot_crop) TypeError: 'NoneType' object is not subscriptable
Hi Felipe, I hope you are doing great? Could you kindly guide me on how you created the empty and not_empty data set or do you have a video which covers it?
Hi, if I am not mistaken I just cropped the parking lot video according to the slots bounding boxes and then saved the crops to disk. cv2 will return the slot bounding boxes and also their id, so by verifying which ids are empty and which ones are not empty, saving the data into the right directory is very straightforward. 🙌
hello sir i hope you are well i have a question i made the mask and when i integrate it in the code it doesn't give me the same result it just give me a big rectangle in green and i worked on a capture of the same video
@@ComputerVisionEngineer with the mask you created it works but with the mask I created it doesn't work just it gives me a big green retangle on the whole image and thank you sir 🙏
Hey, the parking slot detection is done getting all the connected components of a binary mask and the image classification is through an SVM from the library Scikit Learn. 😃🙌
thank you very much for this tuto please share the video you used for the mask with me as soon as possible if you can plz sir can you help me to solve this error 97 x1, y1, w, h = spot 98 ---> 99 spot_crop = previous_frame[y1:y1 + h, x1:x1 + w, :] 100 101 spot_status = empty_or_not(spot_crop) TypeError: 'NoneType' object is not subscriptable
@@ComputerVisionEngineer Traceback (most recent call last): File "c:\Users\pc planet\Downloads\parking-space-counter-master\parking-space-counter-master\main.py", line 56, in spot_status = empty_or_not(spot_crop) File "c:\Users\pc planet\Downloads\parking-space-counter-master\parking-space-counter-master\util.py", line 22, in empty_or_not y_output = MODEL.predict(flat_data) File "C:\Users\pc planet\AppData\Local\Programs\Python\Python310\lib\site-packages\sklearn\svm\_base.py", line 810, in predict y = super().predict(X) File "C:\Users\pc planet\AppData\Local\Programs\Python\Python310\lib\site-packages\sklearn\svm\_base.py", line 433, in predict X = self._validate_for_predict(X) File "C:\Users\pc planet\AppData\Local\Programs\Python\Python310\lib\site-packages\sklearn\svm\_base.py", line 611, in _validate_for_predict X = self._validate_data( File "C:\Users\pc planet\AppData\Local\Programs\Python\Python310\lib\site-packages\sklearn\base.py", line 600, in _validate_data self._check_n_features(X, reset=reset) File "C:\Users\pc planet\AppData\Local\Programs\Python\Python310\lib\site-packages\sklearn\base.py", line 400, in _check_n_features raise ValueError( ValueError: X has 300 features, but SVC is expecting 675 features as input.
Hey Pavan, you can find a link to download the data and the model in the github repository of this tutorial, the files are publicly accessible. I just tried to access the link from a private browser and it worked fine. Please try again and let me know if you have any issues! 😀🙌
@@ComputerVisionEngineer Thank you , i wa actually connected to organization wifi so got restricted ,now it's perfect. Can u help us with like , along with each counter detection (red or green) if it had showed number on it like slot 1 ,slot 2 , slot 3 ... slot n . which will be storing in some list. Just need your help to modify this thing . 😅 And always love your content ❤️ Thank you
You could print the parking slot number on top of the rectangle by adding a cv2.putText next to the rectangle drawing. I tried to do it while I was preparing the video and got the impression it made the visualization too cluttered, but it is possible. You may need to adjust the text size and width. Enjoy! .... if spot_status: cv2.putText(frame, 'slot {}'.format(str(spot_indx)), (x1, y1), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2, cv2.LINE_AA) frame = cv2.rectangle(frame, (x1, y1), (x1 + w, y1 + h), (0, 255, 0), 2) else: cv2.putText(frame, 'slot {}'.format(str(spot_indx)), (x1, y1), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 0, 255), 2, cv2.LINE_AA) frame = cv2.rectangle(frame, (x1, y1), (x1 + w, y1 + h), (0, 0, 255), 2) ----
Good video, interesting use case, but much too repetitive in the narration. This video could be optimized to only 20 minutes.. I only managed to watch the first 10 min, not a very effective tutorial.
Do you want to know how I created the binary mask I used in this tutorial? Take a look at the Computer Vision School! www.computervision.school 😃🚀🎓
Try my premium courses! 😃🙌😊
● Hands-On Computer Vision in the Cloud: Building an AWS-based Real Time Number Plate Recognition System bit.ly/3RXrE1Y
● End-To-End Computer Vision: Build and Deploy a Video Summarization API bit.ly/3tyQX0M
● Computer Vision on Edge: Real Time Number Plate Recognition on an Edge Device bit.ly/4dYodA7
● Machine Learning Entrepreneur: How to start your entrepreneurial journey as a freelancer and content creator bit.ly/4bFLeaC
why it isn't full? :((\
Terima kasih video pembelajarannya...
Kami mahasiswa/i Magister Teknik Informatika Universitas Pamulang sangat berterima kasih dan bermanfaat videonya untuk guna pembelajarannya.
Thank you soo much for this video!! At first i was dreading doing a machine learning project since it always seemed complicated and I felt that you would need to do masters or phd to do something like this. But your video was completely opposite! It was really easy and interesting to understand. I cannot believe I did a FUN ML project in just AN HOUR!! Thank you and keep up the good work!! :))
You are welcome! Glad the content is helpful and fun! 😃 That is what is all about! ☺️
Great video Felipe, you are doing an amazing job helping us to understand all the possibilities within Computer Vision, thanks so much!
Thank you Gianmarco! Yeah, there are so many industries and so many possibilities within Computer Vision. I am really enjoying making these videos! 😃😃
where can we find the video@@ComputerVisionEngineer
well, i complated this project in 1 week(copied and pasted scripts from your video), and i don.t regret to my time. Fillippe because of your lessons, Im planning after your all videos to buy some course about computer vision or ML and get certificate to work on this)))
But are there errors in this code?
Also the pickle file cant be read by my vscode
@@Obit0bi well, check the path, the names of your files. and send exact time in video where you had the problem. In my case everything is working..
@@F_F_CH ill check it and let you know again ,the thing is my vscode is saying this type of file cant be opened or viewed ,it says it for the .p file
And also since the vedio file is above 10MB its also not supported
@@Obit0bi its very strange that video i not supported. Are you sure that you did your projects with PyCharm and downloaded all libraries? My advice is to follow the path if you started directly from this video. Because I started from Python, than OpenCV and than this video. For example I had some problems with Yolov8 video of Philippe and I resolved it by deleting all drivers and programs related to python and rea installing them, but your problem is very specific. Send me time on this video where you faced to problem, than i check mine script
@@F_F_CH Figured it out the thing is path given in the code to fetch .p file was wrong ,
When I clicked the .p file in the explorer section of vscode it was showing 'the file isnt displayed bcoz its either binary or unsupported text encoding' So I thought it would be some encoding issues of the pickle file
Now I need to integrate this project to a website that im goin to create
Thank you so much, but I get some strange Error Messages...
I'm not using your exact code but its quite similar...
When I use my trained model I get the error message: "X has 150738 features, but SVC is expecting 675 features as input" and I cant find help online...
Hello Can I install the latest version of the package rather than the specified ones? Ithe specified version are not installing for me
Hey Felipe,
Loved your work.I especially admire your ability to present complex concepts in a simplified and engaging manner, making it accessible to viewers like myself. I found myself pondering the ideas long after watching it. It's evident that you put a lot of effort into crafting your content, and it truly shows.As someone who is deeply interested in the subject matter you cover, I was wondering if it would be possible to obtain the model.p file for this video. I believe it would be a valuable resource for further exploration and study.
Hi, thank you for your kind words! Yes, sure, the model is available, take a look at my video where I trained the image classifier, a link to the model is provided in the description if not mistaken. 😃🙌
Great work!! Thanks for sharing.
I am new to AI, let me learn what algorithms and models you use in deep learning in this video? Thanks
Thank you so mych for this amazing video it is extremly helpful. Coud you please advise how you managed to generate masking image? Did you use any particular tool or you managed to get it from 1 frame of the video? Thank you in advance.
Hey Can you please provide the file model.p because i am getting an error "No such file or directory: 'model.p'" and also "rb" file
hi brother,i could not run the main.py i have a error like this:
FileNotFoundError: [Errno 2] No such file or directory: 'model.p'
inside util.py file:
MODEL = pickle.load(open("model.p", "rb"))
pls give way to fix it
Same here any updates
try “model.pkl”
is there any update on this issue?
check whether model.p path location you entered correct or not in util.py file just like this
MODEL = pickle.load(open("/Users/mohdaltamash/Desktop/parking project/model.p", "rb"))
is there any way I can update the sklearn of the model.p. Or do I have to use the same sklearn version of that model
hey felipe, i want to ask you, can we use custom model using yolo algorithm as the model input? and how do we put it as the source model, thankyou.
great video. Thank you so much.
FileNotFoundError: [Errno 2] No such file or directory: 'model.p'
is this already attach in the github repo.?
any update on this issue?
check whether model.p path location you entered correct or not in util.py file just like this
MODEL = pickle.load(open("/Users/mohdaltamash/Desktop/parking project/model.p", "rb"))
Thanks so much for the video so I did the same exact thing just I little update in the scaling factor x and y but I when I run everything appears red so can it be that I did not get the data well ?
thanks for the tutorial Felipe but can i ask how do you make the mask
I made the mask using Inkscape. 🙌
Hey felipe, I want to add something like entry barrier allows only the no of cars equivalent to the number of free space in the lot. How can i do that ?
Loved the video tho.
I would like to thank you very much for the application but I have a question: can I do this without using the mask and if so, can you tell me in which part I will modify it?
I need an answer urgently
Hey, you are welcome! 😃 The way this project is made it would not be possible to do it without the mask.
to create make i have downloaded Inkscape. then import frame .make a new layer and mark the parking spots using rectangle with white fill. then create new layer below that and fil black rectangle. export the image to folder as png. but when i run the code using this mask the allignment is not correct .there is huge difference. how can i correct this.
Hey, if you overlay the frame and the mask, do they match? are you using the same data as I do in the video?
Yes they are matching. I have tried with the same data. And also with other frames. In crop vedio frame I got the output but others didn't get
this is great thank you so much for what you do. if we had a video of how you made the mask it would have been much better. if you have it please drop the link.
Thank you! I do have a video of how I created the mask. It is available in my Patreon. 🙌
Please Can you make how do masking in inkscape. It will be helpful
I will try to make a tutorial about it.
thank you for this wonderful video.how did you create this mask? should this be manually created for every different use case if parking arrangement/ dimension is different?
Hey Binod, I created the mask using Inkscape, which is something like an open source version of Adobe Illustrator. I like it because it is open source and very easy to use, but I guess any software would do. Yes, the mask should be manually created for every different use case if the parking arrangement / dimension is different. Although creating the mask manually takes some time, it is a one time process, once it is done you can just focus on everything else! I am glad you enjoyed the video! 😄🙌
Great video. Can you talk about how many images you need at a minimal to train the image classifier?
Thank you! It depends, in this case the image classification problem wasn't very complex so I didn't need so many images. 🙌
Great video Felipe! i wonder if i want to use this with ip camera at different places of parking lots, is image classification the best approach to use? what say you?
Do you mean what is the best approach in order to classify if the parking slot is empty or not? It depends on the camera point of view and many other factors. If it is an aerial point of view like the one in the video I think an image classifier is a good approach. 🙌
@@ComputerVisionEngineer if the camera position is from the side, do i need to warp the image of the parking slots into rectangle shape first, or is okay if i just mask the parking slots image even if they are not the exact rectangle shape?
What tool did you use for the crop video and mask. Should it be exactly the same when testing out cropped vids
I used ffmpeg to crop the video if remember correctly.
@@ComputerVisionEngineer can you provide the crop_cars script? or have an tutorial for that
hi can ı ask you something ı just wondering this system can able to use to closed parking lot ? thanks for your attention
hey im getting this error, can u help me sir
py", line 70, in
spot_status[spot_indx] = spot_status
TypeError: 'bool' object does not support item assignment
Hey Felipe, Big fan of your Work! I have a quick question: will the model be effective with different videos and masks, or is it specifically trained only on the examples you've provided?
Hi! Do you mean the {empty, not empty} classifier? It is very likely to work in other images too.
How I get this parking videos to make this
hey felipe, thankyou for doing this video, im trying to remake the parking space detection with my own parking space video but i’m a bit troubled because i capture the video from the side so the shape of the space is parallelogram, can u help me to solve this so the bounding box can show parallelogram shape for the output? thankyou!
Hey, not sure if I understand, do you want to adjust this project to your video where the camera has a different point of view? If it is a fixed camera you could start creating the mask, so you get the parking spots by calling the connected components of the mask the same way I did on the video. 🙌
where i can download 28 seconds video of the parking? thank
do you get that ?
@@santhoshrajasekar7020 no hahaha I still need that video to continue
Thank you so much and I have a question please , could this model consider AI model or just use computer vision?
Hey Abdulhakeem, this model uses an OpenCV function to detect the parking slots and an image classifier to classify if a parking slot is empty or not. Both methods can be considered as AI! 😃💪
hey Felipe
i got this message can you help
line 54, in
spot_crop = frame[y1:y1 + h, x1:x1 + w,h :]
TypeError: 'NoneType' object is not subscriptable
Hey Felipe, I want to do this project while watching your tutorial then share the project in my Linkedin referring to you and your channel and maybe adding it to Github for my CV. Is it okay for you ? I wanted your permission before doing it. I am new in computer vision. And I wanted to have some computer vision projects for my CV while learning it.
Sure, go ahead! 🙌
hey felipe, why i cant run the file like in the 9:50, theres no error in the main.py , but it wont show the video, but theres an error in util.py says that "Import \"skimage.transform\" could not be resolved from source", can you help me please
Hi, it may be related to the library version.
please sir can you make a video to show us how you made the mask in inkscape
Hey, I will try to do it. 🙌
@@ComputerVisionEngineer i hope you to do it, because i really need it now
Actually for our project I was able to create mask image somehow(photoshop). It took me almost 5 hours and still 20-30% boxes are not at right position.
drone view is easy ig, but I was making for side view angle.
hey im getting this error, can u help me sir
for somaeone, can help me, thank you
py", line 70, in
spot_status[spot_indx] = spot_status
TypeError: 'bool' object does not support item assignment
hello i want to know hot get the avaliable spots coordinatees and save it in a file
great tutorial. how did you trained the model? can share the code for training the model?
Hey, thanks! Do you mean the image classifier? Sure, I made a separate video for it. This is it: th-cam.com/video/il8dMDlXrIE/w-d-xo.html 💪
Where can I find the video of the parking lot you have used?
The video is from pexels.
Can i use this code for images other than the one provided here
Let's always do alot of good ❤
great ...i have a question can we use any color other then black ?
Hey, not sure if I understand your question, what part of the video are you referring to?
Hi, great video. We can use the training data for another parking lot. No?
Hey, thanks! Do you mean the image classifier? Not sure if it would perform well in another parking lot, but you can try! Let me know how it goes! 🙌
@@ComputerVisionEngineer I will ...Thank you
Nice work!
Can this be done also for a live feed from a camera?
Yes, sure, it can also be done for a live feed from a camera. 💪
@@ComputerVisionEngineer is it possible to place an identifier for each parking spot, so that you know which spot is available at any given time?
@@Dimitrix777 yes, it is possible. When you call OpenCV connected components function you get an id for every bounding box.
Hey Felipe .
I have simple question how did you created that Gray scale image to detect space and is it possible to do that in runtime?
Nice Video I loved It
Thanks in Advance
Hey Vicky, do you mean the mask? I created the mask using Inkscape, which is something like an open source version of Adobe Illustrator. I just took a random frame from the video and I manually created the mask from it. This is something you need to prepare before running the algorithm, you can't do it in run time. 💪🙌
@@ComputerVisionEngineer Thank you for this great video. But is there another way to get the mask by coding? Because having to manually create masks for each different parking lot is quite annoying. Or can we have the bbox of parking spot without a mask ?
@@ngocnguyenduy5183 do you mean something like a parking spot detector that would work for any parking lot? I can not think on a solution that is robust enough to work on any parking lot. Creating a binary mask as I did on this video, although I agree is very time consuming, it is something you do only once and then you have a super accurate description of where the slots are located. I think it is a good solution when working with parking lots with a fixed camera. If you come up with a different solution let me know! 😃🙌
sir can you help me to solve this problem
97 x1, y1, w, h = spot
98
---> 99 spot_crop = previous_frame[y1:y1 + h, x1:x1 + w, :]
100
101 spot_status = empty_or_not(spot_crop)
TypeError: 'NoneType' object is not subscriptable
Hey oumaima, you may have an issue reading frames from the video. Take a look if your video_path is defined correctly. 🙌
i am facing same issue
Hi Felipe,
I hope you are doing great?
Could you kindly guide me on how you created the empty and not_empty data set or do you have a video which covers it?
The clf-data I mean
Hi, if I am not mistaken I just cropped the parking lot video according to the slots bounding boxes and then saved the crops to disk. cv2 will return the slot bounding boxes and also their id, so by verifying which ids are empty and which ones are not empty, saving the data into the right directory is very straightforward. 🙌
Can I get the whole system design from the scratch to deployment?
Thanks in advance.
I will try to make the system design for this project.
hello sir i hope you are well i have a question i made the mask and when i integrate it in the code it doesn't give me the same result it just give me a big rectangle in green and i worked on a capture of the same video
Hey, this happens when you use a mask you created yourself? what happens if you use the mask that is in the repository?
@@ComputerVisionEngineer with the mask you created it works but with the mask I created it doesn't work just it gives me a big green retangle on the whole image and thank you sir
🙏
Heya Budy
I have created manually one mask it's kinda tilted rectangle and script not creating rectangle over it
any solution?
Are you using a frame of this video or are you working with a different video?
Is there any paper published with using this similar algorithms?? Will be very helpful.
Hey, take a look in Google scholar, if there are any papers in the field you should be able to find it there. 😃💪
@@ComputerVisionEngineer Great!Thank you!!😇
Do you have any other masked vedios
Hey, in the lane crossing detector I also use a mask, although not in the same way as I do in this video.
What algorithm model type would this be?
Hey, the parking slot detection is done getting all the connected components of a binary mask and the image classification is through an SVM from the library Scikit Learn. 😃🙌
How can i make this mask using inkspace
Hey, you can take a frame and then draw white rectangles on top matching the parking slots 🙌
Yes I do like that but when I run the code using that it is very much displaced. I made the mask as same size as frame. What would be the problem
thank you very much for this tuto please share the video you used for the mask with me as soon as possible if you can
plz sir can you help me to solve this error
97 x1, y1, w, h = spot
98
---> 99 spot_crop = previous_frame[y1:y1 + h, x1:x1 + w, :]
100
101 spot_status = empty_or_not(spot_crop)
TypeError: 'NoneType' object is not subscriptable
Sure, this is the data I used in this video! drive.google.com/drive/folders/1QPHknNg-CiKVVOjObRVaRnUA1I-GlL4H?usp=share_link 💪💪
@@ComputerVisionEngineer thank you so much sir 😃😃🙏🙏🙏🙏
Hey i am getting this error can you help
ValueError: X has 300 features, but SVC is expecting 675 features as input.
Hey, are you using the same data I use in the video?
@@ComputerVisionEngineer yes i have download the exact same sample videos and code but still its happening
@@ComputerVisionEngineer
Traceback (most recent call last):
File "c:\Users\pc planet\Downloads\parking-space-counter-master\parking-space-counter-master\main.py", line 56, in
spot_status = empty_or_not(spot_crop)
File "c:\Users\pc planet\Downloads\parking-space-counter-master\parking-space-counter-master\util.py", line 22, in empty_or_not
y_output = MODEL.predict(flat_data)
File "C:\Users\pc planet\AppData\Local\Programs\Python\Python310\lib\site-packages\sklearn\svm\_base.py", line 810, in
predict
y = super().predict(X)
File "C:\Users\pc planet\AppData\Local\Programs\Python\Python310\lib\site-packages\sklearn\svm\_base.py", line 433, in
predict
X = self._validate_for_predict(X)
File "C:\Users\pc planet\AppData\Local\Programs\Python\Python310\lib\site-packages\sklearn\svm\_base.py", line 611, in
_validate_for_predict
X = self._validate_data(
File "C:\Users\pc planet\AppData\Local\Programs\Python\Python310\lib\site-packages\sklearn\base.py", line 600, in _validate_data
self._check_n_features(X, reset=reset)
File "C:\Users\pc planet\AppData\Local\Programs\Python\Python310\lib\site-packages\sklearn\base.py", line 400, in _check_n_features
raise ValueError(
ValueError: X has 300 features, but SVC is expecting 675 features as input.
@@ComputerVisionEngineer kindly help with this
Have you downloaded the model too?
Thank you Felipe for this video and the rest of your uploads
Oh, I see. Do you get that error while reading the first frame? Take a look if the path to video you set in line 13 is ok.
@@ComputerVisionEngineer You are right there was a problem with the path that's why the type was none. Thank you for all the help sir!
My pleasure! 😃💪
I am facing the same problem can you help me if possible
can i get the image and video
Hey Kamal, you can download the data I use in the video in the github repository of this tutorial. 💪🙌
Which Model do use in Project?
Hey, do you mean the image classifier? It is an SVM I trained with Scikit learn.
Hey hi , the the data and the model used are not accessible please help me
Hey Pavan, you can find a link to download the data and the model in the github repository of this tutorial, the files are publicly accessible. I just tried to access the link from a private browser and it worked fine. Please try again and let me know if you have any issues! 😀🙌
@@ComputerVisionEngineer Thank you , i wa actually connected to organization wifi so got restricted ,now it's perfect.
Can u help us with like , along with each counter detection (red or green) if it had showed number on it like slot 1 ,slot 2 , slot 3 ... slot n . which will be storing in some list.
Just need your help to modify this thing . 😅
And always love your content ❤️
Thank you
You could print the parking slot number on top of the rectangle by adding a cv2.putText next to the rectangle drawing. I tried to do it while I was preparing the video and got the impression it made the visualization too cluttered, but it is possible. You may need to adjust the text size and width. Enjoy!
....
if spot_status:
cv2.putText(frame, 'slot {}'.format(str(spot_indx)), (x1, y1), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2,
cv2.LINE_AA)
frame = cv2.rectangle(frame, (x1, y1), (x1 + w, y1 + h), (0, 255, 0), 2)
else:
cv2.putText(frame, 'slot {}'.format(str(spot_indx)), (x1, y1), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 0, 255), 2,
cv2.LINE_AA)
frame = cv2.rectangle(frame, (x1, y1), (x1 + w, y1 + h), (0, 0, 255), 2)
----
@@ComputerVisionEngineer Thank you so much ❤️
hey where can i get the video?
Hi, take a look at the github repository 🙌.
Bruh it didnt work, it says the ‘’import cv2’’ wrong
Hey, please make sure you install the requirements for this project which are listed in the requirements.txt file. 😃🙌
Valeu!
😃 Thank you so much for your support, Diego! 🙌
How to download the input video
Take a look at the readme file of this project's github repository, there is a link to the data. 💪🙌
what you use algorithm in this project?
Hey, I used OpenCV and Scikit learn! 💪🙌
Sir, it is showing a error in building scikit wheel
What error does it show? What is your OS and Python version?
@@ComputerVisionEngineer I have windows 10 and my python version is 3.10.9
@@ComputerVisionEngineer No module names 'skimage'
@@ComputerVisionEngineer I have installed all the requirements.txt file at the beginning
You need to install the package scikit-image.
Good video, interesting use case, but much too repetitive in the narration. This video could be optimized to only 20 minutes.. I only managed to watch the first 10 min, not a very effective tutorial.
thank you for your feedback!
Can you share the mask files please sir
Sure, you can download the masks in this project's github repository. 🙌
34:53
🦾🦾🦾🦾
Where are you gonna put the camera in satellite? Find some real challenge isnt?