Skip to content
This repository was archived by the owner on Sep 15, 2026. It is now read-only.
This repository was archived by the owner on Sep 15, 2026. It is now read-only.

Question about use custom text as input Parse-Then-Place #46

Open

Description

@ruick

Thank you very much for your work!
May I ask if it is possible to use custom text as input for LayoutPromoter and Parse-Then-Place? It seems that the input must contain ir and elements, and I can only call inputs from the existing test.json file. Is there a way to input custom text directly?

Activity

  1. kaoshizhou commented on Oct 14, 2024

    @kaoshizhou
    Contributor

    Hi rui (@ruick),

    We are pleased to share with you that it's possible to use custom text for Parse-Then-Place. Specifically, there are totally 4 steps that you can follow to accomplish this.

    1. Adapt the eval_split name in the script, maybe something like mydata.
    2. Create a new json file in the folder Parse-Then-Place/data/$dataset/stage2/finetune/mydata.json according to the split name you specified in step 1.
    3. Construct the sample based on your custom text in mydata.json. Below is an example:
    [
        {
          "text": "a page for end user license agreement. on the top, there is a toolbar with a text button for the back on the left and a text in the middle. below is a text button for the end user license agreement. in the middle, there is a text occupying most of the page.",
          "region_id": "",
          "region_type": "",
          "ir": "[region:SingleInfo]",
          "execution": "",
          "layout_seq_with_completion": "",
          "layout_seq_without_completion": "",
          "plain_layout_seq": "",
          "canvas_width": 1440,
          "canvas_height": 2560
        }
    ]
    1. Test on your custom text using the same command in README! And please check your result in the folder tmp/output/$dataset/stage1/mydata_predictions.json.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions