xthan / VITON

Code and dataset for paper "VITON: An Image-based Virtual Try-on Network"
534 stars 143 forks source link

Stage 2 Output images are all black #9

Open Neuroforge opened 6 years ago

Neuroforge commented 6 years ago

Hello,

I am running this code.

Stage 1 works fine.

Stage 2 runs but outputs black images. I am using Octave and not Matlab to run shape_context_warp.m. Is the output of this available online?

Regards,

Daniel

silky commented 6 years ago

yes, i'm in exactly the same situation as you; i think it doesn't work with octave ...

SheikArbaz commented 6 years ago

Are all the images black?

silky commented 6 years ago

yep; all of them in the stage2 html file

Neuroforge commented 6 years ago
screen shot 2018-05-11 at 6 25 29 pm

All of the images are black.

SheikArbaz commented 6 years ago

It means TPS points are not extracted. Run extract_tps.m in matlab.

silky commented 6 years ago

if i run extract_tps from the ./prepare_data/` folder, i get

error: save: unable to open output file '../data/tps/000003_0.mat'

and indeed; in the data folder of the root dit, there is no tps folder ... ?

am i missing something?

-- edit: i think the problem is that it needs to point to ./results/stage1/tps instead; so i've symlinked it. it's running now, but i think it's going to take a few hours at least.

ghost commented 6 years ago

You are missing tps data..... download from google drive mentioned in the ReadMe of the project.

silky commented 6 years ago

@arbaz-j-7 that's mentioned in the readme for training, not for testing, which is what i'm trying to do. is it still necessary? because i just did it, and it doesn't seem to have worked...

ghost commented 6 years ago

I think, TPS of the test images is also required as an input to the network.

Neuroforge commented 6 years ago

Could someone help turn the Matlab tps parser into Python?

perseus784 commented 6 years ago

Even I am facing the same issue, all the images are black. Anybody found a solution?

xthan commented 6 years ago

Sorry that there are some hardcoded paths in https://github.com/xthan/VITON/blob/master/model_zalando_refine_test.py

If you are getting blank images, probably the tps results (.mat files) are not available.

Neuroforge commented 6 years ago

The problem is the not everyone has Matlab, we used the Open Source program Octave.

Octave != Matlab = Black Images.

Can the Matlab scripts be converted to Python?

perseus784 commented 6 years ago

@Neuroforge Is model_zolando_refine_test.py calling .m files internally?

Neuroforge commented 6 years ago

Nope. It has to be called between stage 1 and stage 2 in order to parse the new tps points.

perseus784 commented 6 years ago

Exactly which matlab file should be run between both stages?...and Is there any other steps that should be run beforerunning test_stage2.sh?

Neuroforge commented 6 years ago

In the instructions of the Readme the second stage requires a Matlab script to be called.

Second stage

Run the matlab script shape_context_warp.m to extract the TPS transformation control points.

When run with Octave, as Matlab is expensive, it produces the error output.

Neuroforge commented 6 years ago

Also in training new data Matlab is also required.....

First run extract_tps.m. This will take sometime, you can try run it in parallel or directly download the pre-computed TPS control points via Google Drive and put them in data/tps/.

RohanBhandari commented 6 years ago

I found a solution for running shape_context_warp.m with Octave: simply change L57 in shape_context_warp.m from save([MASK_DIR, image_name1, '_', image_name2, '_tps.mat'], 'control_points'); to save([MASK_DIR, image_name1, '_', image_name2, '_tps.mat'], 'control_points', '-v6');.

This saves the file in a format that python can open when using Octave.

I have submitted a PR to implement this quick fix.

Neuroforge commented 6 years ago

@RohanBhandari Does this fix work for testing or training, or both?

I'm still getting black output image from stage2, even with this change. Any other advice?

The original tps files are 197Kb but after this fix they are only 2kb.

RohanBhandari commented 6 years ago

I have only used it for testing. I think there may be other places where a similar fix is needed for training.

If it's still not working for testing, double-check that you have the "image" package installed for Octave and load it by adding the line pkg load image; to the beginning of the shape_context_warp.m script.

If that still doesn't work, I would remove the "try" statement from this block, as it suppresses the error output when the function fails. Then you can debug based on the error message.

royaljain commented 5 years ago

@Neuroforge did it work with octave for you ?

berkkara34 commented 5 years ago

Has anyone managed to train the network with another dataset?