Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

segmentation-based controlled image generation #51

Open
twinkleyang1 opened this issue Oct 10, 2024 · 5 comments
Open

segmentation-based controlled image generation #51

twinkleyang1 opened this issue Oct 10, 2024 · 5 comments

Comments

@twinkleyang1
Copy link

Thank you for your contributions. Could you please tell me how to do segmentation-based controlled image generation

@jiangzeyinzi
Copy link
Collaborator

Please check this #8

@twinkleyang1
Copy link
Author

@jiangzeyinzi Thank you for your answer. I made the modification on the yaml file based on canny, but now I have encountered some problems. My data collection format Source: FILE, Target: FILE, Prompt. Source:FILE indicates the original image; Target:FILE indicates the segmentation image; Prompt: Convert to a segmentation map based on the prompt. But the result is similar to Target:FILE. I want to generate images that are similar to Source:FILE and based on the conditions of Target:FILE

@jiangzeyinzi
Copy link
Collaborator

Based on your description, I'm still a bit confused about which task you would like to execute:

  1. Conditional generation task: Generate an image from a caption + segmentation map.
  2. Editing Task A: Generate an image from a segmentation map + natural language instruction.
  3. Editing Task B: Generate a segmentation map from an image + natural language instruction.

Our framework can handle all of these tasks, but the methods of use differ.

@twinkleyang1
Copy link
Author

@jiangzeyinzi
What I'm going to do is Conditional generation task, Generate an image from prompt+ segmentation map.

  1. The data set format is similar to that of scepter_img2img_hed_example.

  2. Your description is Source:FILE,Target:FILE,Prompt
    images/src_002.jpeg,images/tar_002.png,Convert to an edge map based on the prompt: A Seamless pattern with
    different cupcakes.
    Where your Source:FILE is the source FILE, Target:FILE is the hed edge processing file,。Your goal is to generate a file
    that is similar to the source file based on the hed boundary

  3. My description is Source:FILE,Target:FILE,Prompt
    images/src_R2407(1).png,images/tar_R2407(1).png,Convert to a segmentation map based on the prompt: disk and cup
    segmentation map
    My Source:FILE is a source FILE, and Target:FILE is a segmentation file. My goal is to generate a file similar to the source
    file based on segmentation conditions

@jiangzeyinzi
Copy link
Collaborator

The scepter_img2img_hed_example YAML or data format you are using is supported by another work, stylebooth, for image editing tasks.

In SCEdit, we extract image conditions through on-the-fly operation by registering ANNOTATORS, so the inputs are just the prompt and the target image, as shown in the several methods/scedit/ctr/xxx.yaml files you used earlier. The CONTROL_ANNO field in the corresponding YAML file is the operation of the condition we used.

You can achieve the required functionality by registering the ANNOTATORS of segment algo, such as Uniformer, in the modules/annotator directory, then use it in the yaml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants