Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

light transfer #41

Open
abdallahdib opened this issue Jan 18, 2021 · 7 comments
Open

light transfer #41

abdallahdib opened this issue Jan 18, 2021 · 7 comments

Comments

@abdallahdib
Copy link

Hi Rameen,

Thank for this sharing the code, i was trying to reproduce ur results on my own images. i prepared all the npy and pickle files.

I still have two questions:
for light: I used SfsNet to estimate SH light and then used sfs2shtools from DRP to convert to shtools format. after running light transfer with styleFlow, i have the feeling that the light is mirrored on vetical axis. can you plz tell us if something is wrong with what we did? is that what StyleFLow is expecting for light representation ?

for MS azure expression: can u tell which field u are using exactly?

Cheers

@RameenAbdal
Copy link
Owner

I would recommend using the model predictions of DPR model here rather than converting the SH parameters from other models. Maybe the coordinate systems are mirrored. For the expression 'smile' attribute is used.

@abdallahdib
Copy link
Author

abdallahdib commented Jan 18, 2021

thanks Raeen for your quick prompt. after following ur suggestion everything works just fine! Many thanks!!

@molo32
Copy link

molo32 commented Jan 19, 2021

how to use DPR with this job?
DPR only returns * jpg *png as output.

Am I missing something?

@abdallahdib
Copy link
Author

at line 87 from the script here
u can see that network estimates in addition to the final image output, the light (sh) of the input image (outputSH)

outputImg, _, outputSH, _ = my_network(inputL, sh, 0)

this outputSH can then be used by styleFlow

@molo32
Copy link

molo32 commented Jan 19, 2021

mmm yes I see it!
but how do I save and load in styleflow?

@abdallahdib
Copy link
Author

abdallahdib commented Jan 19, 2021

i share here a dirty and messy code i did urgently for a deadline. these 3 scripts allow to prepare data for styleflow.
azureRun.py : used to fetch images attributes from MS azure ( u need to have an ms azure account it is free plz replace ur key and end point in the script)
psp.py: generate psp latent code ( u have to install psp)
testNetwork_demo_1024.py: generate lighting (install DPR)

i have 3 different conda env for psp, DPR and styleflow. I didnt have time to create a single env fo all of them.
if someone has the time to clean the mess in this code and send a pull request could be useful. these scripts have nothing genius they are basically an assembly of existing code from original authors.

to get these scripts to work u will have to fix the 'listImages' function in all of these scripts.

PS: tested on ubuntu 18.04

good luck
styleFlow.zip

@provostm
Copy link

i share here a dirty and messy code i did urgently for a deadline. these 3 scripts allow to prepare data for styleflow.
azureRun.py : used to fetch images attributes from MS azure ( u need to have an ms azure account it is free plz replace ur key and end point in the script)
psp.py: generate psp latent code ( u have to install psp)
testNetwork_demo_1024.py: generate lighting (install DPR)

i have 3 different conda env for psp, DPR and styleflow. I didnt have time to create a single env fo all of them.
if someone has the time to clean the mess in this code and send a pull request could be useful. these scripts have nothing genius they are basically an assembly of existing code from original authors.

to get these scripts to work u will have to fix the 'listImages' function in all of these scripts.

PS: tested on ubuntu 18.04

good luck
styleFlow.zip

I try to do what you said in one env but it seems that psp needs Cuda 10.1 when StyleFlow needs Cuda 10.0 so I guess we need 2 separate envs.

Can you provide a bit more "how-to" information about your procedure?

I try to combine your azurerun script with what is said in issue : #14
But I have an issue with the images.npy because it is not readable in a np.load function.
It is a bit messy so far but I try to run this application on my own pictures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants