StyleFlow icon indicating copy to clipboard operation
StyleFlow copied to clipboard

light transfer

Open abdallahdib opened this issue 4 years ago • 7 comments
trafficstars

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

abdallahdib avatar Jan 18 '21 09:01 abdallahdib

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.

RameenAbdal avatar Jan 18 '21 10:01 RameenAbdal

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

abdallahdib avatar Jan 18 '21 12:01 abdallahdib

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

Am I missing something?

molo32 avatar Jan 19 '21 00:01 molo32

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

abdallahdib avatar Jan 19 '21 00:01 abdallahdib

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

molo32 avatar Jan 19 '21 00:01 molo32

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

abdallahdib avatar Jan 19 '21 07:01 abdallahdib

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 : https://github.com/RameenAbdal/StyleFlow/issues/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.

provostm avatar Feb 10 '21 09:02 provostm