style-based-gan-pytorch icon indicating copy to clipboard operation
style-based-gan-pytorch copied to clipboard

Implementation A Style-Based Generator Architecture for Generative Adversarial Networks in PyTorch

Results 76 style-based-gan-pytorch issues
Sort by recently updated
recently updated
newest added

How to get W+?

[{"_id":"67188148dd4360c29506ea5e","body":"Could you let me know what is the W+ code? If it is the output of MLP then you can get it using Generator.style(latent) https:\/\/github.com\/rosinality\/style-based-gan-pytorch\/blob\/master\/model.py#L465","issue_id":1715516129671,"origin_id":540287949,"user_origin_id":4343568,"create_time":1570671946,"update_time":1570671946,"id":1729659208662,"updated_at":"2024-10-23T04:53:28.662000Z","created_at":"2024-10-23T04:53:28.662000Z"},{"_id":"6718814bdd4360c29506ea5f","body":"I believe may you mean W+ code in [Image2StyleGAN](https:\/\/arxiv.org\/abs\/1904.03189) @mehameha998 ","issue_id":1715516129671,"origin_id":562012655,"user_origin_id":38181176,"create_time":1575532025,"update_time":1575532025,"id":1729659211590,"updated_at":"2024-10-23T04:53:31.590000Z","created_at":"2024-10-23T04:53:31.590000Z"}] comment

Hi @rosinality, thanks very much for your reimplementation. Could tell me how to get W+ code?

Hello, I have just come into contact with gan, may I ask whether your method can be used to train the vehicle dataset? Looking forward to your reply. Thank you~

Constraining output to a particular size

[{"_id":"671881225552b4805609b2cb","body":"You can use --max_size option to restrict maximum image sizes.\r\n\r\nI didn't integrated codes for constructing celebA-HQ datasets. But it will be enough for generating interesting samples in lower resolutions.","issue_id":1715516129682,"origin_id":559011019,"user_origin_id":4343568,"create_time":1574847870,"update_time":1574847870,"id":1729659170784,"updated_at":"2024-10-23T04:52:50.783000Z","created_at":"2024-10-23T04:52:50.783000Z"},{"_id":"671881235552b4805609b2cc","body":"Thank you for the input. Any comments on the techniques used for resizing that I was asking about earlier? It seems to me that since the aspect ratio of the dataset images is different, simply resizing it to a square image would likely result in warping and blurriness in output as we scale up.","issue_id":1715516129682,"origin_id":559153973,"user_origin_id":46947812,"create_time":1574871260,"update_time":1574871260,"id":1729659171484,"updated_at":"2024-10-23T04:52:51.484000Z","created_at":"2024-10-23T04:52:51.484000Z"},{"_id":"671881245552b4805609b2cd","body":"As code uses resize function of torchvision, it will not squash images to different aspect ratios. (resize function conserves aspect ratios unless both height and width specified.) So it needs center crops.","issue_id":1715516129682,"origin_id":559309966,"user_origin_id":4343568,"create_time":1574906176,"update_time":1574906176,"id":1729659172186,"updated_at":"2024-10-23T04:52:52.185000Z","created_at":"2024-10-23T04:52:52.185000Z"}] comment

Is it possible to specify the max size of the output image? I do not want to invest resources to train upto 1024x1024 images and am okay with just going...

