r/programming • • Sep 26 '18

From wireframe to HTML Code. A great milestone achieved by AI for the frontend.

1.4k Upvotes

110 comments sorted by

71

u/RickDork Sep 26 '18

When it learns how to center a div vertically is when I’ll be out of a job.

6

u/[deleted] Sep 26 '18

They took err jerbs!

4

u/VIM_GT_EMACS Sep 26 '18

flex and align my dude...

1

u/royrwood Sep 26 '18

Is CSS Grid real yet?

1

u/smegnose Sep 27 '18

How can grid be real if our browsers aren't real?

50

u/vReddit_Player_Bot Sep 26 '18

Links for sharing this v.redd.it video outside of reddit

TypeLink
Custom Playerhttps://vrddit.com/r/programming/comments/9j1alv
Reddit Playerhttps://www.reddit.com/mediaembed/9j1alv
Direct (No Sound)https://v.redd.it/x8g50pcr8ko11/DASH_1_2_M

vReddit_Player_Bot v1.2 | I'm a bot | Feedback | Source | To summon: u/vreddit_player_bot

30

u/Ashok28 Sep 26 '18

Good bot

5

u/B0tRank Sep 26 '18

Thank you, Ashok28, for voting on vReddit_Player_Bot.

This bot wants to find the best and worst bots on Reddit. You can view results here.


Even if I don't reply to your comment, I'm still listening for votes. Check the webpage to see if your vote registered!

32

u/atomheartother Sep 26 '18

Can we get a mirror that's not reddit video, I can't stand that I can't link this to friends without linking the thread.

4

u/st4rmatt Sep 26 '18

Agreed, you can get the video if you check the network tab, but it won't have sound

4

u/[deleted] Sep 26 '18

Good, the music is obnoxious.

28

u/wtph Sep 26 '18

Haha I didn't want my job anyway.

12

u/Texadoro Sep 26 '18

But can it tell the difference between hotdog and no hotdog?

4

u/Suavecito_0 Sep 26 '18

Mother fuck! Jian Yaaaang!

35

u/skreef Sep 26 '18

Thanks for showing off that the boxes in the html page resize when you resize the page, truly a breakthrough in AI.

14

u/orlyfactor Sep 26 '18

AI has already taken my job as a responsive web design dynamic specialist. Damn AI.

6

u/Forbizzle Sep 26 '18

I believe the point was to show the page was well built, and not a head coded mess with manual dimensions.

-17

u/ArmoredPancake Sep 26 '18 edited Sep 26 '18

Not really, it's because of React and bootstrap it resizes as it is.

6

u/KobayashiDragonSlave Sep 26 '18

????

-6

u/ArmoredPancake Sep 26 '18

It generates React component and uses Bootstrap styling, why wouldn't resize?

5

u/StickiStickman Sep 26 '18

Dude, you need neither React nor Bootstrap to do that ...

→ More replies (16)

1

u/danketiquette Sep 26 '18

Not sure why you are getting downvoted bc this is obviously exactly what the fuck is happening.

10

u/theOGcatinthehat Sep 26 '18

So would this work like an advanced dreamweaver software?

7

u/RhodesianHunter Sep 26 '18

That's a name I haven't heard in a long time...

5

u/ArkitekZero Sep 26 '18

Wake me up when they can figure out business logic.

2

u/commandergen Sep 26 '18

Wake me up when the business can figure out the business logic.

13

u/Wolfsdale Sep 26 '18

What is the AI doing in this? The video recognition? Because going from shapes to HTML seems not all that hard to just do rule-based, in fact it might even be easier as the different combinations of possible HTML you can emit is just insane and getting a good training set for that is hard. For shape detection in the video feed some kind of machine learning can be a very good choice tho.

3

u/-Rizhiy- Sep 26 '18

Pretty sure just object recognition on the whiteboard. As you said creating HTML from object position works much better with rules.

3

u/[deleted] Sep 26 '18

But can it write css for me?

15

u/BinaryArcher Sep 26 '18

This has nothing to do with AI. Just object detection.

This might have been useful 15 years ago but nowadays there are many better ways of designing a website.

→ More replies (2)

2

u/lickylicky_69 Sep 26 '18

This soundtrack reminds me of the "big booty prank"

Will watch it after work. Truly a gem

2

u/Dave3of5 Sep 26 '18

Seems like a very inefficient interface to create websites. Interesting but inefficient.

3

u/[deleted] Sep 26 '18

This is awesome

1

u/supember Sep 26 '18

Whose YouTube videos used that music again? Someone always used that song, I think as an outro song, but I can't remember who

1

