openai / guided-diffusion

MIT License
6.03k stars 803 forks source link

How to use your own data to train classifier_guide #95

Open ONobody opened 1 year ago

ONobody commented 1 year ago

Can anyone help? Thank you very much.

CreamyLong commented 1 year ago

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.

ONobody commented 1 year ago

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

CreamyLong commented 1 year ago

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

ONobody commented 1 year ago

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

CreamyLong commented 1 year ago

No,you only need to change the name of file

ONobody commented 1 year ago

Okay, I'll try. Thank you.

milkyway1024 commented 1 year ago

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

zouyunpeng666 commented 1 year ago

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

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

zouyunpeng666 commented 1 year ago

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

好的,我试试。谢谢。

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

hhsupremehh627 commented 5 months ago

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 把输入的类别控制一下就行

Alexdbsdfs commented 1 month ago

*用classifier_sample.py 把输入的类别控制一下就行 你好 具体怎么控制呢

Alexdbsdfs commented 1 month ago

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 把输入的类别控制一下就行

你好 这里具体怎么控制呢