guided-diffusion icon indicating copy to clipboard operation
guided-diffusion copied to clipboard

How to use your own data to train classifier_guide

Open ONobody opened this issue 2 years ago • 12 comments

Can anyone help? Thank you very much.

ONobody avatar Mar 07 '23 10:03 ONobody

For creating your own dataset, simply dump all of your images into a directory with ".jpg", ".jpeg", or ".png" extensions. If you wish to train a class-conditional model, name the files like "mylabel1_XXX.jpg", "mylabel2_YYY.jpg", etc., so that the data loader knows that "mylabel1" and "mylabel2" are the labels. Subdirectories will automatically be enumerated as well, so the images can be organized into a recursive structure (although the directory names will be ignored, and the underscore prefixes are used as names).

The images will automatically be scaled and center-cropped by the data-loading pipeline. Simply pass --data_dir path/to/images to the training script, and it will take care of the rest.

CreamyLong avatar Mar 08 '23 02:03 CreamyLong

like this 图片1 Are the pictures in these folders named in the form of mylabel?

ONobody avatar Mar 08 '23 02:03 ONobody

dog_01.jpg, dog_02.jpg......cat_01.jpg, cat_02.jpg... in one folder

CreamyLong avatar Mar 08 '23 02:03 CreamyLong

When the categories of my data are eight Do you need to make any changes to the code? thank you

ONobody avatar Mar 08 '23 02:03 ONobody

No,you only need to change the name of file

CreamyLong avatar Mar 08 '23 02:03 CreamyLong

Okay, I'll try. Thank you.

ONobody avatar Mar 08 '23 02:03 ONobody

Dear author, I used my own dataset as you said, but image_datasets.py appears "TypeError: init() got multiple values for argument 'classes' "error, is the source code or my data problem

milkyway1024 avatar Apr 19 '23 09:04 milkyway1024

dog_01.jpg,dog_02.jpg...cat_01.jpg,cat_02.jpg...在一个文件夹中

通过这种方式训练出一个分类器,我该怎么让它引导生成不同类别的图像呢

zouyunpeng666 avatar Jul 19 '23 08:07 zouyunpeng666

通过这种方式训练出一个分类器,我该怎么让它引导生成不同类别的图像呢

好的,我试试。谢谢。

你好,我想知道通过这种方式训练出一个分类器,我该怎么让它引导生成不同类别的图像呢

zouyunpeng666 avatar Jul 19 '23 08:07 zouyunpeng666

tomatically be scaled and center-cropped by the data-loading pipeline. Simply pass --data_dir path/to/images to the training script, and it will take care of the rest.

用classifier_sample.py 把输入的类别控制一下就行

hhsupremehh627 avatar Mar 22 '24 07:03 hhsupremehh627