u/IskaneOnReddit Sep 26 '18

This is impressive if the AI learned how to write code, but I doubt that this is the case.

1

u/mbrodersen Sep 27 '18

This has nothing to do with AI. And it doesn't make you more productive than using a straightforward DSL. 99% of the design work is figuring out what to show and how to show it. Not typing.

1

u/BillNyeCreampieGuy Sep 26 '18

As a designer who’s about to start learning code just so I can be competitive and keep a job.

Fuck.

0

u/[deleted] Sep 26 '18

[deleted]

102

u/allinwonderornot Sep 26 '18

Everything that involves algorithms is now called AI.

Was visual recognition even called AI before the deep learning fad?

53

u/itdoesntmatter13 Sep 26 '18 edited Sep 26 '18

Was visual recognition even called AI before the deep learning fad?

No, it wasn't. But it was really inefficient. Computer vision used to deal with detecting edges and features while hard coding the algorithms. Plus, you had to account for changes in orientation and lighting. And that's not scalable at all. You can't possibly hard code algorithms for every kind of object. For instance, facial recognition used to be down scaling an image, detecting shapes (eyes, nose or mouth) and then calculating the ratio of distances between these features to detect face. And it wasn't very accurate either. This pales in comparison to using state of the art Convolutional Neural Nets which train on gazillions of images to extract those faces automatically and deploy it as an API to classify new images. That is way more accurate, scalable and saves developer time. Deep learning is not a fad. They have better error rates than even humans on a large data set. Just because some companies are calling a bunch of if statements as AI doesn't mean that there has been no progress.

6

u/[deleted] Sep 26 '18

I don't think he meant that neural nets are a fad in that they have no use at all. I think he's talking about the way these systems are portraied in the non-tech media as some kind of super intelligence that's just a couple of years away from ruling the world. I have a friend who is broadly interested in science but often does not dive deeper into a topic than reading those news articles, thus he really thought that these systems were sentient and could learn complex tasks without any help from developers (and with as little data as a human would need). Our talk was about the dota 2 ai where he thought that it's as simple as hooking a magic black box program up to the pc, letting it do it's thing for a bit and it's suddenly going to be better than any human player.

And then there is the whole hype where companies with minimal data sets think they should jump on the neural net hypetrain instead of developing a transparent and efficient algorithm, simply because it's such a buzzword currently.

I totally believe that these systems will have a bright future, but I also think news outlets and companies should chill out with all the hype and instead make it clear to the general public where this technology shines and where it just does not. With neural nets becoming more mainstream people need to know how it truly works and where problems can and will arise in order to make sound shopping, voting or other descicions.

6

u/coldnebo Sep 26 '18

“way more accurate” given training data, ie you’ve moved the complexity of custom algorithms to the complexity of representative data. The limitation of AI is that unlike algorithms, you have no idea if the feature identification is actually based on a mouth, or a pixel of a certain color (see the tiger couch. confusion). Large data can help, as long as it’s assisted.

Here’s a better way to think of deep learning: I’m hiring thousands of devs to write algorithms to solve a problem, but I give them no other constraint than a binary fitness function (T|F) — they don’t know it’s a tiger, they only know that for a set of input bits they have to successfully reduce to a binary answer.

Now some of them might “do the right thing” and figure out that it’s image data, that most of them are tigers, etc. (this is the popular conception of AI) but there are other devs who might simply discover a bias in the input data as simple as metadata near a zoo which perfectly predicts the sample training data. There may even be more basic hacks, like noticing color, or time.

For example, one article I read talked about a GA evolving wind turbine designs. The researchers discovered that the GA found an error in the physics solver for the simulation and exploited that error to optimize a design that won, but was in reality very inefficient because it wasn’t based on real physics. (The GA has no concept of “real physics”. )

These kind of hacks will be exposed by more corner cases (like tiger couch) or real world testing, but you might have to slowly increase the sample to find all of these cases. Pretty soon you are spending a lot of time on retraining.

So yes, deep learning is cool, but it’s more like arguing top-down vs bottom up design, both have merits, I don’t think we should oversell AI, and we should always keep our eye on the ball. We have yet to get to AI that can explain its reasoning so we can correct mistakes in reasoning rather than output.

3

u/itdoesntmatter13 Sep 26 '18 edited Sep 26 '18

Complexity of data is something we're already dealing with. Take a look at ImageNet or multi class CIFAR datasets. We've put thousands of human hours (possibly more) into labeling so many images. Curating data is probably amongst the most thankless jobs. There's no sensible reason to not take advantage of that. Those "hacks" are a classic example of over fitting and there's a good chance they won't generalize well. And the way you describe it, they are obvious susceptible to lighting conditions as well. Also, note that your model can use metadata as features too! So, it's possible to take advantage of that. If it can't do a good job dealing with those features, remember that a machine learning model is just another API at the end of the day and you can combine insights from it with additional knowledge or algorithms that you might prefer to hardcode.

