Skip to content

Commit 819ea89

Browse files
authored
Update README.md
1 parent 729f9ec commit 819ea89

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

README.md

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Doodle2code
22

3-
* Turning doodle into DSL file *
3+
*Turning doodle into DSL file*
44

55
![Preview](https://github.com/sketch2code-mit/doodle2code/blob/master/results.jpeg)
66

@@ -11,4 +11,20 @@
1111
- pip
1212

1313

14+
## Data Generating
15+
![Preview](https://github.com/sketch2code-mit/doodle2code/blob/master/dataset.png)
16+
17+
### DSL generation
18+
We generated DSL codes via three steps.
19+
First, we defined the tokens and mappped them to the corresponding HTML. We also modified the previous DSL tokens written by pix2code in order to fit the recent version of Bootstrap. Second, we defined six types of grid using single, double, and quadruple blocks. Finally, we loop through each case of grid types and randomly generate contents to be placed inside each block with [the source code](https://github.com/sketch2code-mit/data-generation).
20+
21+
### Sketch synthesis
22+
Then we compiled the generated DSL codes into HTML, styled the compiled HTML codes so that they look more like sketches, and then took screenshots of the HTML pages using a [python library](https://github.com/SeleniumHQ). Alternatively, we tried pre-processing the screenshots with OpenCV and PIL library to detect the contour and acquire synthetic sketches \cite{robinson2019sketch2code, zita2020sketch2code}. The codes used for taking screenshots are at [HTML-Screenshot](https://github.com/sketch2code-mit/html-to-image). As a result, we gained 2,160 pairs of sketches and the corresponding DSL codes in addition to the existing 1,743 pairs in the pix2code dataset.
23+
24+
25+
## Network Architecture
26+
![Preview](https://github.com/sketch2code-mit/doodle2code/blob/master/architecture.jpeg)
27+
28+
Our method uses a Pytorch version of Tony Beltramelli’s [Pix2Code](https://github.com/tonybeltramelli/pix2code) network, [implemented by Vaibhav Yadav](https://github.com/VaibhavYadav/pytorch\_pix2code). We changed the code to train it on a dataset of screenshots of HTMLs that were adjusted with CSS to look like sketches. We also train the model on our own dataset of automatically generated HTML files where we increase the number of tokens.
29+
1430

0 commit comments

Comments
 (0)