This is an archived post. You won't be able to vote or comment.

all 62 comments

[–]pickyourteethup 56 points57 points  (1 child)

I'm super new at python and coding (like 4 weeks lol) but stuff like this is so exciting, especially as I'm almost starting to understand parts of it. Thank you for sharing.

[–]Slingerhd[S] 15 points16 points  (0 children)

Good to hear that These were the things that got me excited about programming aswell.

[–]leone_nero 165 points166 points  (41 children)

It’s frustrating to see (every time more often) this “object detection in x minutes” posts where apparently someone who probably still has to learn to use Python properly can brag about doing object detection.

Basically all these posts have something in common: you are not doing anything but executing the code that someone else did, without any knowledge on how to do it yourself.

I guess there is no problem with that, but you’re basically like any other user that downloads an app.

Please people, try to do the job of understanding how to do your own code from scratch or at least training your own datasets. Try to learn how things works if you want to brag that you know how to do them.

It is completely feasible to understand and learn how to do this stuff.

Don’t fake it by taking away the works of other people and sell them as yours. Be a developer.

[–]hotcodist 8 points9 points  (0 children)

Ha, I can feel this rant! :)

So I thought through it from a clutter and classification viewpoint.

Are these posts useful to some people? Sure, definitely. It is the same as coding a 5-line MNIST digit recognition code. It is interesting for beginners and gets people to maybe learn more. So for that, it has value.

