pix2pixHD code---readme

1: Basic configuration
requires a graphics card greater than or equal to 11G, install pytorch, and download the code.
insert image description here
2:
Some examples are placed in the test dataset file, download the pre-training weights of cityscape, put them in the checkpoints folder, and test the model. The test results are placed in the label2city_1024p folder under the results folder.
insert image description here
3: Dataset
First download the Cityscape dataset, and then place it in the datasets folder, which should be the same as the example .
insert image description here
example placement: the pictures under each file are in one-to-one correspondence.
insert image description here
The downloaded original data set:
insert image description here
each folder has three folders, which contain train, test, and val.
insert image description here
Each train, test, and val are assigned the name of the city, and each city name is assigned a picture.
insert image description here
4: Training
Training uses a dataset of size 512x1024.
insert image description here
5: Multi-GPU training
Just specify the GPU model when training.
insert image description here
6: Mixed precision
You can use mixed precision during training, provided that APEX is installed.
insert image description here
7: If you want to use full resolution during training, you need more than 24G of memory, otherwise cut to 512x1024. insert image description here
8: Train your own data set
8.1: First generate a moral label of a channel, and each value on the label is an object The corresponding number of classes, since we want to generate one-hot encoding from the label map. The number of channels (number of categories, cityscape is 35 categories before conversion) is specified during training and testing.
8.2: If the input is not a label image, specify label_nc=0, which will directly use the RGB image, and the name of the dataset should also be replaced by train_label, train_img to train_A, train_B. That is to convert A to B.
8.3: If there is no instance graph, specify no_instance.
8.4: The default preprocessing method is scale_with. First, the width of the training image will be scaled to 1024 while maintaining the aspect ratio, and the length will become 512 (aspect ratio 2:1). If you want to use different settings, pass Use resize_or_crop to change it. For example, scale width and crop first scales the width of the image to 1024, and then randomly crops to (finesize, finesize), with the same length and width. For crop, skip the resize operation and cut randomly. Set to None if you don't want preprocessing.
insert image description here
9:more
insert image description here

Guess you like

Origin blog.csdn.net/qq_43733107/article/details/130847411