xthan/VITON

Stage 2 Output images are all black

Neuroforge opened this issue ยท 23 comments

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

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

Are all the images black?

silky commented

yep; all of them in the stage2 html file

screen shot 2018-05-11 at 6 25 29 pm

All of the images are black.

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

silky commented

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.

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

silky commented

@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...

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

Could someone help turn the Matlab tps parser into Python?

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

xthan commented

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.

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?

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

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

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

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.

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/.

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.

@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.

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.

@Neuroforge did it work with octave for you ?

Has anyone managed to train the network with another dataset?