sktbrain / discogan Goto Github PK
View Code? Open in Web Editor NEWOfficial implementation of "Learning to Discover Cross-Domain Relations with Generative Adversarial Networks"
Official implementation of "Learning to Discover Cross-Domain Relations with Generative Adversarial Networks"
In the code of WassersteinGAN, they have this line:
for p in netD.parameters():
p.requires_grad = False # to avoid computation
I think it means that when you train G, by default you'll compute gradients for D as well (but not updating them), and vice versa. Setting the flag to False to avoid the computation should speed up the training a lot.
I found that my tensorflow implementation runs much faster than this code, and this is probably the reason.
ipdb
From the paper I see the cars.
I am wondering that where can I get the car or generate the datasets?
python ./discogan/image_translation.py --task_name='celebA' --style_A='Blond_Hair' --style_B='Black_Hair' --constarint='Male'
Is there any problem with my python or pythorch?
please let me thank you for any help!
Can I use my own datas to train?
dataset_path = './datasets/'
celebA_path = os.path.join(dataset_path, 'celebA')
handbag_path = os.path.join(dataset_path, 'edges2handbags')
shoe_path = os.path.join(dataset_path, 'edges2shoes')
facescrub_path = os.path.join(dataset_path, 'fonts')
chair_path = os.path.join(dataset_path, 'rendered_chairs')
face_3d_path = os.path.join(dataset_path, 'PublicMM1', '05_renderings')
face_real_path = os.path.join(dataset_path, 'real_face')
car_path = os.path.join(dataset_path, 'data', 'cars')
def shuffle_data(da, db):
a_idx = range(len(da))
np.random.shuffle( a_idx )
b_idx = range(len(db))
np.random.shuffle(b_idx)
shuffled_da = np.array(da)[ np.array(a_idx) ]
Giving error on the last line :
Traceback (most recent call last):
File "./discogan/image_translation.py", line 314, in <module>
main()
File "./discogan/image_translation.py", line 181, in main
data_style_A, data_style_B = shuffle_data( data_style_A, data_style_B)
File "/Users/kadia/Desktop/DiscoGAN-master/discogan/dataset.py", line 27, in shuffle_data
shuffled_da = np.array(da)[ np.array(a_idx) ]
IndexError: arrays used as indices must be of integer (or boolean) type
in lines 251-252 you apply curriculum learning to compute the total gan loss. What's the motivation for that? Cannot find it in the paper.
Besides, is there any authorship relation between this repo and https://github.com/carpedm20/DiscoGAN-pytorch ?
Just found a small issue in image_translation.py, in line 37, 38, the help information is not right.
Training faces is set up for 5,000 epochs, which on my Pascal Titan X requires a few minutes per epoch. There are three things I can imagine have gone wrong:
1 (and most likely): The dataset I'm using comes from the Google Drive link, and has more files than you were training against
2: The images in the dataset need to be downsampled
3: Epoch default is too high
Or maybe something else?
Hello,
can you please share the preTrained Model for gender Translation please.
Thank you so much
Lafi-Zololo
Hello Sir,
I trained your code using edges2shoes.
But I couldn't test.
If you don't mind, please tell me test-code using trained-model and input-image.
Thanks.
I've trained the complete model (A-->B and B->A) on the CELEBA training set, split between males and females (50k images per group) with images resized to 76x76 and random 64x64 crop. After approximatively 300 epochs the model fully collapsed:
While not having the reported quality (in terms of definition on both domains) even before.
Anyone else experiencing similar issues?
I was trying to train model for Face2Face conversion. But I am getting an error (need at least one array to stack).
I have figured out how to fix it.
We can fix it be adding the below mentioned line in DiscoGan/discogan/dataset.py . Function name "get_faces_3d".
"image_paths = map(lambda x: os.path.join( face_3d_path, x ), image_files)"
Add it before "return images_path" .
@jazzsaxmafia
Hi , I was wondering is there a pretrained model available for handbags2shoes DiscoGAN model ?
Thanks.
Hello,
Currently getting the following error:
File "./discogan/image_translation.py", line 314, in
main()
File "./discogan/image_translation.py", line 131, in main
test_B = read_images( test_style_B, 'B', args.image_size )
File "/Users/haosun/Raju/DiscoGAN-master/discogan/dataset.py", line 53, in read_images
images = np.stack( images )
File "/Users/haosun/Raju/anaconda/lib/python3.6/site-packages/numpy/core/shape_base.py", line 350, in stack
raise ValueError('need at least one array to stack')
ValueError: need at least one array to stack
after downloading the dataset and running the following command:
python ./discogan/image_translation.py --task_name='edges2handbags'.
Please help to check.
Thanks
Cannot work with batch size equals 1?
Traceback (most recent call last):
File "./discogan/image_translation.py", line 10, in
from model import *
File "/home/ii/DiscoGAN/discogan/model.py", line 6, in
import ipdb
File "/home/ii/anaconda2/lib/python2.7/site-packages/ipdb/init.py", line 7, in
from ipdb.main import set_trace, post_mortem, pm, run # noqa
File "/home/ii/anaconda2/lib/python2.7/site-packages/ipdb/main.py", line 32, in
debugger_cls = TerminalInteractiveShell().debugger_cls
AttributeError: 'TerminalInteractiveShell' object has no attribute 'debugger_cls'
I think the dates of edges2shoes are paired,same as pix2pix. what do you think ?
I want to know how to reproduce results. Can you share your code?
When the number of each data was 5000, learning did not work well.
When the epoch increased a little, learning did not proceed. And it showed very bad results.
I want to know what part of discoGAN is causing this result.
A feature matching loss is provided as part of the loss for the generator G. There is no mention of this loss in the paper, and its seems to be much greater then the standard GAN loss (Ratio of 0.9 to 0.1). Could you explain its use? How does its use, or lack of, affect results?
Thanks!
Please tell how to test images with individual models
Hello,
when running this command python ./discogan/image_translation.py --task_name='facescrub'
i have this error:
Traceback (most recent call last): File "./discogan/image_translation.py", line 314, in <module> main() File "./discogan/image_translation.py", line 139, in main test_B = read_images( test_style_B, None, args.image_size ) File "/home/lafi/Desktop/DiscoGAN-master/discogan/dataset.py", line 53, in read_images images = np.stack( images ) File "/usr/local/lib/python2.7/dist-packages/numpy/core/shape_base.py", line 350, in stack raise ValueError('need at least one array to stack') ValueError: need at least one array to stack
If you suspect this is an IPython bug, please report it at:
https://github.com/ipython/ipython/issues or send an email to the mailing list at [email protected] You can print a more detailed traceback right now with "%tb", or use "%debug" to interactively debug it. Extra-detailed tracebacks for bug-reporting purposes can be enabled via: %config Application.verbose_crash=True
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.