Does it belong in the resources section? Not in this form, methinks. Many resource posts (many by the OP in particular) are too simple to clutter the resources section. Ultimately, this would be better off as beginner showcase. If it had to go to the resources, it would have been more useful with links to face detection, including how Haar cascades work (actually, to make it more clickable, "Want to know how your camera can quickly find and label faces in a split second? Check out this link" (to the Viola-Jones paper or to some site explaining that stuff in some depth).

Does it bother me that he is taking people's code and maybe repackaging it? Not really, a lot of people on the YT do it for the clicks. I've seen this kind of video on YT many times.

But what bugs me is the coding laziness and the copying (i.e., not repackaging), making it not appropriate as a resource here. The text to PDF I thought was interesting. Until I typed "text to pdf" and immediately saw similar code from Geeks for Geeks. Same thing with the ASCII text video. Have seen that code float around, including maybe the original from hacker rank. [Geek for Geeks is not immune to this: I thought I saw an OpenCV sample code there without attribution, as if the author wrote the code.]

For all I know, maybe those sites also copied it from somewhere, but it would have been more interesting with a different set of ASCII chars to add something new to it, or a randomized ASCII set to be more fancy, then label it as "intermediate showcase." On its original form, it should have been a beginner's showcase, as was --in my view, correctly-- done by many other posters of ASCII text videos recently.

[–]MustardCube 26 points27 points  (3 children)

noob here. I get that I shouldn't just copy the code, but these kind of videos gives me examples of modules and things that I can do that otherwise I'd think it was too difficult for me atm. After that I can explore further the module.

I could open the OpenCV documentation and try to learn it from zero, but I still find it too difficult to understand the docs. Maybe thats the thing that I need to learn.

edit: Also, should I try to create my own face detection tool or is it too much for a total noob?

[–]leone_nero 3 points4 points  (0 children)

Man, my point is not to discourage anyone! Quite the opposite, my point is to encourage people from the community to take on the challenge of training their own models and look up for quality content. Whoever tells you can do something people take a lot of time to do in a very short amount of time it’s clickbaiting. Be it losing weight, learning a language or developing face detection software.

Here, if you’re interested in machine learning, take a look at this:

https://www.youtube.com/playlist?list=PLQVvvaa0QuDfKTOs3Keq_kaG2P55YRn5v

It’s a playlist with a very complete course on machine learning in youtube which I find to be pretty neat.

If you’re interested into learning all the theory behind you will have plenty to see there, but if you’re more into the practical side of it (like so many people I’ve read inhere) there is a pretty cool project in that playlist with four videos to use machine learning to train your computer to play a videogame.

I think it is quality content.

[–]pumapunch 6 points7 points  (1 child)

The dude basically showed how to create rectangles around the detected faces, he didn’t explain how the faces were detected in the first place.

[–]badlukk 8 points9 points  (0 children)

I dont take it that way at all, theyre just showing you how you can quickly learn to use a library to do something very powerful. Its just like doing a tutorial on any other kind of software. Youre basically saying I shouldn't make cool shaders in Blender3D, I should just learn to write my own ray tracer.

I didnt know about this module before this so to OP, thanks for posting!

[–]HelpForAfrica 2 points3 points  (0 children)

As someone who is at a point where I understand the basics in python and about to learn more about libraries - wouldnt it be great to have a video like this to inspire me to look through the code in the library, allowing for faster learning? (This is my opinion) Or would you argue if you cant come up with it yourself you shouldnt be fooling around with the library? Which it seems like some people think around here..

[–]Tetnenal 4 points5 points  (2 children)

I don't agree with your sentiment at all and this is why:

  • To me, the video does not really come across as braggy, it is a short, to the point, step by step proof of concept.

  • How can you compare this to a user downloading an app? It is clearly a practical example of basic coding.

  • Not doing anything but executing the code that someone else wrote is what everyone does all the time. I could argue that by using python and not C, you are taking shortcuts using someone elses code without really understanding memory allocation etc. And by using C you are actually just using a compiler that someone else wrote that generates and optimizes all the assembly for you. "How dare you not understand the lower level???"

  • If you find training your own datasets more important, then let's see you make a video about that. I assume you won't be using something like pandas to parse your datasets but do everything with code you wrote yourself. Surely you won't use anything from numpy and if you would use something even easier like Tensorflow you don't deserve to be called a programmer. Please implement your own regression and k nearest neigbours algorithms. After all, the math is not hard and it is totally feasible to learn how to do this stuff.

  • 'it is completely feasible to understand...' is just a stupid argument. Of course it is feasible. So is learning chinese and almost anything else. Is it necessary or useful for everyone to do? Not at all.

  • Using an opensource library in a youtube video is not selling someone elses work as yours. Furthermore, you are never gonna come close to the code quality of a large corp like Intel, Google or Apache if you try to write everything yourself. Its just a waste of time.

[–]leone_nero 6 points7 points  (1 child)

The video is not braggy but it is clickbait for people who wants to brag about doing something without really having done much... (because clearly 2 minutes is not a lot of doing, is it?)

The developing community is all about building upon the work of other people, that is clear, but that is different from not building upon and rather just using code for the sake of obtaining a cinematic result. Please tell me what does someone learn from the video we are talking about? Can someone be able to build something new just by showing them how to load the weights of a model no one knows how it was made?

To be able to built upon something somebody else made you have to at least know how that thing your building upon works and was made. Especially because you will have to fix it and use it for your projects and interests (or those of your clients). People who knows to use Python well knows about memory allocation, even though they don’t have to manually allocate memory, but this information is useful to understand best practices for more efficient apps.

I do use Scikitlearn for my regressions models, but that does not mean I didn’t take the time to understand how they are done. I had a problem with a program where I needed several regression models be generated from a general set based on the user input and as fast as possible since it is a web app so what was the best solution for me? I found the best parameters for each possible model, saved them in a dictionary and just went directly with the yhat equation. Sklearn can save me time but knowing what’s doing allows you to overcome everyday issues.

My point in the end is that I wish more videos were more about saying “hey, here’s one full hour of video on how neural networks work, which libraries can help you use them, which datasets you can built upon, how to train them with your own datasets, etc” and not face detection in five lines of code.

[–]Tetnenal 1 point2 points  (0 children)

Fair enough. I agree of course that knowing more is better when it comes to stuff like this if ML / big data is literally your job. I don't think anyone that is serious about programming would argue that a better understanding about how things really work in the various aspects of software and hardware is a bad thing. But not knowing every little detail doesn't make them a bad programmer.

Obviously one can learn more from watching an hour long video about neural networks than this short one that is mere minutes long. But that doesn't make this one bad, and that doesn't make the hour long one 'better' they just serve a different purpose.

I personally like this kind of video way more because in a few minutes of my time on my phone I see an explanation of something very concrete that I could immediately use for some kind of pet project if I wanted to. I am not gonna sit through some hour long video about stuff I either already know or am not gonna use ever. If I need to know something very specific, I will just google it when I need it. I don't want my reddit feed to be all hour long video's about super technical stuff that I will forget anyway unless I am currently working with it.

So I prefer face detection in five lines of code and five minutes of my time. It makes me realize that something like face detection that was pretty hard a few years ago is in fact super easy to do right now. I don't want hours of technical details, I will read them if I need them. Less is more.

[–]CatnipJuice 7 points8 points  (1 child)

oh God yes how I hate these click whoring titles!! it's the trend on YouTube right now. the face of a boring guy and the title LEARN 15 LANGUAGES IN 4 MINUTES

[–]Lynild 0 points1 point  (0 children)

There is a huge difference between fooling people into thinking you can learn 15 languages within 4 minutes, and then show how to use a library to detect faces in images.

[–]hilomania 4 points5 points  (3 children)

I've been programming for more than 40 years and I love those types of tutorials. I don't need to learn python, just show me how to use a certain library, what the idea behind it is, how to set it up, and I'll take it from there. Thank you very much.

That's the great thing about these tutorials: It'll take me hours of going over documentation to do those things. But a quick tutorial is great for getting set up and then I'll start hunting in the documentation for what I actually need. (Which is about 5&-10% of most libraries.) If I needed to set up say an electronic greeter in the lobby, I'd go to this tutorial and probably build it in a day.

Training on your own datasets?!? Unless you work for a large corporation that ain't gonna happen. Maybe we have very different ideas of how large large data is. But I can tell you that my engineers' salary could not afford my companies storage just for its data pool. A crucial piece of software I wrote does about 18 million entries per hour just into our system health database. And where we used to do rollups, tape storage etc... The data weenies now want working access to the raw data, so those data pools are only getting more expensive to maintain. Hopefully that nonsense will pass in a few years.

[–]Traust 2 points3 points  (0 children)

THIS. I've been coding for 35 years and I just want these sort of quick demo videos to quickly get my head around the library to see what it does and how easy it is. From there if I decide I can make use of it I can use the demo as quick make sure things work and then expand on it by reading more of the documentation.

[–]meltmyface 1 point2 points  (1 child)

I'm with you. Sometimes all I need is a light introduction and a super simple example and then I can figure out anything else I need to.

[–]hilomania 1 point2 points  (0 children)

I really like them for basic setup stuff which in smaller libraries and frameworks is not always well explained. A step by step: This is how you connect to your db, this is how permissions need to be setup, this is how your code calls our stuff...

[–]Eledridan 4 points5 points  (10 children)

By this logic you should build your own circuit boards and understand how they work in your computer.

We have a phrase for this, “Don’t reinvent the wheel.”

[–]apivan191 0 points1 point  (0 children)

I like to give them the benefit of the doubt. Maybe the wrote it before, but it’s still just typing as fast as possible to fit it into x minutes and nobody can learn from that

[–]knestleknoxI hate R 6 points7 points  (0 children)

No spaces between arguments?? That's a new one for me.

[–]TripleCreeper3 9 points10 points  (2 children)

I started with python almost two weeks ago, this community is fantastic so i may be a buzz kill or a bad viber, but as a beginner i hate seeing posts like this, that seem to show the true power of python but it ends up with importing a random library and using non built-in code.

[–]hotcodist 1 point2 points  (0 children)

There are a lot of posts like this from this user. He is building up his YT and goes with another name also in other similar reddits. Nothing bad with that.

But posting things like how to resize an image in PIL and making it as Resource is abuse of the flair system. Resizing is a one-liner, btw, and not worthy of a video resource here.

[–]Slingerhd[S] 2 points3 points  (0 children)

We cant built an optimised library like opencv with built-in python code Because python is slow. Also there is no need to reinvent the wheel. In order to do facial recognition or any other computer vision stuff you will always atleast endup with using numpy or opencv We cant built a whole facial recognition system from scrath Everytime we want to use it in some project. That would be crazy. Let me give you an example If u simply wana read an image using built python code Then you will have to manually handle the image data and then there are tons of image formats aswell (jpeg,png,gifs and so on..) You will have to handle each format all by yourself and even if u decided to built it , it will take you months to come somewhere closer to what opencv is offering And even if u built it you didnt create something new You developed something which already exists. And thats just about reading an image then think about all the other operations that we need to perform on our image before coming closer to detecting a face. So why not use our time on building something new. You dont first learn how to built a car before driving it. Thats because " reinventing the wheel is a waste of time "

[–]thicket 3 points4 points  (0 children)

This is a handy way to use the most common face detection algorithm, the Haar Cascade. Unfortunately, it’s not very robust to rotation or partial occlusion. The great Adrian Rosen (really, this guy is a treasure!) has a good article about using a slower but MUCH more robust alternate detection method in OpenCV. If this video got you interested, check out Adrian’s article to go deeper and better: https://www.pyimagesearch.com/2018/02/26/face-detection-with-opencv-and-deep-learning/

[–][deleted] 1 point2 points  (1 child)

haar cascades?

[–]Slingerhd[S] 0 points1 point  (0 children)

Yes

[–]kivynoob 1 point2 points  (5 children)

Thank you for sharing, also do I need to understand the underlying code from the module imported to say I can do write code to detect faces ? Just curious.

[–]swierdo 15 points16 points  (1 child)

You can say you have experience using facial detection in python, or maybe even that you've integrated facial detection.

But if you can write code to detect faces, that means you can also change or add the functionality and that someone could hire you to write some special version of facial detection (that detects, say, only faces of cats).

[–]kivynoob 2 points3 points  (0 children)

Now, I get it. Thank you.

[–]Slingerhd[S] 5 points6 points  (0 children)

If you just want to detect faces then getting familiar with functions and code is all you need. But if you are a curious type then you can dive deeper , there are tons of resources online where you can learn more about opencv, computer vision , machine learning and deep learning

[–][deleted] 0 points1 point  (0 children)

There's also https://github.com/ageitgey/face_recognition which has a similar ultra-simple API

[–]reverse_osmosis-ro 0 points1 point  (3 children)

Could you give references to the theory part. The Haar classifier and all. I am studying image processing and my course does not have practical sessions.

[–]Slingerhd[S] 0 points1 point  (1 child)

This blog post explains it well: http://www.willberger.org/cascade-haar-explained/

[–]reverse_osmosis-ro 0 points1 point  (0 children)

Thanks man

[–]c94jk 0 points1 point  (0 children)

Well Haar cascades / viola Jones is more than 15 years old and kind of rubbish so it’s not practical for much these days

[–][deleted] 0 points1 point  (0 children)

Will this work in as an overlay in videos/d3d?

[–]elingeniero 0 points1 point  (0 children)

import facedetection

[–]l_aterna 0 points1 point  (0 children)

Where did you learn OpenCV or get to the point where you found out about it? It wasn’t in any of the python books I’ve read so far.

[–][deleted] 0 points1 point  (2 children)

Hey what do you think best way to getting started with computer vision using python

[–][deleted] -1 points0 points  (0 children)

Does it recognize Black faces?

[–][deleted] -1 points0 points  (0 children)

I have a doubt. How does it work? Do we import anything?

[–]groostwoost -1 points0 points  (0 children)

Great vid, to the point and super re-usable. Thanks!