Placeholder Image

字幕列表 影片播放

  • what's going on?

  • Everybody.

  • And welcome to part nine of our unconventional neural network.

  • Siri's in this part, we're gonna be wrapping up the deep dream and creating a video from the frames of our deep dream.

  • So what we can see here is that we've got about 127 frames and exemplified here is what I was talking about, where it slowly gets darker and darker.

  • Generally, you know, you could just probably add three here or four, and we probably could have combat that.

  • But anyway, I was just trying to show a really quick example, so I didn't really bother worrying about it too much.

  • But that's a least exemplifies what I was talking about.

  • So now we're gonna do is write some code to convert these frames to video.

  • So I'm gonna go ahead and just do new file.

  • Uh, I don't know.

  • Dream underscore Video that pie?

  • Yes.

  • And let's open in sublime.

  • And I'm just gonna move this.

  • Someone let me know how I can clear, Like, how do I get rid of this open?

  • I know there's, like, a way to like, change may be to the Khan.

  • I'll see hide panel A There it is.

  • Nice.

  • All right.

  • Um, so we're gonna do is I'm gonna use CV to just because we've already been using it, I'm gonna import O s.

  • And now we're going to specify the name of the dream.

  • At least in my case, that starry night, the starry night, that is and then dream, um, dream path will put as and in fact, I'm not even sure we need, I guess we'll look into you.

  • Probably actually need to define a dream path, but whatever.

  • So it'd be dream.

  • And then we'll use some string formatting and then format, uh, dream name.

  • So now this will be for the Kodak part.

  • Um, it depends on if your own windows or Linux.

  • So if you're on Windows Ah, the Kodak that you would use here will be four cc equals c v two dot uh, video writer underscore er four cc.

  • And then it's asterisk ex vid.

  • And if you were on Lenox, it would be rather than this.

  • It's m j p g.

  • Right, But all in separate quotes.

  • Not really sure.

  • Here, um, J p.

  • G if you were on Lennox, which I'm not right now.

  • So, boom.

  • Now, the next thing that we're gonna do is we're gonna specify where do we want this stuff to go?

  • Okay.

  • Here you go.

  • Shut up.

  • Uh, making the lint, er, happy out.

  • Equal CV to dot video writer.

  • And then we'll just say something dot e v i dot format, whatever the dream name is.

  • Ah, we're gonna use the four cc, whatever that happens to be, then you're gonna specify how many frames per second you want.

  • I'm gonna go with, like, 20 because we have so few.

  • But the more obviously you have, the smoother it is.

  • It also depends on what?

  • How quickly you're resuming in and how big your overall images.

  • So on, like a 10 80 p image.

  • Um, at the rate that we're zooming in, you could easily do 60 frames a second for, like, super smooth.

  • Ah, but it really just depends if you did what we just did here At 60 frames a second, it's like a rook.

  • It's a pretty quick zoom, Uh, and then finally the size ours is 800 by 4 50 It has to match the input.

  • If it doesn't match the inputs.

  • Gonna get angry with you.

  • Um okay, so this will produce the 20 frames per 2nd 800 by 4 50 video.

  • Now, for I in range of basically however many you have, I'll just throw in a some sort of number here.

  • Um, if o estado path dot is file, Um, basically, what we're gonna do is because we need it, But we need to know what the length of our dream, ms.

  • So I guess we're kind of Let's see if we could just take this code.

  • So I think that's basically what we're doing.

  • Ah, So it should just be like the exact same logic I'm doing here.

  • I'm sure somebody can come up with some better logic in this.

  • If you do go ahead to share it with us else, we're gonna say dream length equals whatever that I is, and then we'll break.

  • All we're trying to figure out is how how long that dream is.

  • That's it.

  • Um do we solve in here?

  • No.

  • So at this point now, what we want to dio is four I in range of whatever that dream length is, we're gonna build the frames of our CV to write video writer so there's a image path equals us.

  • Stop path thought Julian, and we're gonna join the dream path.

  • And then basically, it's that it was image underscore er, whatever the number is dot j peg on dot format.

  • Whatever I is, so that's the path to the actual image itself.

  • For now, let's go ahead and print the image path just so we know where we are along the way.

  • Uh, then what we're going to go ahead and do is the frame itself is equal to see vi tue dot in reed, whatever that image path is.

  • And then finally we're going out dot right the frame, and then when we're all done out dot releases like closing the file after you've done after you've been done modifying it, let's go and run that, See if we have errors.

  • Looks like it's already done.

  • Let's move this out of the way, should make starry night dot a V.

  • I don't click on that, and sure enough, there is our deep dream going at 20 frames per second and getting dark pretty quickly, okay?

  • And this is the other one, and basically I just have it going one basically, all through all of the different layers at a time.

  • And ah, and then I'll just do the outro.

  • Is that place also probably put this as a standalone video?

  • Uh, I don't really know yet.

  • Not pulling the description if I do, um, otherwise Yeah, so that's it With the deep dreaming If you have any questions, comments, concerns, whatever on deep dreaming Ah, feel free living below.

  • If you've got fixes for the various things that we did and change and all that you could let me know like the stuff like the the ranges through Like I just figure out where we should start from.

  • I'm sure there's a better, more logical way.

  • I just figure like if you're gonna go through like you would you would go through the directories.

  • So, like, no matter what, you're gonna be iterating through a list.

  • So I'm not really sure if there's truly a more efficient way or not.

  • But I'd be curious about some sort of more python IQ way than the way I've done it there.

  • Um Anyway, um, I think that's it in the next and the coming tutorials.

  • What we're going to be focusing on is we're gonna can change gears into doing math with neural networks, which, typically a neural network is generally better at doing like non linear tasks, whereas, um in, like typically, machines and programs are very good at doing linear things like math.

  • But deep learning is not so good at deep at linear things because it's actually looking for nonlinear relationships.

  • Or at least that's what it's good at.

  • So doing something like math, which is highly linear in most cases, eyes not an easy thing for a neural network.

  • Um, but if we could get a neural network to do math, especially maybe even some of the non linear forms of math, um, that could be pretty interesting.

  • So anyways, that's what we'll be doing.

  • The coming tutorials is trying to get neural networks to do math.

  • But if you have any questions on deep dreaming and all that you can feel for you leaving below, otherwise you could stay tuned for the release of this one.

  • Whenever it's finally done, I am on the final layer.

  • This is the final layer, as you can see, is a lot going on there.

  • Um, it's probably gonna take a little longer just to finish all of that, Uh, these air going so slow once you get that deep into the layers, they process super slow.

  • But anyways, um, that's what you guys have to look forward to.

  • If you're enjoying the content you can support at Python pregnant and it's slash support.

  • If you've got questions, comments, concerns, whatever tips about better ways to have written the code, you can leave your comments down below.

  • Otherwise I will see you in the coming tutorials where we right, hopefully a neural network that can sort of understand math and then do things like try to break encryption and all that kind of fun stuff.

  • So that's what you guys have to look forward to.

  • I will see you in another video.

what's going on?

字幕與單字

單字即點即查 點擊單字可以查詢單字解釋

A2 初級

深夢視頻-非常規神經網絡第9頁 (Deep Dream Video- Unconventional Neural Networks p.9)

  • 1 0
    林宜悉 發佈於 2021 年 01 月 14 日
影片單字