Python Bytes - #105 Colorizing and Restoring Old Images with Deep Learning

Episode Date: November 23, 2018

Topics covered in this episode: [play:1:32] Colorizing and Restoring Old Images with Deep Learning [play:4:25] PlatformIO IDE for VSCode [play:7:35] Python Data Visualization 2018: Why So Many Libr...aries? [play: 11:21] coder.com - VS Code in the cloud [play:14:20] By Welcoming Women, Python’s Founder Overcomes Closed Minds In Open Source [play:19:40] Machine Learning Basics Extras Joke See the full show notes for this episode on the website at pythonbytes.fm/105

Transcript
Discussion (0)
Starting point is 00:00:00 Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds. This is episode 105, recorded November 21st on Turkey Eve. Yeah. And I'm Michael Kennedy. And I'm Brian Atkin. Hey, Brian, are you ready for Turkey Eve? No, not at all. Yeah.
Starting point is 00:00:17 Are you? I'm getting there, I'm getting there. I just picked up a whole bunch of stuff. We're going to cook a turkey and it's going to be crazy. Nice. So, yeah, yeah. We bought a smoked turkey, so it's already, all the work's done. Yeah. That's the way to do it. Just save yourself the trouble. I don't know how many people out there listening who don't go through this Thanksgiving thing actually cook turkeys,
Starting point is 00:00:35 but it's kind of stressful and it takes forever. It's like many hours. Yeah. And then for some reason, everybody wants to eat like dinner at two o'clock in the afternoon or something. like that. Yeah, well, they've probably been drinking since 10, so that's why. All right, so for those of you who celebrate Thanksgiving, happy Thanksgiving. For those of you who don't, happy email Black Friday spam week, and hopefully you got some deals. Yes. So thinking of crazy things, it's pretty awesome that digital ocean is giving people a
Starting point is 00:01:07 hundred dollars credit for creating an account over at pythonbytes.fm slash digital ocean tell you more about that later you know one thing i like about thanksgiving is it lets you sort of look back on history and like think about your family and like kind of just older stuff right yeah it does it's nice and maybe look at some old pictures. Yeah, but sometimes it would be great if they weren't old and black and white and boring and crummy. Definitely. There's a project, and it's Python-based and machine learning, called DeOldify. DeOldify. The name says it all.
Starting point is 00:01:39 Yeah, it would be actually a great name for a health club, too, I think. What it is is i can only sort of describe it what it does is it takes a black and white photo and makes it look awesome and like does a whole bunch of cleanup of sharpening and then colorizing it you kind of have to look at these pictures they're kind of amazing one of the things i like about actual old pictures when they started to put take color photos and do colorizing, there's a lot of color. It wasn't muted, whereas some of the colorizing algorithms that are out are kind of just default to obvious things like grass is green and make everything kind of
Starting point is 00:02:20 brownish and stuff. And it just makes it a little bit better than black and white but not really but these really pop like adding purple and greens and reds and and all sorts of awesome things these are glorious like the old soda shop one it's just so amazing do you know how it gets the color right like why does it not make people you know purple or something well i mean things like people are sort of an easy thing because they're going to be kind of people colored. If we get too far into the how it works, I really can't tell you. Well, it does use deep learning, which means like if you get too deep down, nobody knows how it works in some sense, right? Like you've taught it sort of by example. Yeah. Yeah. It's definitely based on self-attenuation, generative adversarial networks, and progressively growing the GANs with a two-time scale update rule and generator loss in two parts. I have no idea what those words mean, you know what would be like a great Christmas gift or something would be to like get a hold of some old photos, do this against them, and then take them and like turn that into a photo book for like your grandparents or something.
Starting point is 00:03:33 Wouldn't that be awesome? Yeah, it would be. And I'm actually, I can a text-based interview with Jason Antic, the developer of DL Defy, talking about why he developed it and how he developed it. And it's kind of a really fun article. So if you're curious about this, either just play with it, try it, or, you know, read the article.
Starting point is 00:03:58 I really like these visual things. I think it very clearly highlights, like, how amazing just this whole deep learning and machine learning thing is, you know? Yeah. And this is a sort of a fun application of it that I would have never thought we could make our lives better by making these photos better. I mean, I wouldn't have thought machine learning would be for that, but it's cool. Yeah, it's very cool. So remember last time how you said Brett Cannon was going to be mad at me?
Starting point is 00:04:24 Yeah. Well, Brett i will probably be happy because i'm so good i got a lot of items on vs code this week and they're pretty awesome so um i didn't do it to make up for it but i'm happy happy to feature them so this first one has to do with iot and i think iot is one of these amazing things that often is like below the surface right Like when smartphones came out, it was so amazing. Everybody saw it and you're like, show me that thing. That's incredible. But you know, the fact that, I don't know, your refrigerator is slightly smarter or your
Starting point is 00:04:55 microwave or your doorbell, I think it's less obvious, but there's tons of IoT stuff out there and the ability to do it in Python these days is great, right? Yeah. And it's amazing how the IoT everywhere is sort of just make it's no big deal anymore so fast. Yeah. And the price is coming down. The energy consumption is coming down. It's great. So the thing that I want to tell folks about is something that Jason Percor told us about called PlatformIO ide for vs code so platform io is this like platform for interacting with all sorts of iot and small device type of programming examples and it has tons of languages
Starting point is 00:05:35 and what they've done is they've built in a debugging their framework all that stuff into visual studio code oh that's cool and what's cool is because it's visual studio code it has like all sorts of mixed mode understanding so if you're doing c++ embedded c++ great if you're doing python great it knows about all these things so super cool it has a cross-platform of course because it's just vs code basically built in debugger check this out remote unit testing on your device that's pretty pretty sweet. Firmware updates, all that sort of stuff. Yeah, neat. Yeah, so if you're working on like Arduinos or something like that, it's sort of comparable to the Arduino IDE, which I haven't actually used very much.
Starting point is 00:06:16 But it's sort of that kind of thing. Now, there's a few features. I think like firmware updates and a few other things are paid, but it's like $9 a month. But there's also a free version. So it's a little bit like PyCharm in that sense. Like there's a paid edition and a free community edition. So it's pretty cool. The platform IOCore itself is written in Python, which is awesome.
Starting point is 00:06:35 But it's written in legacy Python. Boo! Hiss, hiss. But that's okay. And then finally, Jason put together a video of when he, sort of an unboxing of the IDE, but it's digital, so you don't really take it out of anything. But when he first sort of test drove it.
Starting point is 00:06:51 Oh, that's neat. Going through it. So it's like a 15-minute video. So if you really are interested in doing this and seeing how it works, you can check out Jason's video, which I also linked there. Nice. Cool. Yeah.
Starting point is 00:07:00 So IoT, definitely a cool option here. You might be collecting a lot of data on those IoT devices, right? You could have them all grabbing data from all over the world every five seconds, streaming it back, drop it in somewhere. You want to look at it, right? Yeah. You might want to make that into some visualization. Yes. And there's a lot of options.
Starting point is 00:07:19 So I actually am in the middle of this problem right now with a work project of trying to decide which visualization libraries to use on a particular problem. Oh, let's draw a graph. Oh, wait, there's 300 ways to do that. Why is this? Yeah, there's an article that's on the Anaconda blog called Python Data Visualization 2018. Why are there, why so many libraries? It talks about, about you know how like
Starting point is 00:07:45 there's some of them are map there's matplotlib of course and there's a whole bunch of others that are based on matplotlib and then whether or not you use javascript and then you know if you use json or something else and then there's webgl and anyway this uh it's a it's a nice breakdown of of the different tools and kind of the data behind it, like what data and stuff they're using. And then also what you can do with them, what plot types you can do. And generally, if you're using, for instance, geographical data, then you probably maybe should look at Matplotlib with Cartopi or a few others. They've got some examples and they bucket them together. So it's less of a search.
Starting point is 00:08:32 You don't have to look at everything to see if you should look at it. And also kind of what your data size is. And I very much appreciated this to kind of narrow things down. Yeah, it's really cool. And there's a great visualization as well from Jake Vanderplass, which it's kind of like a mind map of related, linked together different visualization libraries. So it has like, well, here's D3 as one of the major hubs. And then you've got matplotlib.
Starting point is 00:08:59 And maybe for matplotlib, you might want to use scikit-plot, which is derived based on that. Or if you're using D3, you might use, I don't know, D3PO or whatever, like one of these other things. But it also says, well, you can combine matplotlib and D3JS and get MPLD, mapplot something three, like a combination, MPLD3, I guess. I don't know. But the relationships, so maybe, oh, if I'm using this, there's this other library that also has some other features I could combine. I think it's cool. Yeah, they all kind of interrelate. And then I wanted to point out that sometimes you're just
Starting point is 00:09:33 like, I just want something simple. I really was looking for this example about a year ago, and I wish I would have found it. But there's an example I'm going to link to that's just a really short article and then a link to a gist which is just a single file containing flask application that both generates and displays a couple matplotlib charts so matplotlib might be the simplest thing but it isn't obvious right off the bat how do you encode how do you generate one of these things and then link to it in a webpage and all that sort of stuff. So yeah, this is nice. Nice, nice. I don't have a reason to draw graphs too much, but I'm starting to think maybe some BI type stuff might be in my future. That would be interesting to learn. And I'll
Starting point is 00:10:20 definitely have to come back to this to figure out how to look at it. Cool. So before we get on to the next one, which will also make Brett Cannon happy, I think, is I want to tell you quickly about DigitalOcean. So DigitalOcean, great hosting provider, super affordable, really rock solid. And one of the things that's cool that they do is they've created this idea of projects. Because often you go into your cloud provider and you've got these testing servers and all these other, just all this stuff. You're like, well, what goes with what is this thing? Can I turn this server off? Is it being used? Right? Is it what group is it related
Starting point is 00:10:53 with? So they have this idea of projects, and you can group your droplets, which are VMs and load balancers and domains and IPs and all that into these different projects. So you can treat them individually as like all of this infrastructure goes with this site. And that infrastructure goes with that site and stuff like that. So very cool. You should check out what they got going on over there at pythonbytes.fm slash digitalocean. And like I said, you'll get $100 free credit if you create a new account there. So very nice stuff.
Starting point is 00:11:21 Now, speaking of the cloud and speaking of Visual Studio Code, I want to tell you all about Coder.com. So Coder.com is a thing I recently learned about. They reached out to me for some stuff on TalkPython. And after playing with it, it is pretty cool. So you know how VS Code is an ElectronJS app, right? Okay. So in ElectronJS, there's kind of a hidden Chrome.
Starting point is 00:11:44 The thing that you see is a window. That's really Chrome, just like a headless Chrome type of thing running some kind of HTML there. And then it talks to Node.js over like a local transport of some sort. Okay. What if you could separate those?
Starting point is 00:11:57 What if the Node.js backend lived in like a server that was really awesome? And then you could just put the front end anywhere like a website. That's kind of how it's designed to work. So yeah, it seems possible, right? So basically that's like coder.com. So it's full Visual Studio code,
Starting point is 00:12:11 but in your browser on Awesome Wrangler. So you can write code in your browser and it's because it's full Visual Studio code, you get like all the 4,000 extensions, all the different languages. And it's not some like cheapo imitation, sort of sometimes the autocomplete works IDE in the cloud. It's like literally just a visual studio, but working in your browser. So it's really, you know, once you fire it up and get going, it's like,
Starting point is 00:12:37 within a few minutes, you're like, Oh, wait, that's not the regular top bar for my app. That's a browser window, but you would just kind of forget and it has some other features so like it runs every time you create a project your project lives in a docker container and you get root access to install and configure that linux docker machine however you want so you can do basically whatever you want in the cloud on this thing and there's a like there's a paid feature you can push a button and it will give you up to 96 cores of computational power, you get like a certain amount of free, like five hours, but after that, it's a paid feature, but still, it's pretty awesome. So if you want to work on Linux, and you're on say, Windows, and you need like, hardcore Linux, not just a VM, but something that's really running solid, you can use this if you're on a Chromebook, or you're on a tablet,
Starting point is 00:13:23 right, this would be awesome. All sorts of stuff stuff another thing that's really cool is it has Google Docs like collaboration so multiple people can be working on the same file at the same time oh that's neat yeah it's pretty awesome so anyway I wanted to tell people about it they just launched a few weeks ago and I think I think it's pretty awesome they have really good Python support you can obviously pip install all the stuff you need because you just open the terminal and you have root access. So do what you like to it. It looks like it has a whole bunch of plugins available too.
Starting point is 00:13:50 It isn't just bare VS Code. Yeah, no, it's super cool, that thing. So quite the neat project. Now, just for transparency, they did sponsor TalkPython to me, but this is not an ad. This is just like I learned about it because of that. And I'm like, oh, this is pretty cool. I'll tell people about it here. So anyway,
Starting point is 00:14:06 something worth checking out. And the free option is, is pretty, pretty cool. You get like three gigs of disk space, one gig of Ram for free forever, pretty much. So it's pretty cool.
Starting point is 00:14:16 That's generous. Yeah. Yeah. Not bad. All right. What's your next one? This one, it just popped up on my newsfeed.
Starting point is 00:14:23 I think it was this morning. This is a Forbes article about Guido and, you next one this one it just popped up on my news feed i think it was this morning this is a forbes article about guido and um trying to bring more women into the python community some of the stuff i didn't i knew things some of these things were happening but i didn't know some of the impetus and and the i mean i was, but I didn't really understand why. But apparently in 2015, somebody just mentioned to him, like, weird, there's no women in the core, in Python core, why? And, you know, he talks about a lot of projects having that problem, or at least situation where there's not a lot of women contributing. And you kind of have to examine why that's going on. And so he took on putting out an offer saying that he would mentor women that wanted to become core developers.
Starting point is 00:15:15 And, of course, we know Marietta was the first, and that's awesome. And now there's four altogether, and, um, and then he just wants that to keep growing. And it's also kind of a nice, um, nice talk. It's an interview that happened after he stepped down saying that he's definitely going to be stay involved with Python. It's just, he doesn't want to be part of all the, the everyday fighting and stuff. So, right. And just, I kind of read this also, and I was thinking about, there was a comment that Python was worse than the average just commercial engineering team. That is troublesome, but I think a lot of, even depending on what kind of field you're
Starting point is 00:15:57 in, this might still be a problem. And I think people need to examine their own hiring processes and how you get people involved in your project, whether it's open source or whether it's commercial. And take a look about really – one of the comments was some teams will say there's no women in the core because nobody's been interested, nobody's asked. But that's probably a little insincere if you take a look about how the commit bit happens. It's often kind of a nebulous, fuzzy, we trust this person sort of a thing. And a lot of hiring is that way, too. And the argument that a lot of hiring people say is, well, I would hire a woman or somebody, other underrepresented group, but nobody applied. And I think that's just kind
Starting point is 00:16:47 of BS. You have to go out of your way to try to find a larger pool. And so this is just a good reminder. Yeah, it's a great reminder. And Gita did super important work there. I said it before, but I think I've been to different types of programming conferences. And coming to a Python conference is a much better experience in feeling like this group of people represents the general population of the world compared to other ones where, you know, not so much or not at all, basically. So I think that's a really positive aspect of what's happening for the community and it's great that forbes i mean forbes that's a huge place to cover this so that's pretty awesome yeah now on your hiring thought a lot of jobs i think get filled by first asking all the team members who
Starting point is 00:17:36 work there who do you know and who's awesome who should we hire and when that process fails and it's like fine we'll put like a general put a general job offer out there that everybody might get. But I can certainly see how that would create reinforcing groups because the team that you have would know people most likely like them, right? Yeah, and also some of it's the crucible process of the hiring process as well. Even if you have people that are decent candidates, I don't remember where I have this reference from, but I've heard a comment that more frequently a male will apply for a job where he meets at least two of the qualifications. But more likely, a woman will only apply for jobs where she meets all of the qualifications. And there's a difference right
Starting point is 00:18:25 there. So you have to, it has to start from the very beginning of be very careful what you put in your required qualifications because it will eliminate a bunch of people. Yeah. I think that's really interesting. I speak to my wife about this sometimes and she's like, well, guys will just say they'll just, they can do this thing or, or whatever. And they can't, they don't have all this, the experience or everything that they need and they'll just, they can do this thing or whatever. And they can't, they don't have all the experience or everything that they need and they'll just do it and then they'll get the job. And women don't. And I don't know, she wasn't really saying that was unfair. She's just saying. It is the way it is. So you have to be aware of it. It is the way it is. But I mean, on one hand, let's put this out here as an encouragement to
Starting point is 00:18:58 women to say, look, if you have- It's not really a requirement. It's a wishlist. Yes. And if you have most of them, it's a wish list. And if you have most of the things, or the important ones even, just apply, right? I mean, there's so many opportunities for JIT learning, just-in-time learning. If you know three out of the six things, but you could take some online classes or something, or read a book on the others, just apply. Yeah. The other end of it is often part of the hiring process isn't really on qualifications. It's on fit. Do they seem like they already fit into the team? Yeah.
Starting point is 00:19:30 And you have to be really careful with that because you might end up with a very inspirational woman named Annalena Pupkis. And I had her back on TalkPython just last week, actually. It was an incredible interview, too. Thank you. Yeah, thank you. She was such a great guest. And so many people wrote to me and said, wow, she was really inspirational. And I think she was.
Starting point is 00:19:59 And one of the things that was inspirational was not long ago, she had no programming skills. And then she decided to go to a computer science master's program in machine learning. And now she's working at Microsoft's AI residency program in just a few short years, which is incredible. And the thing that I want to tell people about is directly from that whole path. So she put together a GitHub repository of iPython notebooks, Jupyter notebooks that are basically explorations to understand the core algorithms of machine learning. Yeah. Not I want to create, you know, import scikit-learn and feed this function a few things.
Starting point is 00:20:37 But with no dependencies, how do we build up these algorithms and what does that look like? Cool. So if you're out there and you are doing data science or want to get into data science, she has a bunch of really nice notebooks that you can check out. I'll link to most of them here. And this is built in modern Python. So hooray for that. So anyway, she built this for herself to learn these algorithms as she did this sort of career progression.
Starting point is 00:21:03 And maybe, you know, throwing it out there is going to help a lot of people. It already has like 2,500 GitHub stars. So I guess it will be. Plus it has a perceptron. I don't even know what a perceptron is, but that's a really cool word. I know. It's like a psychic power used by the machine learning algorithm. No, I have no idea what it is either, but it sounds awesome. I'm sure there's data science people rolling their eyes at us for not knowing this stuff. I'm sure. Yeah, I was gonna make a good joke about another algorithm to follow up on that, but I just failed. So we're just gonna leave it there. But yeah, so check out Annalena's work if you're getting into data science. That's pretty cool. Well, that's it for our main items, Brian. What else you got for us? Any little extra things you want
Starting point is 00:21:39 to throw out? Just somebody mentioned to me the other day that AWS Lambda now supports Python 3.7, which is awesome. Yeah, you can use data classes. Yeah. It's cool. And it wasn't like it upgraded from 3.6, I think. I think it was something before that. They were like, well, when is 3.6 coming? And they just said, you know, skip that, 3.7. Oh, they don't have 3.6? Well, they might now. I think that they were saying they were waiting for 3.6, and then actually 3.7 came out. I could be wrong about that, but I feel like this was a big jump in the 3 world. Yeah, I was so happy with 3.6, but now the 3.7 is here. I'm like, yeah, I'll just use 3.7.
Starting point is 00:22:11 Yeah, that's awesome. How about you? Got anything else? Remember you asked me what Shaboken meant from last time? Yeah. It has a super deep meaning. Actually, no, it doesn't mean anything. It's just a random name.
Starting point is 00:22:22 I wonder if it was, what was that, Hack Your Name? They could have probably just named it for Hack Your Name, right? Yeah. So right now I get Stillis for Hack Your Name. That's pretty much as good as Shibokin. But Shibokin, I actually linked to the blog post that says there's no name. But it's still a pretty cool C++ interop thing. Also, people out there listening, if you want to nominate somebody to become a PSF fellow, Python Software Foundation fellow, this is a group of folks who every quarter, five people are nominated and put on the roster as having done something awesome for the Python community in general.
Starting point is 00:22:57 So I'm linking to the place where you can read what this is about and then nominate somebody. So if someone out there is doing something cool, nominate them. That way you have a chance of being, being in this group. Are you a fellow? I am actually very surprising. I didn't even know about Python software foundation fellows and somebody
Starting point is 00:23:15 nominated me and they said, Hey, you got the award. I said, wait, what? So yeah, whoever nominated me,
Starting point is 00:23:20 thank you so much. That was awesome. I am. Yes. Yeah, that's cool. So it would be waste if somebody were to nominate you again. Yeah, the link I actually sent is a Twitter thing that says, please don't nominate me.
Starting point is 00:23:29 Here's how to nominate somebody. Oh, okay. Yeah, yeah. But that's pretty awesome. All right. So anyway, I'm sure that would really make somebody's week if they got that. And they probably don't even expect it. Yeah, nice.
Starting point is 00:23:42 Cool. All right. Well, that's it for this week, Brian. All right, well, we'll talk to you next week. Yeah, you bet. Go forth and turkey. Thank you for listening to Python Bytes. Follow the show on Twitter via at Python Bytes.
Starting point is 00:23:52 That's Python Bytes as in B-Y-T-E-S. And get the full show notes at PythonBytes.fm. If you have a news item you want featured, just visit PythonBytes.fm and send it our way. We're always on the lookout for sharing something cool. On behalf of myself and Brian Ocken, this is Michael Kennedy. Thank you for listening and sharing this podcast with your friends and colleagues.

There aren't comments yet for this episode. Click on any sentence in the transcript to leave a comment.