yuli0103 / CGB-DM

CGB-DM: Content and Graphic Balance Layout Generation with Transformer-based Diffusion Model
Apache License 2.0
33 stars 0 forks source link

how to generate the img_sal_sub image path list, I cannot found any code about generate? #2

Closed trouble-maker007 closed 3 weeks ago

trouble-maker007 commented 1 month ago

img_sal = Image.open(self.sal[idx]).convert("L") img_sal_sub = Image.open(self.sal_sub[idx]).convert("L") img_sal_map = Image.fromarray(np.maximum(np.array(img_sal), np.array(img_sal_sub)))

@yuli0103 I could not find any code about how to generate the image about the saliency_sub, would you like to give more detail about how to preprocess? Does use two model(ISNet and BASNet) to generate saliency detection result I was tried to preprocess the cgl data into your training format, but still have no idea to get the saliency_sub data.

image
trouble-maker007 commented 1 month ago

null

yuli0103 commented 1 month ago

img_sal = Image.open(self.sal[idx]).convert("L") img_sal_sub = Image.open(self.sal_sub[idx]).convert("L") img_sal_map = Image.fromarray(np.maximum(np.array(img_sal), np.array(img_sal_sub)))

@yuli0103 I could not find any code about how to generate the image about the saliency_sub, would you like to give more detail about how to preprocess? Does use two model(ISNet and BASNet) to generate saliency detection result I was tried to preprocess the cgl data into your training format, but still have no idea to get the saliency_sub data.

image

I apologize for the inconvenience. In our setup, images in the 'saliency' directory are generated using the ISNet model, while images in the 'saliency_sub' directory are generated using the BASNet model. You can find the specific code in data_process/saliency_detection.py. Furthermore, I have updated the latest code package and dataset link.

trouble-maker007 commented 1 month ago

@yuli0103 Thank you for your reply.I will try to train under this setting.

trouble-maker007 commented 1 month ago

@yuli0103 Does run single image support condition layout generate, such as cwh

yuli0103 commented 1 month ago

@yuli0103 Does run single image support condition layout generate, such as cwh

Thank you for your suggestion. Going forward, I will support condition layout generation in "run_single_image.py".

trouble-maker007 commented 1 month ago

@yuli0103 thanks for the response, I set batch 1 in test.py