noviscl / design2code Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
improve API design of the eval code so users can either provide one single filename, one single directory, or multiple directories for running eval. also need to benchmark eval speed for people's reference.
visual_eval_v3_multi(input_list, debug=False)
right now requires screenshots of the generated webpages as input, which shouldn't be necessary.
Fatal Python error: init_sys_streams: can't initialize sys standard streams
Python runtime state: core initialized
OSError: [Errno 9] Bad file descriptor
Looked through some examples and it seems that the scoring can still be improved, esp. for cases where certain elements are entirely missing from the generation.
Need to check what would be an appropriate license for our test data. Also, are we ok with releasing them as part of the repo directly (e.g., should we somehow avoid them from being part of the future GPT training data)?
@NoviScl
Can we remove something like
@import url("http://fonts.googleapis.com/css?family=Open+Sans");
during preprocessing? I find it can sometimes lead to render failure while taking screenshot:
after taking screenshot from (python3 data_utils/screenshot.py ).
How to input that screenshot to the model and gets generated code?
There are some duplicates right now (e.g., screenshot code is also in the metrics modules; image rescaling code is copied over in the GPT-4V module). Would be nice to refactor the code to avoid these.
Example 11625.png
in gpt4v_visual_revision_prompting
, error below:
Traceback (most recent call last):
File “eval.py”, line 46, in <module>
matched, final_score, multi_score = visual_eval_v3(os.path.join(predictions_dir, filename.replace(“.html”, “.png”)), os.path.join(reference_dir, filename.replace(“.html”, “.png”)))
File “/Users/clsi/Desktop/Pix2Code/Pix2Code/metrics/visual_score.py”, line 963, in visual_eval_v3
blocks1 = get_blocks_ocr_free(gpt_img)
File “/Users/clsi/Desktop/Pix2Code/Pix2Code/metrics/ocr_free_utils.py”, line 229, in get_blocks_ocr_free
different_pixels = find_different_pixels(p_png, p_png_1)
File “/Users/clsi/Desktop/Pix2Code/Pix2Code/metrics/ocr_free_utils.py”, line 74, in find_different_pixels
raise ValueError(“Images are not the same size”)
ValueError: Images are not the same size
The answer is html code, what is the question when train the model?
Bad example (looks like some sort of dating website).
In the Websight dataset, the HTML code contains an image URL. Should the link be replaced?
Add argparse to individual modules like the visual_score or GPT-4V calling so that they can be used in a standalone way.
Add a demo where users give a web link, and we generate webpages with different models and methods and compare all of them side by side.
^
6941.html didn't get a score
Because Playwright is not supported on it.
Right now the final_score
from visual_score
is not within the range [0,1], would be nice to normalize it.
Where is Pix2Code/metrics/visual_score.py
? Did I miss something in the requirements.txt?
The closest reference I found was https://github.com/tonybeltramelli/pix2code/tree/master, which doesn't include any metrics.
For low-level metric, are blocks only contains the text elements? Do the size and position of the image elements also need to be added to the block for comparison?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.