Transcript:
Of basically city streets, right and some of the streets have houses and some of those houses have house numbers, and so the authors of the data set came up with a way to like, grab those numbers out of the images and then basically label them and lets. Check it out. Yep, as you can see, it’s working three two as you can see here. It’s like label three label label, three and label here’s. The rectangle drone and here are like its labels and the same trick works [Music]. Hey, what’s up? Everybody, it’s Alan here. And in this video, we’re gonna learn how to work with the estimation dataset in Python. Now, the solution data set or the Street View House numbers dataset is one of the best data sets out there and comes to working with digits where you want to frame your model to classify, like single digit numbers like a mist or whether you want like training a map model to classify multi-digit numbers like I have done, walked away with some great experiences and a good model from this data set like this is just like this is the data say that you are kind of worn, be familiar with if you were planning to do something with like classifying digits protecting them and so on. Now, let me talk about a couple of points, right. This data set is like so cool now. First one in this like a big one and but by name of the dataset, the kind that could have guessed that, you know, it’s a Street View House number data set, so this desert was scrapped from the real world so it wasn’t like generated or it Wasn’t. You know, it was Maya, I mean it. Wasn’t generated, so it’s it’s. It’s got all the properties and all the like notice that the real World House numbers have. And do you know like how they are like new Street. View cars from Google, you know, driving around the streets and making looks like 360 photographs of of basically city streets, right and some of those streets have houses and some of those houses have house numbers, and so the authors of the data set came up with a way to like to, you know, basically grab those numbers out of the images and then basically label them and we ended up with the data, says we end up so no grab the image from from say house, then then and then label that image. And this is the data set that we’ve got now. Another cool thing about this data set is that it’s got over 600,000 real world digital images now. I did you too much. What does that mean, you know? The desert has got only 250,000 images like at all, but it’s got 600,000 digit images. And that’s basically because there are, you know, images where they’re like several digits like here and so that kind of explains why there are hundred and fifty K images are all, but there are like 600 K just images and you may have also noticed that each each of the digits instead of inside of number has a bounding box, which is also, you know, really, really cool cast showing like test. Your ain’t no object, detectors and stuff or like crap digits and like licks them in some clever ways. You can also do that. Cuz, like each digit has got. Is that a bounding box? So there are two for much of this data set available on the official website. The first format is the one who will be using, which, like that’s like all about full numbers, and there’s also the second format with grab digits, which is more similar to like M nest, where they would just we’re like, really crap to Jessica, but we’re gonna work with like full formats, and you know, if you wanna crap our dress the day just know you’ll easily be able to do with the code that I’ll show you further and the benefit of like working with the full numbers is that we can train. Also, we can like use this. This there is have to train like a multi-digit. Classifier, let’s know we will have several digits and while I mentioned labels 11 labels to them so like there are like two formats, we’ll be using the full format and the dataset is downloaded with like three files. The first one is like training targz. Gigi, she said I don’t know the tests that are Drizzt an extra third. Is that and or Gigi? Actually, no here. Tell me the comments how to pronounce, right. I’m serious! I don’t know I’m anyway here. It says that, like the analogic behind separating the data set for like training limitation, testing images, it’s pretty straightforward, but it’s also separated from a training were just like x-ray images, so the logic there is that it’s got 73k digits for training and then 500k extra digits and the extra digits are no quarren code basically somewhat less difficult samples to use as extra for training to use as extra training data. But he knows we know the more data that labelled, and that’s good. We give the neural nets. Lets them better, so I’ll also show you know how we all basically unite the training and the extra data set. So I think I think one more thing that worth mentioning is the distribution of of of of of the number of digits in a single image. Now what that means, it’s like how many images there are There are like with radius. How many images there with two digits and how many image they’re like with five digits and so on, but the distribution of this data set in terms of the amount of digitally single image, so there are 14 K images where there is just where the house number is just one digit, there are almost landing. K images where they’re like where the house neighbour numbers made up of two digits there. Are you know 515 K Samples, warehouse numbers made up of three images and 15 K of four and hundred twenty four of five, so you can see a really really rapid deterioration comes to like house numbers in this data set that I made up of like, five digits for probably because you know they’re angels. Many houses there, anything streets where the houses are like named them and you know? What is it like, tens of thousands, if we’re like talking about five digit numbers? And there’s just one image that has six that has like six digits and so, Yep, that’s, you know, for the fruitiness, something for like, multi detection we’re probably sticking with like up to four digits at a time, because you know, they’re just aimed. At many images, One comes like five and six digit numbers, basically, so now about how we actually read this data set now that we know what it’s about and you know, and and and now now that you know what it’s about, you can tell us know. What do we need this data set? And and when and when you need it, so the problem is that to read this data set like when I was trying to read it like it was so freaking frustrating to try to read this. Data set gas levels were in the mat format and by searching Stack Overflow and like it happened. Everything how to read this, you know? I haven’t found a good way until I stumbled upon some become repository that essentially provided a way to convert this math labels from from Dis Matt labels that are inside these archives here, convert them to Jason – Jason format, and you know, just the form of cannabis to be easily readable in pythons so that we start to work with this data set here’s. How we’re gonna do this? I will leave links to this. Conversion can convert it to Jason labels, convert it to Jason labels on my Google Drive. So you can go and copy them to like your Google Drive. I hope we don’t have to work with Co-op and Google Drive. I’ll leave that in the description, So the first step is like you copying the files to your cup in the label. Pass to your Google Drive and let them to lock your Google. Drive and then just specify here instead of you know, my path like whatever those tables are stored in your computer and this guy is like. The Dude’s track extras are like the extreme would just test our test, and Jason are dishonest for the training images. So yeah, hopefully that’s clear, you know, if you also have to look. Mountain to your Google. Drive if you’re not familiar again, I have a video card work with go traffic over anyway. Then we go, and we download basically from these links. The data set were black. Only get the speeds are very good, so it doesn’t take much time to get the data into our co-op or like. If you’re just somewhere in Python outs, we download them. We untie them. Define a few functions now. And here we begin reading this data set. So the way we do that. We purchase and we open up the the JSON. Which is the training guy? Did you extract extra? Which is like the actually images and test the digit’s track test? Gosh, thank twisters, you know what? I mean. Digits track test for the test images we print out, you know, an example, and then we here we print out an example of how how they’re trained. How of how you know the they’re trained zero subject. Look, looks like as you can see. No, that’s how it looks like, and then in the next couple lines of code, we just concatenate the file name with the folder. So you know, when we entire this, so will we entire? The data will end up with, like extra folder test folder and with the training folder essentially, and what we do is to just concatenate to the two all the way of us that we’ve read to all the file names instead of inside of like the labels, though to to to the plate to the to the images. Finally us, we just concatenate here, The folder where they are so like if it’s a image from the training data set, we concatenate here train, so you know, one that beam tree becomes train slash one. That’s being trained salt, so essentially, these three lines of code. Just make sure that we can easily address the DDD training images. So yeah, and that’s about all the boring stuff here. Now, let’s actually get the fun stuff. We also, you know. Learn that the No. That’s actually not it. Sorry, one last thing. One last thing we defined data list as as the sum of data train and data extra, so our daily list will be all the training images, plus all the extra your soul and our of the data list will be 235 key images and the data test, you know, will be left untouched so that we can, then, you know, test the performance of our models without overfitting overfitting on the Test data set, so yeah. That was all of the boring stuff here. Now let’s get the fun stuff. Let’s actually play around with it so here. Let’s say we want to address the zero guy on the data data list, lets. Check it out! Yep, as you can see, it’s working. I feel basically find the code that, um, where we select an item from that list. We open up the image following the path with Opencv. And then as you can see, we here, open the item, and here’s how the label looks like. We’ve got the file name, which is which we’ve modified so that you know it’s like train Slash 1 PNG, we’ve got it it’s box. It’s now boxes is where both the labels for what’s written language and the bounding boxes for the image. So here’s what I mean, see this. This is the house number which you know. 19 and it’s got the height. I mean, I mean, I mean in. It’s in its element of boxes. It’s got two two guys here. Basically, one guys for one and the other guys for nine. So when it comes to the guy for one, you’ve got its bounding box coordinates and who comes to grab for them that the same here you can see. The label is one and here’s label is nine now. The interesting part of this data set that you wanna bleep you wanna be? Where off is that that it’s labeled zero as stance so here about some code that essentially says that like? Hey, if the label is them, then no say that say it’s zero. So let’s load another image, lets. See this guy? Some widgets, as you can see are really low resolution, But you can see here. That’s like 28 label 2 and then label 8 which is alright. This is some really really low re’s image. Let’s find something good, okay, that’s that’s right, so here’s some code that essentially, you know, droves, that whole thing out and open CV, so we extract the so we basically from each item We get. We iterate over each of the box. For each of the digits, we extract its laptop red bottom car units, which is all we need to draw the rectangle around it and then essentially put text with its left. Operan’d, check now. We essentially put that put text in the left top corner of the digit with yeah, with the label. And here’s what we can see here and here’s the rectangle drone and here are like its labels and the same trick works with the test data set. And I’m showing you this so that you know you can’t just have an easier time figuring out how to like, address all the balance here. Here’s like the colors work for like the test data set all the same stuff in see. Here’s like the able to label for a person’s like the drawings. Don’t fit here, but it’s okay, and we have like 200 something thousand images to think see address here, like, um, like two hundred two hundred thousand image, and, yep, it’s three, three two as you can see here. It’s like level three label label, three and labeled tube. So so this is a speech and dataset and again, like it’s a really cool data set and the reason why. I I feel good about making the studios again because it was so damn confusing to figure out how to actually create all those labels from the mat files. So I really hope that you know you like it, and, you know, helps you get started with it again like I live links this files with labels in the description below. Just copy them to your draft in them or like, download if you’re like in Windows or Linux or Mac, or you know, whatever. And yeah, I think it’s it for this video, actually. I’m guy could also I could put just yeah. I mean, this is called how I tested for the distribution of the data set and here’s the code that I sectional sums up all of the images in the extra folder in the Train folder in the test folder, so about 250,000 unique images. So yeah, it’s a great data set. I’ve trained my own models. I made to talk some screenshots. Here of you know how do matter? I trained on this bit, so it works. It’s good and now. I hope that you’ll have an easier time, figuring this data set out. So, yeah, it’s much like button. Please subscribe, so you don’t miss future. Readers might know that you like what we’re doing here. If you want to some ways, support me which which would help me a lot and somewhere support me are in the description below. Thank you so much if you do, and yeah, just hope you’re having a great day. I’m buying!