[LEADERG APP] Pix2Pix

Area (Language):

大陆港澳 (简体中文)

台灣 (繁體中文)

 

 

 [Introduction]

 

The pix2pix architecture is similar to GAN, but the purpose is not to generate simulated images, but to use supervised learning to output the image style learned by the original image. For example: conversion of grayscale to color, edge map conversion to photo, map conversion to satellite map and other applications.

 

 

[Operation steps and instructions]

 

APP is mainly divided into four major use functions, folder preparation, pre-processing, training, inference, and others.  

 

APP.png

 

Folder preparation :  

 

Select Dataset: Select the data set for AI learning. If you want to train your own images, please click View to view the data folder. Please copy a default map folder and change it to your own data name. At this time, please do not delete any sub-folders and file.

 

 

Pre-processing :

 

资料准备.png  

 

1. Please prepare the images that you want to convert. The conversion needs the same attributes and the same pair of image file names must be the same (the attached file name must be .jpg).

Then, please click Folder A view and Folder B view in 1. combine A and B button.

 

After the folder is opened, there are train, val, and test in the A and B folders. A is the image after conversion, and B is the image before conversion. Please put the images into the train, val, and test in the A and B folders according to the before and after conversion. One thing to note is that the train, val, and test in the two folders must be able to find the corresponding image file names in each other.

 

Then click the 1. combine A and B button to merge the corresponding images into one image, which can be viewed by clicking Folder AB view.

 

For example: map to satellite image. The 1.png map can be found in the train folder in A, the corresponding 1.png satellite image should be found in the train folder in B, and the merged image 1.png can also be found in the train folder.

 

  • data/A/train: training map image; data/B/train: training satellite image.

=> data/train : Combine the training images of A and B.

 

 

  • data/A/val : Map image for verification;data/B/val : Satellite imagery for verification.

=> data/val : A single image combining A and B for verification.

 

 

  • data/A/test : Map image for test;data/B/test : Satellite imagery for test.

=> data/test : A single image combining A and B for verification.

 

Note : 

1). The image size is recommended to be the same, square, if not the same, you can zoom or crop.

2). The image file must be .jpg.

3). Images need to be matched in pairs.    

 

 

2. The data is ready, please click 2. visdom server and 3. visdom server browser in order before starting training, as shown in the figure below, please do not press x to close it. Please keep it open during training.

 

After starting the training, the training loss curve and other information will be post to the visdom server and displayed on the visdom server browser.  

 

visdom.png  

 

Training :

 

训练.png  

Click 4. train to start training. During the training process, you can use the 3. visdom server browser opened in the previous step to watch the loss curve and the training effect.

 

During training, the parameters that can be set are as follows:

 

    Continue training : If you want to continue training, please tick it, and the training will automatically load the last model and continue training (latest_net_G.pth、latest_net_D.pth). Otherwise, don't tick it.

 

    Dataroot : The file path of the training image. Press view to view the train and val folders, which contain training images.

 

    Checkpoints dir : The folder of the training model, click view to see the folder.

 

    GPU ID : If your device supports NVIDIA GPU accelerated computing, please set the GPU ID, if you use the 0th GPU, set it to 0, and use the 0th and 1st GPU to set it to 0, 1. If NVIDIA GPU accelerated computing is not supported, set to -1.

 

    Batch size : The number of training examples in one forward/backward pass.

 

    N epochs : Set the number of epochs for training. The total number of epochs for training will add an additional 100 epochs, using a learning rate that decays linearly to 0.

 

    Save epoch freq : The number of frequency epochs to store the model.

 

 

Inference:

 

Infer the entire folder. There are two main types, one is the inference of a single image, and the result is presented before and after conversion; the other is the inference of the combined image (1. combine A and B output image), and the result is the image before and after the conversion and the target image after the conversion.

 

The way to use them is to press 4. inference folder/4. Inference folder image pairs, select the model, and start the inference. After the inference is completed, the browser will automatically open to view the inference results.

 

The inference parameters are as follows :

 

    Inference folder : Shows the folder path of the inferred image. This folder is the test folders in the data preparation step.

 

    GPU ID : If your device supports NVIDIA GPU accelerated computing, please set the GPU ID, if you use the 0th GPU, set it to 0, and use the 0th and 1st GPU to set it to 0, 1. If NVIDIA GPU accelerated computing is not supported, set to -1.  

 

推论.png  

 


Recommended Article

1.
LEADERG APP - AI Software (No Code, APP User Interface)

2.
LEADERG AI ZOO - Advanced AI Software (Low Code, Jupyter Lab User Interface)

3.
LEADERG AI Computer ( Deep Learning, PC, workstation, server, NVIDIA GPU, TESLA A100, RTX-3090-24G, Intel VPU, GPU Server

4.
AI Training Courses

Trial of LEADERG APP

Welcome to contact us for 15 days trial of LEADERG APP.
Email: leaderg@leaderg.com

How to Buy

Welcome to contact us for quotation. We will help you buy right products.
Email: leaderg@leaderg.com