No video

Seam Carving | Week 2, lecture 7 | 18.S191 MIT Fall 2020

  Рет қаралды 103,776

The Julia Programming Language

The Julia Programming Language

Күн бұрын

Пікірлер: 152
@SinnohStarly
@SinnohStarly 4 жыл бұрын
this is the best thing that has happened during the pandemic. I teach seam carving as a PhD student, but now I feel useless :D
@SubhadityaMukherjee
@SubhadityaMukherjee 4 жыл бұрын
agreed 100%
@jake_runs_the_world
@jake_runs_the_world 4 жыл бұрын
@@SubhadityaMukherjee ok baman
@JohnWick-xd5zu
@JohnWick-xd5zu 4 жыл бұрын
Go bears!
@SinnohStarly
@SinnohStarly 4 жыл бұрын
@@JohnWick-xd5zu who :o
@JohnWick-xd5zu
@JohnWick-xd5zu 4 жыл бұрын
@@SinnohStarly lol your were my TA at Cal
@ProjectPhysX
@ProjectPhysX 4 жыл бұрын
Combine a few simple algorithms - in this case edge detection and minimum energy path search - and what you get is pure black magic. That is why I love computer science!
@henrmota
@henrmota 3 жыл бұрын
Computer Science gives you the power to experiment at a low cost.
@ProjectPhysX
@ProjectPhysX 3 жыл бұрын
@@henrmota I know!! That's why I'm doing it for a living :)
@yash1152
@yash1152 2 жыл бұрын
@Arid Sohan yeah, exactly what i was thinking
@ancbi
@ancbi 4 жыл бұрын
"It picks up on the edginess of Mario" --- Grant Sanderson 2020
@kindoblue
@kindoblue 4 жыл бұрын
People waste time on Netflix when you have Grant around. Crazy.
@bessimaestro
@bessimaestro 4 жыл бұрын
We need a petition to bring Grant to Netflix! Make Algebra Great Again!
@AndreasIndustriePro
@AndreasIndustriePro 4 жыл бұрын
its crazy i had to go to bed half an hour ago
@JudahDaniels
@JudahDaniels 4 жыл бұрын
MIT are lucky to have you!
@NEMountainG
@NEMountainG 4 жыл бұрын
I have my own classes, but I’m watching this series as well for Grant.
@nonhonome4080
@nonhonome4080 4 жыл бұрын
If you can, please do more of these computer science applied math on the main channel. They are really interesting, and way easier to remember thanks to your way of explaining. Also seeing your face while explaining, like you do here, I think it's better then just having the graphics full screen
@barrycavin
@barrycavin 4 жыл бұрын
How can he be very good at storytelling this kind of complicated and multilayered concepts/techniques. A genius.
@AV-br3bm
@AV-br3bm 4 жыл бұрын
Grant's lectures are always pure gold. We need to keep the activities in the comments so the KZfaq algorithms bless this video. It will help spread knowledge and will definitely make the world a better place.
@zinxys
@zinxys Жыл бұрын
i love the dynamic programming example.. changin from exponential order to multiplication just by reversing the way we do computation.. that is absolutely awesome..
@birdbrid9391
@birdbrid9391 4 жыл бұрын
in this episode grant teaches us how to optimally get over your ex
@sprechchor
@sprechchor 3 жыл бұрын
This is Stalin's wet dream algorithm
@oghry
@oghry 4 жыл бұрын
This is the best explanation of magic of content aware shrinking. Thank you! Спасибо!
@SergioRMuniz
@SergioRMuniz 4 жыл бұрын
Great presentation, Grant! So clear and concise, despite the depth. Makes it look easy and natural. Really good!
@usama57926
@usama57926 2 жыл бұрын
Grant you're great
@MrNightLifeLover
@MrNightLifeLover 3 жыл бұрын
Wow I've never seen anyone to explain dynamic programming simpler!
@abhchow
@abhchow 4 жыл бұрын
Isn't the idea of using a seam at every step itself a greedy algorithm? Just based on my intuition, it should be possible to carve a seam that makes other future seams significantly less optimal, perhaps by cutting half of a seam that could be a future option. Of course, the greedy algorithm seems to work well enough, but perhaps there's a DP approach that could let us choose better seams by looking into potential future seams.
@shivamjalotra7919
@shivamjalotra7919 4 жыл бұрын
I don't think you can decide the behaviour of some (optimal) seam afterwards if you take the optimal one this time in linear complexity. So being greedy and taking the best I can get at some time (T) is the best option.;
@jjalag
@jjalag 4 жыл бұрын
I was thinking the same as you. Maybe the best approach for this would be to know from the first how many paths you will want to shrink at total
@harshmudhar96
@harshmudhar96 3 жыл бұрын
Could always go bottom to top.
@Clashtoons
@Clashtoons 3 жыл бұрын
That was so cool.
@VicenteSchmitt
@VicenteSchmitt 4 жыл бұрын
This is just amazing! Grant not only knows a lot but explains in a way that makes it very simple
@christophercrawford2883
@christophercrawford2883 11 ай бұрын
Nice video. Here's an alternative justification of three rows in the Sobel filter. 1) taking a derivation requires at least two points per output, so the dimension of the convolution will be one less. 2) if you want a gradient matrix, each slice (partial derivative) should be the same size so you need to average neigboring pixels in every other dimension. 3) if you average the derivativesto reduce noise, you should also average the (averaged) dimensions for the same reasons above. This gives you the vertical weights of [1; 2; 1].
@weinsim3856
@weinsim3856 4 жыл бұрын
I live in germany and im only in 10th grade but i still really enjoy watching these videos
@adityachk2002
@adityachk2002 4 жыл бұрын
This must be grants lowest views but thanks a lot for putting such content and making it accessible
@John_Chakder
@John_Chakder 4 жыл бұрын
Everything about this video is great
@ManthaarJanyaro
@ManthaarJanyaro 4 жыл бұрын
That's why I love algorithms, they are made by most genuine persons.
@kevinmathervideo
@kevinmathervideo Жыл бұрын
Brilliant explanation of a brilliant concept 😮
@maxmetpt
@maxmetpt 3 жыл бұрын
This is awesome, thanks. Especially the bit at the end - great potential for mischief!
@user-zh2wf7qk9v
@user-zh2wf7qk9v Жыл бұрын
Getting rid of Ex's feature was just hilarious
@sorry4all
@sorry4all 2 жыл бұрын
What a simple clever algorithm. That should be on every photo editting tools
@aakashbakhle1458
@aakashbakhle1458 4 жыл бұрын
Using dynamic programming to make lockscreen wallpapers would also be an apt title. I loved the teal gradients in starry night ❤️
@truefaceofevil
@truefaceofevil 4 жыл бұрын
These lectures are amazing. Thank you
@ancbi
@ancbi 4 жыл бұрын
I wish I teach as well as Grant. Right now I'm blaming it on my lack of time to prepare as I teach online as a side job. But really, even if I have more time, the bar he sets is pretty high.
@ShreyasRavibighero6
@ShreyasRavibighero6 4 жыл бұрын
This guy sounds really similar to the talking pi at 3blue1brown
@unchaynd7266
@unchaynd7266 Жыл бұрын
Just had a crazy idea!! What if you could use this same concept to slow down a music file without distorting it?? That is a puzzle that I don't think we've solved yet!
@rineeshparai1780
@rineeshparai1780 3 жыл бұрын
Grant is a teaching genius.
@mr2octavio
@mr2octavio 4 жыл бұрын
Instead of wasting my time watching a netflix show, I enjoyed learning about a fun way to make use of a triangle
@shivamjalotra7919
@shivamjalotra7919 4 жыл бұрын
Not yet.
@enisten
@enisten 4 жыл бұрын
So, is this a good summary of what we are doing? 1. Convolve the image with a sobel kernel (vertical or horizontal), which contains some negative values 2. The resulting RGB object may have negative values in red, green, and/or blue channels 3. Take the L1 norm of each pixel (adding the absolute values of three color components), obtaining a non-negative number, possibly greater than 1 4. Repeat the same procedure with the other sobel kernel (horizontal or vertical) 5. Take the L2 norm of the two sobel results
@enisten
@enisten 4 жыл бұрын
Actually at 5:15, he seems to first convert the image into grayscale using a function called "brightness" _and then_ apply the sobel filter. So, the sobel filter was never applied to an RGB object. The result may still be negative at some pixels, but they go away when you take the L2 norm of the two sobel filter results. This seems to be a neater approach.
@TheJuliaLanguage
@TheJuliaLanguage 4 жыл бұрын
@@enisten that's right, brightness is actually mean of the images -- we use mean instead of sum to keep it between 0 and 1 so that we can simply call Gray.(means) to show it as an image. The scaling does not matter for the algorithm, and of course you can choose a different brightness function if you wanted to.
@nxone9903
@nxone9903 2 жыл бұрын
Fascinating
@oghry
@oghry 4 жыл бұрын
There is also a cool looking glitch effect when you just remove N pixels with minimal entropy in each row without connection them in path
@64_bit80
@64_bit80 2 жыл бұрын
i was like "hold on this guy sounds familiar" and then it clicked
@ShivaramakrishnaReddy
@ShivaramakrishnaReddy 4 жыл бұрын
Why do we need to go only bottom to top? How does the algorithm care if we go from top to bottom in cumulative addition? Also, what if we want to reduce the image so as to keep the aspect ratio constant? Shouldn't we have two cumulative addition images one for top to bottom and another for left to right? If it's a 16:9 image, do we need to cut out top-bottom 16 times and then left-right 9 times and repeat?
@alert.272
@alert.272 3 жыл бұрын
Look at that fresh cut. Damn Grant.
@LeiosLabs
@LeiosLabs 4 жыл бұрын
"The great and one and only" Uh oh
@shzaizzhang4465
@shzaizzhang4465 4 жыл бұрын
Wow , pretty like the exercises on Dynamic Programming in Introducton To Algorithms...
@amaurylerouxdupeyron4523
@amaurylerouxdupeyron4523 Жыл бұрын
So good 🎉
@TheBBmTV
@TheBBmTV 4 жыл бұрын
This is such incredibly good content, if the universities don't pick up their slack soon, youtube will just demolish them.
@TheMikebo
@TheMikebo 4 жыл бұрын
You are aware that this is content from a university lecture at MIT?
@TheBBmTV
@TheBBmTV 3 жыл бұрын
@@TheMikebo In that case: Exceptional job MIT.
@rpavlik1
@rpavlik1 4 жыл бұрын
Wow, this is great explanation of these algorithms, really awesome. Also, you managed to utter "picks up on the edginess of Mario", which wins the internet today.
@doodikun318
@doodikun318 3 жыл бұрын
thank you
@piyushsingh178
@piyushsingh178 4 жыл бұрын
At 22:48 why are we adding j==1 to dir while saving min item indices
@TheJuliaLanguage
@TheJuliaLanguage 4 жыл бұрын
That's a great question. Very observant. It's because when j==1, your slice of the least_E array, i.e. least_E[j1:j2], does not have the south-west element, it only has two elements.. This needs a special case to handle -- if findmin says 1, the direction is actually 0 (go down), if it says 2, then the direction is 1 (go south-east).
@PhilBoswell
@PhilBoswell 4 жыл бұрын
@@TheJuliaLanguage so is the other special case, the other end of the row when there isn't a *south-east* element, handled automagically somehow?
@piyushsingh178
@piyushsingh178 4 жыл бұрын
​@@PhilBoswell You're right that on the right side of the row, the array whose min we need again has only two elements. However (-1,0,1)[idx] will work fine because it can return either -1 or 0 , it'll never return 1. Similarly in the left side also the array has only two elements, but its problematic because -1 is invalid this time. Hence we need to handle left end specially by adding 1. That's what j==1 does (julia weirdly uses 1-indexed arrays instead of 0-indexed hence j==1 and not j==0) Thanks Grant!!
@w1d3r75
@w1d3r75 4 жыл бұрын
Awesome
@joaopedrorocha5693
@joaopedrorocha5693 4 жыл бұрын
Talking in terms of energy it looks like a thunderbolt going down through the path of least energy :D It could be called the thunderbolt algorithm.
@LOogt
@LOogt 4 жыл бұрын
This is awesome. Thank you!
@ganeshkharad
@ganeshkharad 4 жыл бұрын
just awesome explanation...!!!
@eldattackkrossa9886
@eldattackkrossa9886 4 жыл бұрын
go grant go!
@dadireddysukumar2388
@dadireddysukumar2388 Жыл бұрын
Does solving the sub problems from top to bottom rather than from bottom top,would it give the same shortest energy path?
@ukaszszczyt4912
@ukaszszczyt4912 4 жыл бұрын
Thank you
@Pier_Py
@Pier_Py 3 жыл бұрын
i translated your code in Python! it is great!!
@guiwenluo1774
@guiwenluo1774 4 жыл бұрын
wonderful lecture!!
@drakoumell
@drakoumell 6 ай бұрын
15:00 but dijkstra is faster, no?
@krisschobert4484
@krisschobert4484 4 жыл бұрын
THIS IS SO DOPE!!!!!! thanks grant! cool hair too!
@danieladelodun9547
@danieladelodun9547 4 жыл бұрын
Edgy Mario looks like he's going through an emo phase.
@1e1001
@1e1001 4 жыл бұрын
yea thats why he's edgy
@arikfriedman4442
@arikfriedman4442 3 жыл бұрын
does anyone know where can I find the "original paper" he is referring to at 02:50?
@adityarjl6557
@adityarjl6557 2 жыл бұрын
billions of people are busy watching despacito and only handful of thousand people are watching this interesting video. explains why the world is stupid.
@imranq9241
@imranq9241 4 жыл бұрын
Has there been any study of seam carving with horizontal directions instead of just downward?
@SayanSamanta123
@SayanSamanta123 4 жыл бұрын
Can you parallel this with the concept of value functions from reinforcement learning/marcov decision processes?
@gz6616
@gz6616 2 жыл бұрын
I got a question: do you re-compute energies after each seam removal?
@soejrd24978
@soejrd24978 3 жыл бұрын
Didn't know it was you Grant :)
@markcase9534
@markcase9534 Жыл бұрын
Gold mine
@cicigg2045
@cicigg2045 4 жыл бұрын
Grant so handsome, lecture so amazing, using my whole attention to learn this material! Thanks~
@fburton8
@fburton8 4 жыл бұрын
Quality!
@skanda2186
@skanda2186 2 жыл бұрын
No link to the notebook ?
@ohno5559
@ohno5559 4 жыл бұрын
After removing a seam, is it best to recalculate the energy values or to continue using the original ones?
@0xDEAD_Inside
@0xDEAD_Inside 3 жыл бұрын
Recalculation is the best.
@lucha6262
@lucha6262 4 жыл бұрын
Where can I get started learning Julia?
@theadamabrams
@theadamabrams 4 жыл бұрын
Great video! Quick question: your seams go top-to-bottom (for horizontal resizing), so why use √(vx²+vy²) instead of just |vx|, that is, only convolving with sx?
@deinauge7894
@deinauge7894 4 жыл бұрын
that would lead to shrinking of the objects, for example the horizontal tree branch or other horizontal lines. what concerns me about this energy function is, that is renders single pixels and one pixel wide lines as completely unimportant, even if they have the biggest contrast to their surroundings. the energy of the neighboring pixels would be considered very high though ^^
@Dhanush-zj7mf
@Dhanush-zj7mf 4 жыл бұрын
Which programming did Grant used there not looks like python but almost similar to it.
@brandonbahret5632
@brandonbahret5632 4 жыл бұрын
This course uses the Julia programming language.
@keshavkasat9465
@keshavkasat9465 4 жыл бұрын
lol..read the name of the channel. I've heard this language is great for programming mathematical models.
4 жыл бұрын
Oh I missed the live class!
@shivamjalotra7919
@shivamjalotra7919 3 жыл бұрын
12:56
@mirellahi5187
@mirellahi5187 4 жыл бұрын
or a toilet brush to clean all of that yest thats been accumulating for years in the khukhus
@ahmadmoussa3771
@ahmadmoussa3771 4 жыл бұрын
Why hasn't this been used more as a preprocessing step for deep learning models?
@shivamjalotra7919
@shivamjalotra7919 4 жыл бұрын
I think the idea of preprocessing in DL models is to provide just enough knowledge to make the model generalise and not overfit. Here almost all the knowledge remains intact, so using it for preprocessing would not be beneficial.
@ahmadmoussa3771
@ahmadmoussa3771 4 жыл бұрын
@@shivamjalotra7919 I understand what you mean. I could see it useful for models that take as input images of a fixed resolution. Resizing images to fit this resolution can be detrimental sometimes, I would rather use this algorithm for that purpose. But I understand your point of view and I agree, I would use this step for pre-processing to make all the images the same size, but then still add rotation and translation pre-processing
@obi-wankenobi2591
@obi-wankenobi2591 4 жыл бұрын
This feature is alredy implemented in photoshop works both ways
@neve177
@neve177 2 жыл бұрын
It's the meme algorithm
@johnwaczak8028
@johnwaczak8028 4 жыл бұрын
Anyone catch the title of the seam-carving paper?
@franksonjohnson
@franksonjohnson 4 жыл бұрын
Found it: "Seam Carving for Content-Aware Image Resizing". graphics.cs.cmu.edu/courses/15-463/2012_fall/hw/proj3-seamcarving/imret.pdf
@andregn4483
@andregn4483 4 жыл бұрын
I wonder what the results would be if you used some Machine Learning attention activation (like a GAM) instead of a simple edge detection. Maybe it could "understand" the important regions and perform better.
@microhoarray
@microhoarray 4 жыл бұрын
Is this a some kind of magic?🤏
@voxhominem
@voxhominem 4 жыл бұрын
what programming language is he using?
@henrmota
@henrmota 3 жыл бұрын
Just one question. After eliminating one steam? We have to recalculate everything again? Because of steam pixel overlap.
@estivale8193
@estivale8193 3 жыл бұрын
you can recalculate everything, or you can recalculate only parts that can be affected by the removal of a seam. Seam: X Original value: O for recalculation: Y OOOOOXOOO OOOOOXOOO OOOOXOOOO OOOOXOOOO OOOXOOOOO Then you recalulate these: YYYYYYYY YYYYYYYO OYYYYYOO OOYYYOOO OOOOOOOO bottom row should not be recalculated because it never changes.
@henrmota
@henrmota 3 жыл бұрын
@@estivale8193 Thanks, because I am trying to implement this in the web with the gpu support. But this is a very particular calculation.
@Ganondurk
@Ganondurk 4 жыл бұрын
Content aware scaaaaaalle
@echolee601
@echolee601 4 жыл бұрын
Cool!
@mingshey
@mingshey 3 ай бұрын
26:54 Creepy, he’s still holding the hand of his vanished ex-girl friend!
@DjNarda
@DjNarda 4 жыл бұрын
Is the full course getting uploaded?
@TheJuliaLanguage
@TheJuliaLanguage 4 жыл бұрын
yes it will be. you can bookmark mitmath.github.io/18S191/Fall20/ to keep tabs. Schedule is on the front page
@luanmagioli8108
@luanmagioli8108 3 жыл бұрын
What is the animations software?
@bigmistqke
@bigmistqke 2 жыл бұрын
Manim, 3b1b's custom software
@luanmagioli8108
@luanmagioli8108 2 жыл бұрын
Thanks!!!!! 🤝🏼
@silberlinie
@silberlinie 4 жыл бұрын
Photoshop can do it perfectly well. It’s called content preserving scaling
3 жыл бұрын
Probab photoshop does this way as well
@herohamp2
@herohamp2 3 жыл бұрын
Where do I know his voice from?
@MusicEngineeer
@MusicEngineeer 3 жыл бұрын
3blue1brown
@neoqueto
@neoqueto 4 жыл бұрын
I'm not a programmer but seam duplication with interpolation should also be easily doable?
@turtles-qt3ry
@turtles-qt3ry 4 жыл бұрын
Other profs: 200 views Grant: 1.6k views
@wacesferpit
@wacesferpit 4 жыл бұрын
I mean, isn't this already a thing anyway? Content Aware Scaling
@aniksamiurrahman6365
@aniksamiurrahman6365 4 жыл бұрын
But why did Julia drop OpenCL support?
@justforfun2238
@justforfun2238 4 жыл бұрын
Is he the 3b1b guy?
@Dezomm
@Dezomm 4 жыл бұрын
yes he is!
@noninvasive_rectal_probe8990
@noninvasive_rectal_probe8990 3 жыл бұрын
LOVE GRANT LOVE GRANT LOVE GRANT LOVE GRANT I AM DEEPLY DEPRESSED THAT HE WILL DIE
@williammorris1763
@williammorris1763 2 ай бұрын
You're 3Blue1Brown change my mind.
@PacificBird
@PacificBird 4 жыл бұрын
Is this Loopop lol
@nberggie5784
@nberggie5784 4 жыл бұрын
no squish? lol look at that pomegranate
What is a Discrete Fourier Transform? | Week 14 | MIT 18.S191 Fall 2020 | Grant Sanderson
34:48
The diffusion equation | Week 12 | MIT 18.S191 Fall 2020 | Grant Sanderson
21:30
The Julia Programming Language
Рет қаралды 156 М.
Пройди игру и получи 5 чупа-чупсов (2024)
00:49
Екатерина Ковалева
Рет қаралды 4,1 МЛН
ROLLING DOWN
00:20
Natan por Aí
Рет қаралды 11 МЛН
Чёрная ДЫРА 🕳️ | WICSUR #shorts
00:49
Бискас
Рет қаралды 6 МЛН
My Cheetos🍕PIZZA #cooking #shorts
00:43
BANKII
Рет қаралды 28 МЛН
A* Search: How Your Map Applications Find Shortest Routes
16:17
Tricking AI Image Recognition - Computerphile
12:32
Computerphile
Рет қаралды 119 М.
Structure | Week 3 | 18.S191 MIT Fall 2020
33:21
The Julia Programming Language
Рет қаралды 10 М.
But How DO Fluid Simulations Work?
15:12
Gonkee
Рет қаралды 374 М.
Arrays: Slices and Views | Week 2, lecture 8 | 18.S191 MIT Fall 2020
11:25
The Julia Programming Language
Рет қаралды 9 М.
Using AI to Create the Perfect Keyboard
12:05
adumb
Рет қаралды 1,4 МЛН
Introduction to macros | Week 3 | 18.S191 MIT Fall 2020
8:36
The Julia Programming Language
Рет қаралды 9 М.
Пройди игру и получи 5 чупа-чупсов (2024)
00:49
Екатерина Ковалева
Рет қаралды 4,1 МЛН