DeblurGAN
DeblurGAN copied to clipboard
combine A_B folder problem,can anyone give a help
I want to use my model ,then I make the real picture folder and the corresponding fake pictures folder
I run the command (python datasets/combine_A_and_B.py --fold_A /path/to/data/A --fold_B /path/to/data/B --fold_AB /path/to/data ) with my real and fake pictures folder
but the combine_A_and_B.py get some problem
I want to know the the real meaning of the two arguments --fold_A /path/to/data/A and --fold_B /path/to/data/B the two arguments is the different meaning between the coding and the definition
Thank you for help!
From what I can tell, the combine_A_and_B.py
script was lifted from this repository, https://github.com/EliasVansteenkiste/CycleGANwithPerceptionLoss
At the end of the README for that repo, they offer this documentation for the script:
We provide a python script to generate pix2pix training data in the form of pairs of images {A,B}, where A and B are two different depictions of the same underlying scene. For example, these might be pairs {label map, photo} or {bw image, color image}. Then we can learn to translate A to B or B to A: Create folder
/path/to/data
with subfoldersA
andB
.A
andB
should each have their own subfolderstrain
,val
,test
, etc. In/path/to/data/A/train
, put training images in style A. In/path/to/data/B/train
, put the corresponding images in style B. Repeat same for other data splits (val
,test
, etc). Corresponding images in a pair {A,B} must be the same size and have the same filename, e.g.,/path/to/data/A/train/1.jpg
is considered to correspond to/path/to/data/B/train/1.jpg
. Once the data is formatted this way, call:
python datasets/combine_A_and_B.py --fold_A /path/to/data/A --fold_B /path/to/data/B --fold_AB /path/to/data
This will combine each pair of images (A,B) into a single image file, ready for training.
Hope this helps!
From what I can tell, the
combine_A_and_B.py
script was lifted from this repository, https://github.com/EliasVansteenkiste/CycleGANwithPerceptionLossAt the end of the README for that repo, they offer this documentation for the script:
We provide a python script to generate pix2pix training data in the form of pairs of images {A,B}, where A and B are two different depictions of the same underlying scene. For example, these might be pairs {label map, photo} or {bw image, color image}. Then we can learn to translate A to B or B to A: Create folder
/path/to/data
with subfoldersA
andB
.A
andB
should each have their own subfolderstrain
,val
,test
, etc. In/path/to/data/A/train
, put training images in style A. In/path/to/data/B/train
, put the corresponding images in style B. Repeat same for other data splits (val
,test
, etc). Corresponding images in a pair {A,B} must be the same size and have the same filename, e.g.,/path/to/data/A/train/1.jpg
is considered to correspond to/path/to/data/B/train/1.jpg
. Once the data is formatted this way, call:python datasets/combine_A_and_B.py --fold_A /path/to/data/A --fold_B /path/to/data/B --fold_AB /path/to/data
This will combine each pair of images (A,B) into a single image file, ready for training.
Hope this helps!
Thanks for your help! The preliminary issue has been solved.
hello, I would like to create two new folders A and B under folder data,and then set up train,val,test and other files under each folder,
data---
A---train,val,test
B---train,val,test
then run the command:
python datasets/combine_A_and_B.py --fold_A /path/to/data/A --fold_B /path/to/data/B --fold_AB /path/to/data
there are the following errors:
File "datasets/combine_A_and_B.py", line 18, in
Thank you for help!
'path/to/data/A' means that you should put the path to the directory A (or other file contains your data) here
I made a little very simple script so you can put your data in the right format. Check it out: https://github.com/piperod/DeblurGAN/blob/master/datasets/split_train_test_val.py
run this script, then run combine script. Then you are ready to train .
Where should the blurred images be put in folder A or folder B? Does the network learn to translate image from A to B? In that case, I keep Ground truth in B and Blurred images in A?