RenYurui / StructureFlow

Code for paper "StructureFlow: Image Inpainting via Structure-aware Appearance Flow"
Other
222 stars 42 forks source link

A problem about preprocess for gt_image #13

Closed XiaoqiangZhou closed 4 years ago

XiaoqiangZhou commented 4 years ago

Dear researcher,

In your code, you transform both the gt_image and structure_image in the Dataset function. I'm a little confused why you also transform the gt_image (i.e. Normalize)? Will this make the network learns to predict 'transformed' pixels in the corrupted region?

Code implementation is in data.py

if normalize:
        transform_list += [transforms.Normalize((0.5, 0.5, 0.5),
                                                (0.5, 0.5, 0.5))]
trans = transforms.Compose(transform_list) 
gt_image = trans(gt_image)

Could you explain the reason why you do such tranformation to gt_image? Thanks

RenYurui commented 4 years ago

This function normalizes the gt_image to [-1, 1]. It can be seen as a regular per-processing operation which ensures that the output images have similar data distribution (mean: 0 and variance: 1).

However, you can also remove this normalization operation. (remember to modify the activation function of the output layer)

zhangbaijin commented 4 years ago

excuse me , i have some questions .generate_structure_images("path to Places2 list file", "path to output folder"); what is place2 file list? Should i change place2 dataset to list ?

XiaoqiangZhou commented 4 years ago

@zhangbaijin Yes, you need to generate a places2_paths.txt, which includes the paths to all the places2 images. And the code will read from the file to get the paths of images