Generate-LicensePlate-with-GAN icon indicating copy to clipboard operation
Generate-LicensePlate-with-GAN copied to clipboard

combine A and B script has errors and doesn't produce anything.

Open kcoda36 opened this issue 2 years ago • 2 comments

Your file "combine_A_andB.py" makes absolutely no sense. It generates a bunch of empty folders with the same names as the images. The file is uncommented so I cant even debug what you are trying to do. you also have an error in line 25 where you do "img_list = os.listdir(img_fold_A)" you set img_fold_A = os.path.join(args.fold_A, sp) where sp is a file. The error is you are trying to listdir an image? makes no sense. Screenshot 2022-05-09 150337

kcoda36 avatar May 09 '22 20:05 kcoda36

@kcoda36 Hi, I am also having the same error did you figure it out? I really need to fix this please help

jeungmin717 avatar Jul 12 '23 03:07 jeungmin717

@kcoda36 hello , I figured it out the solution is in original repository documentation following

Prepare your own datasets for pix2pix Pix2pix's training requires paired data. We provide a python script to generate 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 subdirectories A and B. A and B should each have their own subdirectories train, 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.

jeungmin717 avatar Jul 12 '23 06:07 jeungmin717