Learn ChatGPT Code Interpreter and its AMAZING Uses!
Finally, ChatGPT has released the Code Interpreter plugin to GPT Plus users. What is this? I cannot wait to show you what this thing can do because, for me, it is like a digital Swiss army knife. It can do so many different things and take over the need for so many different pieces of software and websites.
In this video, I’m going to demonstrate some of its brilliant uses and give you some good examples of how you can start using it. But first, let me show you how to activate it. In your account, if you’ve got a Plus account, go to settings, then go to Beta features. You’ll see it right there, Code Interpreter. All you need to do is just switch on the little radio button there to green, like that, and now you’re going to have it in GPT4.
Without further ado, let’s get stuck in and show off this incredible Swiss army knife of a plug-in from ChatGPT.
So let me show you the first cool thing that you can do with Code Interpreter, just as one of the many examples. The first thing you’ll want to do with Code Interpreter, down at the bottom left, is upload a file. It could be a PDF, an image, a video, an MP3, just about any kind of file you want. You work with that file in this chat, and it will then generate Python code to do what it is that you want to do with that particular file.
So I’m going to upload the file, and the first file will be this image here, just this funny image of this girl here. And then I’m going to basically see if I can get it to pull out the dominant colors in that image and give them all to me as a hexadecimal code.
“Can you give me the main colors of the image in a hexadecimal code, together with a swatch of the color next to it?”
And off it goes. Let’s see if it can achieve this for us. Here we are. Sure, we’re going to use an image processing library to find the most dominant colors in the image, and then let’s proceed with identifying the colors. So off it goes. Now, if you’re interested, you can always have a little look and see what it’s up to. So here it is creating the Python code that will do the job for us. And it’s all being contained in this one chat. And then once it’s got those codes, it should then give them to us right there in front of us.
Now, why is this useful? Well, for one thing, if you’re creating a website perhaps and you want it to match with those colors, or you want to get all of the colors out of an image to create some branding, maybe in Canva, then this is going to be just so quick and easy to do. It’s a lot quicker than using a color dropper and then going over each image.
So now it’s giving us all of the hexadecimal codes. So that’s brilliant, the top 10 colors. And now it’s going to create a little swatch for each color so that we can actually see what that code is relating to. And there we go, look at that, absolutely brilliant. It’s given us all of the colors right there. And now it’s doing them all again underneath, individually with the code so we know that that purple is that color. This could be really useful for web designers and anybody who has to deal with colors and images.
Now, like I said, this is a true Swiss army knife of a digital product, and we can do all sorts of things with that image. For example, we can change the size of it. So I’ll give it a prompt like this: “Can you increase the size of the image by 40 percent?”
There we go. So it’ll take the existing image, just increase it in image size. It won’t mess around with the aspect ratio, so you don’t get like a squashed-up image. And we should get exactly the same image back, but bigger. And there we go. It literally took just a few seconds to get the job done. Let’s see if it’s actually done it correctly. There we go. We’ll save it to our desktop. It’s a bigger file size than the original one. And here it is. There we go. Let’s drag it onto the window. There is our increased image size. And the original one was this size here. So it has correctly done it.
Now, of course, you could do that in reverse. You can shrink down an image. You can compress an image’s file size. You can even convert an image from a PNG to a JPEG and back to a PNG if you wanted to. So it is going to be so good for quickly altering images.
So another cool thing we can do is we can create animated GIFs with any image as well. So I’m going to do it with this girl right now: “Can you turn the image into an animated GIF that zooms in?”
And off it goes, getting to work, creating Python code to be able to do that for us. Here it is. Let’s just click on it, and we’ll just get that downloaded. I think we’ll drop it into my browser so that we can see what it looks like. Let’s grab it here and drop it in. Look at that, a perfect animated GIF created by ChatGPT in seconds.
The next cool thing I’m going to do with Code Interpreter is get it to create a slideshow as a video from some selected images I’m going to upload. So first of all, I’ll go down to the bottom left again and then upload. So I’ll grab this file here, which is an image file, a zip file full of images. Once it’s got those images uploaded, which doesn’t take very long, it was only a megabyte, I’m going to give it this prompt: “Can you make me a slideshow from the images provided in this zip file? I’d like the slideshow in the form of an MP4 that I can download.”
And now off it goes to create that. So step one, it’s getting to work, having a look at the images that are provided in the zip file. And it seems that there’s a subfolder named “images” and then there’s this other Mac OS file. It’s a hidden file that goes in there. But it’s already worked out that it only needs to go into the “images” subfolder. There we are, it’s found the five images for us that are in there: JPEG one, two, three, four, and five. For the slideshow, do you have any specific preferences with the duration each image should be displayed, and do you want any transitions between the images?
“I’d like each image shown for three seconds and a simple transition between images, perhaps a fade in and out.”
So now we can see it actually creating the video. If we just click on this part here, there you go, look at all this code that it’s doing right now to create that video. And down at the bottom, we can see the results. Here we are. “I have created the slideshow video. You can download it using the link below.” Let’s do that and see if we can open it up and play it. Here we go. It’s on the desktop. It’s a lot less cluttered on there. And let’s see if we can open it. 26.5 megabytes. Oh, and there it is. So we’ll press play and see if it works.
Okay, so two seconds it said between each. There we go. Oh, look at that, fading in and everything. It’s a beautiful, nice cross-fade with no sort of pixelization or anything horrible like that. It just works.
So this is a really cool use case of the Code Interpreter plug-in. I really like this one. It’s kind of cool if you wanted to just create videos. You can even add text over the top of these images. You can ask it to do that.
Okay, I just thought of another cool use case with images, actually, I have to show you. If we just take this image again, this crazy bright image, we can even apply filters to images as well, in seconds. “Can you turn that photo into a black and white version?”
Let’s see if it can do that for us. Here we go. We don’t need to know how it’s doing it. We just want the end result. “Give me what I need, baby.” Finished. “I’ve converted your photo into black and white. You can download it using the link below.”
Has it done it? Let’s take a look. Oh, there it is. Look at that, one black and white photo in just a few seconds.
So, this Code Interpreter, it just is going to replace so many different bits of software. You just kind of need it open on your desktop at all times just to be able to do useful little tasks like this.
By the way, if you’re a fan of ChatGPT, you need to check out my free group. You can come and join it right now. There’s a link underneath this video. We’ve got over 6,000 members now, all talking about ChatGPT, Bard AI, mid-journey, you name it. It’s all in here. And if you want to know any of the news that’s going on in the world of AI, this is where to find it. People are just putting stuff up within seconds of news coming out. So it’s a great place to come to.
Now, one of Code Interpreter’s best uses is to visualize data and discover more about data. If you’re in business, then you could have a look, for example, at all your transactions in Stripe and start asking simple questions like, you know, how many refunds did we do? What was the best month in sales? Which product sold the most? And so on.
So what I’m going to do with this, though, is I am going to download and use this, which is some movie statistics. And I’m going to start asking some questions about it, and I’m going to get it to come up with some great visuals on that data. And it’s got all of the most popular movies in there and like who was the producer, what was the budget for it, how well did it do, what rating is it on IMDb, and so on.
So here you go, first of all, it’s going to take a look at what columns are actually in that CSV. And then it’s going to get to work on creating some pie charts and all sorts of different variations of charts that we can easily look at and then get a better idea about that data.
And there we are, look at this beast that it has produced here. So I think we can zoom on in. There we are, finished working. So the histogram of movie ratings, and then this is these kind of average movie ratings. Most movies fall into these six to seven category. And then the runtime minutes versus movie rating, that’s an interesting stat. So it’s basically saying how long it is compared to how well it’s received in terms of its rating.
And then just scrolling down, the average ratings by genre, and then you’ve got drama, adventure, and so on. This pie chart here is a bit messed up because I probably wouldn’t have picked that one, but that’s a pie chart of director professions. And there are too many different professions for the pie chart.
Top 10 directors by the number of movies. And then you’ve got Spielberg at the top, Clint Eastwood, Ridley Scott, Woody Allen, and so on. Tim Burton down here as well. And then domestic, where the movie was actually put out in the cinemas, and then worldwide grossing figures.
So really interesting stats to go through there. And all of this was generated just from uploading that one data set of movies. You are literally blowing my mind right now.
And I wonder now if we could export that. And let me just ask it, “I’d like to export all of the charts that you created as a PDF.”
“I have saved all the plots as a PDF file. You can download it now using the following link.”
There we are. Now let’s actually open that up and see. Oh, look at that. It’s put it beautifully for us. So we’ve got all of that data now in a PDF. And we did it in like literally a couple of minutes. It did have a few issues, but it solved them. It’s kind of like AutoGPT in a way. This is when it comes across a problem, it then explains the problem, then tells you what it’s going to do about the problem, then writes some more Python code to solve the problem to give you the result that you want.
So this Code Interpreter plugin is going to change the game for ChatGPT. And if you want to learn more about it, as I say, pop over to our group. We’re going to be discussing the Code Interpreter plugin like mad over there. And it’s free to join as well.
So I hope you enjoyed this video and this look at Code Interpreter. And if you did, press that like button and then subscribe for more videos like it. And I’ll see you in another video very shortly. Thanks for watching. Thank you.