csjliang / LPTN

Official implementation of the paper 'High-Resolution Photorealistic Image Translation in Real-Time: A Laplacian Pyramid Translation Network' in CVPR 2021
Apache License 2.0
413 stars 47 forks source link

how can we train on a day and night dataset #10

Closed Aryan-Solanki closed 3 years ago

Aryan-Solanki commented 3 years ago

how to devide images in test,train and A,B..plzz explain in details

Aryan-Solanki commented 3 years ago

why have you devided train into A,B and how do i have to devide my training set if i m using my own set of images

Aryan-Solanki commented 3 years ago

and how can i output only one img not all 3

csjliang commented 3 years ago

Hi. For both train and test sets, A denotes the input images (in day2night task, day images) and B denotes the target images (in day2night task, night images). You just need to divide the images into two folders. To process a single image, you can either write code to read one image or just put only one image into the test/A folder.

Aryan-Solanki commented 3 years ago

IMG-20210530-WA0006.jpg

When i pass one img in the model it outputs a img in 3 section...where do i have to make changes so i get only the processed output not all 3img in one img

csjliang commented 3 years ago

In the file lptn_test_model.py, change Line 107 to imwrite(result_img, save_img_path). Thanks.

Aryan-Solanki commented 3 years ago

do i have to do any specific code changes or i can just devide Image into A(day imgs) and B(night) folder , change file locations in train_FiveK.yml and run Train.py

Aryan-Solanki commented 3 years ago

one more doubt in training the day and night images don't have to be of same location??? random day and night images will work??

Do i have to make every img of 480x720 or 720x480 size??

csjliang commented 3 years ago

do i have to do any specific code changes or i can just devide Image into A(day imgs) and B(night) folder , change file locations in train_FiveK.yml and run Train.py

Just prepare dada and change dataroot in the yml file then you can get a basic model that can translate day images to night. Of course, it will be better if you tune the parameters according to your data. Thanks.

csjliang commented 3 years ago

one more doubt in training the day and night images don't have to be of same location??? random day and night images will work??

Do i have to make every img of 480x720 or 720x480 size??

Aligned day to night training pairs (captured at the same location) are hard to collect. If you have them, the performance will be far better by using the MSE loss directly. In this project, the translation is mainly supervised by GAN. Therefore, only unpaired data (random day and night images as you said) is required. The images (both training and testing) can be any size in our code, yet please make sure to crop a relatively large patch for each image (change the gt_size para in the yml file).

Aryan-Solanki commented 3 years ago

image why is it showing 5 days .. i m running on gtx1660ti and my taskmanager is also showing low gpu usage image

image

m i missing something??

Aryan-Solanki commented 3 years ago

i m not running the CUDA_VISIBLE_DEVICES=0 python codes/train.py -opt options/train/LPTN/train_FiveK.yml as it gives error image image i m direclty running train.py and set the default opt parameter

csjliang commented 3 years ago

Please try to directly run the code following our instructions, i.e., run PYTHONPATH="./:${PYTHONPATH}" CUDA_VISIBLE_DEVICES=0 python codes/train.py -opt options/train/LPTN/train_FiveK.yml.