ControlNet icon indicating copy to clipboard operation
ControlNet copied to clipboard

About dataset

Open Maeyon-Z opened this issue 2 years ago • 6 comments

Should I follow the following steps to preprocess my dataset with images of varying sizes:

  1. Resize the image to the same size, such as 512 * 512

  2. After resizing, input the image into the annotator to generate control img

  3. Save the resized image and control img as training data

Maeyon-Z avatar Nov 27 '23 02:11 Maeyon-Z

yes, you can do that but resizing everything to square squishes aspect ratios, see here https://civitai.com/articles/2078/play-in-control-controlnet-training-setup-guide#heading-35441

geroldmeisinger avatar Nov 27 '23 08:11 geroldmeisinger

thanks

Maeyon-Z avatar Nov 27 '23 09:11 Maeyon-Z

yes, you can do that but resizing everything to square squishes aspect ratios, see here https://civitai.com/articles/2078/play-in-control-controlnet-training-setup-guide#heading-35441

I have read the fantastic document you wrote, but my English is not very good. After using translation software to translate some sentences, I couldn't quite understand them. After reading it, I thought that for all images of different sizes, we should first resize the shorter side to 512, synchronize the longer side to another size, and then crop a 512 * 512 image in the center as the result. Am I right in understanding this way

Maeyon-Z avatar Nov 27 '23 09:11 Maeyon-Z

yes. at least, it's the most foolproof way and will give good results.

you can also crop and resize it to 512x512 anywhere you want, if you have more information about your image dataset. for example if you work with facial images and know where the faces are, you might want to crop around the faces instead of the middle.

ControlNet is also able to handle images of size 512x(n*64) but you have to look that up in your training script.

geroldmeisinger avatar Nov 27 '23 10:11 geroldmeisinger

yes. at least, it's the most foolproof way and will give good results.

you can also crop and resize it to 512x512 anywhere you want, if you have more information about your image dataset. for example if you work with facial images and know where the faces are, you might want to crop around the faces instead of the middle.

ControlNet is also able to handle images of size 512x(n*64) but you have to look that up in your training script.

i understand, thank you very much

Maeyon-Z avatar Nov 27 '23 10:11 Maeyon-Z

yes. at least, it's the most foolproof way and will give good results.

you can also crop and resize it to 512x512 anywhere you want, if you have more information about your image dataset. for example if you work with facial images and know where the faces are, you might want to crop around the faces instead of the middle.

ControlNet is also able to handle images of size 512x(n*64) but you have to look that up in your training script.

My original image size is 256x128,it is about a pedestrian and i need whole image,i plan to resize it to 512x256,should i change something or somewhere in the config.yaml file,what is the meaning of the params image_size:64 ,and i didn't see the n of n*64

Namn23 avatar Jan 10 '24 06:01 Namn23