There is some research being done in the field of explainable AI. And if you take a look at generative models, they get pretty close to test data (or take a look at deep learning models after they've been trained on MNIST). Hidden layers exist and perform a meaningful job, we're having a hard time inferring what those layers do. But that doesn't mean that it's arbitrary. If you have a well labeled and representative dataset, it can do wonders.

2

u/coldnebo Sep 26 '18

Complexity doesn’t matter if the data is large.

I imagine Q saying: You silly humans are always modeling physics. Why not just create the set of all possible permutations and observe the results experimentally?

I agree it isn’t arbitrary and curated large datasets are very helpful as long as they are accurately curated. Crowd-sourcing simply proves the point at scale. I’m just saying that because we don’t know exactly what is going on we have to be careful in claiming success or human-like understanding.

On the philosophy side of this it raises an epistemological question: how do we identify things and are we that different from AI? After all, humans have a classification error rate as well. It still seems like our classifier works better with access to far less examples, so maybe there is more to be done.

6

u/[deleted] Sep 26 '18

This is actual deep learning:

https://arxiv.org/pdf/1611.07004.pdf

The paper uses a GAN to create images rather than some more traditional heuristics. It’s a pretty neat paper.

Traditional computer vision and modern deep learning are different

2

u/SecretAgentZeroNine Sep 26 '18

Traditional Computer Science algorithms != Machine Learning algorithms

2

u/databacon Sep 26 '18

For decades machine vision has been one of the most popular topics in AI. This thing probably uses neural networks and training examples. Machine learning is more powerful and being used more now thanks to advances in processing (CPUs and GPUs for example). I wouldn't call that a fad. I don't know of any serious company that refers to algorithms in general as "AI", but anyone who does is mistaken or dishonest.

2

u/Treyzania Sep 26 '18

Everything that involves algorithms

inb4 quicksort AI

4

u/richard248 Sep 26 '18

inb4 quicksort AI

Resilient Computing with Reinforcement Learning on a Dynamical System: Case Study in Sorting (https://arxiv.org/abs/1809.09261)

Extract from abstract:

Evaluations show that our RL sorting agent makes steady progress to an asymptotically stable goal, is resilient to faulty components, and performs less array manipulations than traditional Quicksort and Bubble sort.

Published yesterday, so not quite inb4

1

u/[deleted] Sep 26 '18

Image processing/Visual Recognition and AI share a lot of algorithms and topics. I got bored in entry level AI lectures and didnt attend them, because i already knew major parts due to image recognition.

0

u/[deleted] Sep 26 '18

[deleted]

2

u/allinwonderornot Sep 26 '18

Neural nets, and genetic algorithm. They were the "in" thing when I was in college. But I didn't recall them being called AI.

8

u/[deleted] Sep 26 '18 edited Nov 26 '18

...

6

u/ihumanable Sep 26 '18

Think of the opportunity though, no source control exists for whiteboards yet, you could make “git for whiteboard”

2

u/[deleted] Sep 26 '18

I personally think it would be fabulous if AI could build UI for open source projects since there's such a deficit of decent designers in that realm

2

u/Actually_Saradomin Sep 26 '18

Dude, this is clearly not a solution designed to replace front end devs. It’s just for fun. Reddit is so out of touch sometimes

0

u/[deleted] Sep 26 '18

[deleted]

1

u/mehdotdotdotdot Sep 26 '18

I would love this tech, considering we coudl have off the UI/frontend stuff to another team, we could just use these built wireframes for integration and testing just to get a feel of how the app should work and look. Much better than getting photos from someones phone..... MUCH better

1

u/27thStreet Sep 26 '18

Do you suppose those leaps have traditionally come at the flip of a switch? Do you believe that the atomic or industrial ages just started one fine day and didn't have dozens or thousands of small things that led up to those shifts?

edit: Be happy, there are already smart whiteboards that will capture your content to editable files.

1

u/deprecatedcoder Sep 26 '18

There's a large gap between functional prototype and being widely adopted and 2 years is a short time.

The fact this is as capable as it is with live dynamic video and not static PNGs is already a significant achievement.

Dismissing this as Facebook clickbait just shows you have no foresight. Besides, fantastical contrived "clickbait" videos are often the source of inspiration for those who come later when more of the necessary pieces are in place and the tech can become more accessible.

Why be so cynical?

Btw, your site is down...

7

u/[deleted] Sep 26 '18

Going from PNG to video isn't what's relevant. It's the markup generation, regardless of source, and that still seems pretty basic.

4

u/daredevilk Sep 26 '18

If this is built the way I think it is then going from a single picture to a webcam input isn't as difficult as it might seem. Few lines of code, max

2

u/curious_s Sep 26 '18

The problem with computer generated code is that the functionality is limited, and the code created is pretty much unreadable by a human. Eventually, a human developer is going to have to refine the code and it will take forever to make simple changes, plus drive said developer insane.

0

u/[deleted] Sep 26 '18

[deleted]

3

u/MrKorekuta Sep 26 '18

You tell it very good. People no understand much. They go so crazy.

2

u/aguycalledmax Sep 26 '18

Okay so aside from the title merely mentioning AI, which it probably does implement in some way or another for the image recognition, this is still a really cool bit of tech. I don't think anybody is thinking this will make web developers obsolete even in the next 5-10 years. But this to me is a really cool bit of demo tech showing some of the capabilities of image recognition technology.

I feel like developers consider themselves champions of the future but then immediately try to shit on things like this from a height because its not production level quality. Appreciate it for what it is.

-4

u/deprecatedcoder Sep 26 '18

Just because idiots overestimate the capability doesn't mean you should underestimate it. All tech progresses iteratively. This is a perfectly valid iteration. No one is saying this is replacing anyone TODAY, but it certainly will SOMEDAY.

Just ask my cashier at Target... oh wait... they were a robot.

4

u/Styx_ Sep 26 '18

I don't know why you're getting downvoted so hard mate (except for perhaps, your slightly harsh tone) but I completely agree with you -- this is a badass achievement and I wish /r/programming would focus more on how FUCKING COOL THIS SHIT IS, rather than devolving into a circlejerk for the millionth time about how something doesn't qualify as "Real AI." It's a shame that programming attracts so many pedants, it really tends to stifle discussion all too often.

2

u/deprecatedcoder Sep 26 '18

Thanks. It's why I never frequent here. Building cool shit is a better use of time than arguing what isn't anyway.

1

u/Styx_ Sep 26 '18

Amen to that!

2

u/romple Sep 26 '18

His point is none of that is really artificial intelligence. Using some basic linear algebra methods (linear regression) to find the optimal setting for two variables or having a kiosk POS is in no way artificial intelligence. But that's how it's presented.

0

u/[deleted] Sep 26 '18

[deleted]

-5

u/deprecatedcoder Sep 26 '18

Username checks out...

1

u/[deleted] Sep 26 '18

Still cool af

-6

u/[deleted] Sep 26 '18

If that looks basic, then please implement it by hand and report back.

"All this does is recognize cats in images? Pretty basic."

3

u/daredevilk Sep 26 '18

It actually is, video recognition to this level is as simple as a few lines of code in say, python. As a pet project I wrote a facial recognition program last week at work.

OpenCV makes this stuff a breeze

2

u/teerre Sep 26 '18

Don't you think it's misspoken to call "a couple line of codes" when you of those lines is importing thousand lines library?

1

u/daredevilk Sep 27 '18

No I don't think it is, because that's not work that the individual user has to do.

The individual user just has to write a few lines of code

1

u/[deleted] Sep 26 '18

If your level is 'from tensorflow import cnn' then I understand why you think the concept is basic and simple.

1

u/daredevilk Sep 27 '18

I specifically said OpenCV. Tensorflow is overkill for this simple stuff

1

u/[deleted] Sep 27 '18

And I specifically said 'if that's your level'.

0

u/[deleted] Sep 26 '18

[deleted]

2

u/[deleted] Sep 26 '18

Exactly. The video basically shows a proof of concept, give it a few years. But the technology behind is certainly not simple or basic.

1

u/daredevilk Sep 27 '18

Sure, but I doubt the OP in this rewrote OpenCV or recreated facial recognition rather than using a library

0

u/[deleted] Sep 26 '18

[deleted]

8

u/carbolymer Sep 26 '18

Has science gone too far?

5

u/orlyfactor Sep 26 '18

These AI scientists were so preoccupied with whether or not they could, they didn’t stop to think if they should.

2

u/TheGreatBugFucker Sep 26 '18

Soon it will be able to replace at least all the truly silly comments on reddit, giving redidtors who used to write them the time to make better ones. Truly a breakthrough in the making.

0

u/[deleted] Sep 26 '18

[deleted]

1

u/BillNyeCreampieGuy Sep 26 '18

It’s a tool to make life easier and more efficient, ya dingus.