I was curious how crucial are MLP layers, so I trained 64p model without them (i.e. comment out this section https://github.com/rosinality/style-based-gan-pytorch/blob/master/model.py#L458-L460) Here is comparison: 320k with mlp layers: ![320000](https://user-images.githubusercontent.com/4003908/69326319-a00db980-0c5c-11ea-942b-fab8ba497d2b.png) 320k...

What is normalize module right after latent z input?

[{"_id":"671881034febc2515c115935","body":"Pixel norm module, that is normalize inputs by it's standard deviation.","issue_id":1715516129694,"origin_id":554630643,"user_origin_id":4343568,"create_time":1573905576,"update_time":1573905576,"id":1729659139847,"updated_at":"2024-10-23T04:52:19.846000Z","created_at":"2024-10-23T04:52:19.846000Z"}] comment

What is normalize module right after latent z input?

Question about progressive growing

[{"_id":"6718812d4febc2515c115937","body":"In my experience, results from all of the resolutions should be good, as\nthe model progresses up. It is unlikely that the final resolution will be\ngood if the earlier resolutions are bad .\n\nOn Thu, Nov 7, 2019, 8:59 AM mrgloom <[email protected]> wrote:\n\n> 8\/16\/32\/64\/128\/256\/512\/1024\n>\n> Will results for each pyramid scale will be good? or it only guaranteed\n> that result for highest resolution will be good?\n>\n> \u2014\n> You are receiving this because you are subscribed to this thread.\n> Reply to this email directly, view it on GitHub\n> <https:\/\/github.com\/rosinality\/style-based-gan-pytorch\/issues\/62?email_source=notifications&email_token=AH5YSNP4EQKZLH3WO24TJ2LQSQNMLA5CNFSM4JKG7GZ2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HXTUM3Q>,\n> or unsubscribe\n> <https:\/\/github.com\/notifications\/unsubscribe-auth\/AH5YSNP6B2XGTJGEMYJG2F3QSQNMLANCNFSM4JKG7GZQ>\n> .\n>\n","issue_id":1715516129699,"origin_id":551098981,"user_origin_id":33261877,"create_time":1573136421,"update_time":1573136421,"id":1729659181046,"updated_at":"2024-10-23T04:53:01.045000Z","created_at":"2024-10-23T04:53:01.045000Z"},{"_id":"6718812d4febc2515c115938","body":"Samples will be good, but it isn't very high quality as training iterations would be somewhat short at low resolution phases.","issue_id":1715516129699,"origin_id":551105573,"user_origin_id":4343568,"create_time":1573137351,"update_time":1573137351,"id":1729659181153,"updated_at":"2024-10-23T04:53:01.153000Z","created_at":"2024-10-23T04:53:01.153000Z"},{"_id":"6718812e4febc2515c115939","body":"I was saving images each 10k steps and this is an image before 64p stage, i.e. it's 32p images grid at 110k steps.\r\nAnd images obviously have artifacts.\r\n\r\n110k - 32p images grid.\r\n![110000](https:\/\/user-images.githubusercontent.com\/4003908\/68542460-c6f70080-03bd-11ea-87d0-33fc79b08a4d.png)\r\n120k - 64p images grid.\r\n![120000](https:\/\/user-images.githubusercontent.com\/4003908\/68542497-45ec3900-03be-11ea-8ae2-4050ae30ea26.png)\r\n\r\nIs this expected? i.e. we will have 'near perfect quality' only at final resolution in progressive growing setting? Is it meaningless to have 'near perfect quality' at each intermediate resolution?\r\ni.e. something like this https:\/\/github.com\/akanimax\/BMSG-GAN\/","issue_id":1715516129699,"origin_id":552182502,"user_origin_id":4003908,"create_time":1573382071,"update_time":1573382220,"id":1729659182764,"updated_at":"2024-10-23T04:53:02.763000Z","created_at":"2024-10-23T04:53:02.763000Z"},{"_id":"6718812e4febc2515c11593a","body":"Yes, it will be not very high quality especially at lower resolutions. And you will need truncation tricks for better samples. You don't need to have high quality samples at lower resolutions for the final quality, but if you need it, I think you can train more steps at each resolutions.","issue_id":1715516129699,"origin_id":552184988,"user_origin_id":4343568,"create_time":1573384382,"update_time":1573384382,"id":1729659182962,"updated_at":"2024-10-23T04:53:02.962000Z","created_at":"2024-10-23T04:53:02.962000Z"},{"_id":"671881304febc2515c11593b","body":"For now I have trained model for 320k+ steps in ~130 hours.\r\n\r\n320k - 128p images grid:\r\n![320000](https:\/\/user-images.githubusercontent.com\/4003908\/68895589-ab338780-073a-11ea-86c3-b58592a7fdfa.png)\r\n\r\nFor now it's training at 128p resolution (maximum resolution in my setting) with alpha=1.0\r\nAs we can see quality of images still not perfect, does it need to train more? How 'good' images should look before truncation trick?","issue_id":1715516129699,"origin_id":554079013,"user_origin_id":4003908,"create_time":1573765531,"update_time":1573765531,"id":1729659184565,"updated_at":"2024-10-23T04:53:04.565000Z","created_at":"2024-10-23T04:53:04.565000Z"},{"_id":"671881314febc2515c11593c","body":"I think it is almost enough if you use truncation tricks.","issue_id":1715516129699,"origin_id":554162737,"user_origin_id":4343568,"create_time":1573780197,"update_time":1573780197,"id":1729659185170,"updated_at":"2024-10-23T04:53:05.170000Z","created_at":"2024-10-23T04:53:05.170000Z"}] comment

> 8/16/32/64/128/256/512/1024 Will results for each pyramid scale will be good? or it only guaranteed that result for highest resolution will be good?

KeyError: 'generator' when continuing from checkpoint

[{"_id":"6718815f4febc2515c115940","body":"Sorry, [DIGITS].model file only saves running average of generator. Generators and discriminators are saved in the train-step-X.model file when train phase changed. Could you use that checkpoints?","issue_id":1715516129716,"origin_id":545029396,"user_origin_id":4343568,"create_time":1571759506,"update_time":1571759506,"id":1729659231547,"updated_at":"2024-10-23T04:53:51.547000Z","created_at":"2024-10-23T04:53:51.547000Z"},{"_id":"6718815f4febc2515c115941","body":"Thank you for your quick answer. So the problem probably is, there is no train-step-X.model existing, because the process wasnt far enough executed to make the jump to 16x resolution, where it would be safed as far as i understand. Is there a easy way to modify the code, that training stops get safed more often than only on resolution jumps? \r\n","issue_id":1715516129716,"origin_id":545068707,"user_origin_id":56882581,"create_time":1571765226,"update_time":1571765226,"id":1729659231743,"updated_at":"2024-10-23T04:53:51.743000Z","created_at":"2024-10-23T04:53:51.743000Z"},{"_id":"6718815f4febc2515c115942","body":"Or maybe i'll just need to get better hardware ( : ","issue_id":1715516129716,"origin_id":545068919,"user_origin_id":56882581,"create_time":1571765255,"update_time":1571765255,"id":1729659231958,"updated_at":"2024-10-23T04:53:51.958000Z","created_at":"2024-10-23T04:53:51.958000Z"},{"_id":"671881634febc2515c115943","body":"Hmm I thought 20000 iterations are enough to change phases. You can copy these lines https:\/\/github.com\/rosinality\/style-based-gan-pytorch\/blob\/master\/train.py#L100 to https:\/\/github.com\/rosinality\/style-based-gan-pytorch\/blob\/master\/train.py#L241 this to save states for resume training. Sorry for confusion.","issue_id":1715516129716,"origin_id":545202460,"user_origin_id":4343568,"create_time":1571788006,"update_time":1571788006,"id":1729659233075,"updated_at":"2024-10-23T04:53:55.779000Z","created_at":"2024-10-23T04:53:55.779000Z"},{"_id":"671881654febc2515c115945","body":"Thank you for sharing your code. \r\n\r\nI think also you need to reset --init_size to where it stopped training when resuming training otherwise it would restart from the 8 by 8. ","issue_id":1715516129716,"origin_id":552193609,"user_origin_id":11481487,"create_time":1573391559,"update_time":1573391559,"id":1729659237007,"updated_at":"2024-10-23T04:53:57.007000Z","created_at":"2024-10-23T04:53:57.007000Z"}] comment

Hey there, first, thank you for your amazing work with this pytorch stylegan, i got it to work quite flawlessly. I trained on a quite small custom dataset on the...

Is it possible to use `img_align_celeba.zip` (1.4Gb) with images of size `178x218` to train model up to 128p? What are general requirements for dataset? should faces be aligned?

Conditional version of stylegan

[{"_id":"671881a64febc2515c11595b","body":"I think there are many options, like methods you mentioned, but I don't know which will be best. I think concat condition embeddings to input of style MLPs will be most straightforward.","issue_id":1715516129729,"origin_id":551110346,"user_origin_id":4343568,"create_time":1573138031,"update_time":1573138031,"id":1729659302741,"updated_at":"2024-10-23T04:55:02.740000Z","created_at":"2024-10-23T04:55:02.740000Z"}] comment

What is the proper way to add condition to StyleGan? i.e. for example face landmarks. As I udnderstand one option is to encode face landmarks and concat embedding to random...

Pretrained model?

[{"_id":"6718818a4febc2515c115947","body":"https:\/\/drive.google.com\/file\/d\/1zmVRIXk8HHddLmibKcEYpT0gixUfPlSp\/view?usp=sharing\r\n\r\nYou can use this. 600k checkpoint of generator.","issue_id":1715516129736,"origin_id":463173256,"user_origin_id":4343568,"create_time":1550059173,"update_time":1550059173,"id":1729659274921,"updated_at":"2024-10-23T04:54:34.920000Z","created_at":"2024-10-23T04:54:34.920000Z"},{"_id":"6718818b4febc2515c115948","body":"Awesome! Thank you, man! I will tell you in a couple of days (hopefully) if I've managed to reproduce your results (reach more or less same quality)","issue_id":1715516129736,"origin_id":463174755,"user_origin_id":32035001,"create_time":1550059473,"update_time":1550059473,"id":1729659275626,"updated_at":"2024-10-23T04:54:35.625000Z","created_at":"2024-10-23T04:54:35.625000Z"},{"_id":"6718818b4febc2515c115949","body":"> Awesome! Thank you, man! I will tell you in a couple of days (hopefully) if I've managed to reproduce your results (reach more or less same quality)\r\n\r\nDid you use pretrained model\uff1f\uff1f\r\n\r\n","issue_id":1715516129736,"origin_id":463939177,"user_origin_id":10268274,"create_time":1550216466,"update_time":1550216466,"id":1729659275829,"updated_at":"2024-10-23T04:54:35.829000Z","created_at":"2024-10-23T04:54:35.829000Z"},{"_id":"6718818c4febc2515c11594a","body":"@Johnson-yue Yes, it works good","issue_id":1715516129736,"origin_id":463944230,"user_origin_id":32035001,"create_time":1550217730,"update_time":1550217730,"id":1729659276023,"updated_at":"2024-10-23T04:54:36.022000Z","created_at":"2024-10-23T04:54:36.022000Z"},{"_id":"6718818c4febc2515c11594b","body":"@rosinality I've reached more or less same result. Did you try CelebA-HQ? How do you think if I will increase number of layer - will it generate HQ images?\r\n\r\n","issue_id":1715516129736,"origin_id":464752486,"user_origin_id":32035001,"create_time":1550500415,"update_time":1550500415,"id":1729659276116,"updated_at":"2024-10-23T04:54:36.116000Z","created_at":"2024-10-23T04:54:36.116000Z"},{"_id":"6718818c4febc2515c11594c","body":"@voa18105 I didn't tried, but I think it will work - network architecture is almost same. But you will also need to modify train script, as I hard coded things a lot. :\/","issue_id":1715516129736,"origin_id":464922427,"user_origin_id":4343568,"create_time":1550533119,"update_time":1550533119,"id":1729659276220,"updated_at":"2024-10-23T04:54:36.220000Z","created_at":"2024-10-23T04:54:36.220000Z"},{"_id":"6718818c4febc2515c11594d","body":"@rosinality thanks, I think I am gonna try it nearest days","issue_id":1715516129736,"origin_id":465030054,"user_origin_id":32035001,"create_time":1550563974,"update_time":1550563974,"id":1729659276436,"updated_at":"2024-10-23T04:54:36.436000Z","created_at":"2024-10-23T04:54:36.436000Z"},{"_id":"6718818c4febc2515c11594e","body":"Hi,\r\nWould it be possible to make the discriminator weights available too? I would like to be able to fine tune the model.\r\nThanks so much :)","issue_id":1715516129736,"origin_id":491223053,"user_origin_id":14334441,"create_time":1557480293,"update_time":1557480293,"id":1729659276626,"updated_at":"2024-10-23T04:54:36.626000Z","created_at":"2024-10-23T04:54:36.626000Z"},{"_id":"6718818f4febc2515c11594f","body":"@anuragranj https:\/\/drive.google.com\/file\/d\/1SFn7GygaLYhOobNQH_eqICcQETDcBC0X\/view I think you can use this. Trained using FFHQ, 140k iter, 256px.","issue_id":1715516129736,"origin_id":491271587,"user_origin_id":4343568,"create_time":1557491346,"update_time":1557491346,"id":1729659279761,"updated_at":"2024-10-23T04:54:39.761000Z","created_at":"2024-10-23T04:54:39.761000Z"},{"_id":"671881904febc2515c115950","body":"Thanks a lot @rosinality ! :) ","issue_id":1715516129736,"origin_id":491274250,"user_origin_id":14334441,"create_time":1557491928,"update_time":1557491928,"id":1729659280064,"updated_at":"2024-10-23T04:54:40.064000Z","created_at":"2024-10-23T04:54:40.064000Z"},{"_id":"671881904febc2515c115951","body":"> @anuragranj https:\/\/drive.google.com\/file\/d\/1SFn7GygaLYhOobNQH_eqICcQETDcBC0X\/view I think you can use this. Trained using FFHQ, 140k iter, 256px.\r\n\r\nI compared this weigts and weits that you gave in the issue #13 Are they the same? As far as I understand they are different both in quality and somehow in the architecture (maybe I'm wrong about architecture, but somewhy I get an error in to_rgb dimensions in my wrapper, but maybe it's my problem). \r\n","issue_id":1715516129736,"origin_id":493421494,"user_origin_id":5480856,"create_time":1558092695,"update_time":1558092695,"id":1729659280165,"updated_at":"2024-10-23T04:54:40.165000Z","created_at":"2024-10-23T04:54:40.165000Z"},{"_id":"671881904febc2515c115952","body":"In the #13 you stated that the checkpoint is made on the same 140k iterations. But comparing the same latent vector images are similar but different in quality:\r\nfrom the #13 \r\n![image](https:\/\/user-images.githubusercontent.com\/5480856\/57925423-e4388f80-78b0-11e9-8b54-d37c88626622.png)\r\n\r\nfrom current issue:\r\n![image](https:\/\/user-images.githubusercontent.com\/5480856\/57925449-f4506f00-78b0-11e9-9159-17c4b434dcb8.png)\r\n\r\nMaybe you occasionally mixed up train iteration?","issue_id":1715516129736,"origin_id":493422214,"user_origin_id":5480856,"create_time":1558092905,"update_time":1558092973,"id":1729659280357,"updated_at":"2024-10-23T04:54:40.356000Z","created_at":"2024-10-23T04:54:40.356000Z"},{"_id":"671881904febc2515c115953","body":"@PgLoLo https:\/\/drive.google.com\/file\/d\/1SFn7GygaLYhOobNQH_eqICcQETDcBC0X\/view is generator\/discriminator checkpoints, and https:\/\/drive.google.com\/file\/d\/1TVdUGOcMRVTVaxLhmh2qVmPgWIlwE0if\/view is running average of generator weights. So they are different.","issue_id":1715516129736,"origin_id":493424604,"user_origin_id":4343568,"create_time":1558093544,"update_time":1558093544,"id":1729659280564,"updated_at":"2024-10-23T04:54:40.564000Z","created_at":"2024-10-23T04:54:40.564000Z"},{"_id":"671881914febc2515c115954","body":"@rosinality Oh, I see, thank you very much!","issue_id":1715516129736,"origin_id":493428163,"user_origin_id":5480856,"create_time":1558094438,"update_time":1558094438,"id":1729659281968,"updated_at":"2024-10-23T04:54:41.968000Z","created_at":"2024-10-23T04:54:41.968000Z"},{"_id":"671881924febc2515c115955","body":"Can you please upload some images while the training was happening. So like lower resolution images. e.g. 8X8 ones and then some 16X16 and so on. Mine look something like this\r\n![image](https:\/\/user-images.githubusercontent.com\/10944728\/68139725-ebb92700-ff2a-11e9-97c5-53813a81ec90.png) at 8X8 then like this at 16X16 \r\n![image](https:\/\/user-images.githubusercontent.com\/10944728\/68139822-1dca8900-ff2b-11e9-9d8b-5ab512ef2e83.png). I am trying to distill one with some conditioning over the shape and appearance and so on so the very similar looking ones are by design. :-) and no mode collapse. however higher up in the resolution I get weird looking ones like globally disfigured ones. Did this happen to any one else? e.g.\r\n![image](https:\/\/user-images.githubusercontent.com\/10944728\/68140085-7f8af300-ff2b-11e9-882f-00a0842d44ca.png)\r\n\r\nAny idea what might be going wrong?\r\n","issue_id":1715516129736,"origin_id":549444334,"user_origin_id":10944728,"create_time":1572886204,"update_time":1572886204,"id":1729659282069,"updated_at":"2024-10-23T04:54:42.069000Z","created_at":"2024-10-23T04:54:42.069000Z"},{"_id":"671881924febc2515c115956","body":"@ParthaEth Actually some weird samples can be happen as training steps between each phases are not that large. I think you can train more to get better results.","issue_id":1715516129736,"origin_id":549665347,"user_origin_id":4343568,"create_time":1572930651,"update_time":1572930651,"id":1729659282381,"updated_at":"2024-10-23T04:54:42.381000Z","created_at":"2024-10-23T04:54:42.381000Z"},{"_id":"671881924febc2515c115957","body":"You mean at every step before switching to next resolution?","issue_id":1715516129736,"origin_id":549761031,"user_origin_id":10944728,"create_time":1572949450,"update_time":1572949450,"id":1729659282874,"updated_at":"2024-10-23T04:54:42.874000Z","created_at":"2024-10-23T04:54:42.874000Z"},{"_id":"671881934febc2515c115958","body":"@ParthaEth Yes, you can train more at certain resolutions as training iterations during each phases are maybe not enough.","issue_id":1715516129736,"origin_id":551106248,"user_origin_id":4343568,"create_time":1573137447,"update_time":1573137447,"id":1729659283083,"updated_at":"2024-10-23T04:54:43.083000Z","created_at":"2024-10-23T04:54:43.083000Z"}] comment

Can you / will you upload any pretrained model to compare results, please?